Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/launchpad: Some refactorings #235

Merged
merged 6 commits into from Oct 31, 2023
Merged

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Oct 26, 2023

  • Import Report from apport.report
  • Introduce _create_bug_from_report()
  • set default description in _file_bug
  • Also return web_link in _file_bug
  • pass signal as int to _generate_sigsegv_report
  • Move more parts into _generate_sigsegv_report()

Successfully tested Launchpad tests locally:

TEST_LAUNCHPAD=1 python3 -m unittest tests/integration/test_crashdb_launchpad.py

So the failing codecov/patch can be ignored.

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #235 (c7e96c4) into main (5d900fa) will increase coverage by 0.02%.
The diff coverage is 10.81%.

@@            Coverage Diff             @@
##             main     #235      +/-   ##
==========================================
+ Coverage   83.69%   83.72%   +0.02%     
==========================================
  Files          93       93              
  Lines       18757    18751       -6     
==========================================
  Hits        15699    15699              
+ Misses       3058     3052       -6     
Files Coverage Δ
tests/integration/test_crashdb_launchpad.py 13.75% <10.81%> (+0.15%) ⬆️

Copy link
Contributor

@schopin-pro schopin-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Just a single question, not blocking though.

tests/integration/test_crashdb_launchpad.py Show resolved Hide resolved
tests/integration/test_crashdb_launchpad.py Outdated Show resolved Hide resolved
Shorten the code by importing `Report` instead of using
`apport.report.Report`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Move duplicate code into the helper function `_create_bug_from_report`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Let `_file_bug` return the web link to avoid needing to construct it on
our own afterwards.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
@schopin-pro schopin-pro merged commit da13737 into canonical:main Oct 31, 2023
24 of 25 checks passed
@bdrung bdrung deleted the launchpad branch October 31, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants