-
Notifications
You must be signed in to change notification settings - Fork 10
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
CI: Improve unit tests to test the bugtool's main() as well #44
CI: Improve unit tests to test the bugtool's main() as well #44
Conversation
0fcba23
to
4aab454
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #44 +/- ##
===========================================
+ Coverage 56.52% 84.90% +28.37%
===========================================
Files 8 15 +7
Lines 1647 1928 +281
===========================================
+ Hits 931 1637 +706
+ Misses 716 291 -425
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
8339b98
to
6fd8091
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While there's quite a bit of code being introduced, it's just in the tests and not on the deployed code.
This, along with the coverage report that ensure the new code is run, makes the PR low-risk
6fd8091
to
5fa903c
Compare
@psafont Thank you for your review and approval!
Exactly, fully agreed! I just pushed the final minor fixes of the GitHub Workflow file Could you review the changes? They are:
|
Add tests/unit/test_main.py which also uses test functions which were added for earlier tests to test the main function of bugtool to produce the bugtool output archives for all types: zip, tar, and tar.bz2. The main test checks the output of the bugtool application to ensure that it matches the expected output. It compares the captured output with the expected output and performs various assertions to validate the output. It extracts the output files from the archive and checks that the xAPI db and the inventory.xml. Tested output: - The start and end of the collected bugtool messages from captured.out - The inventory.xml file is checked to be validated using its XML schema. - The xapi-db.xml is checked to have secrets filtered using a dummy xapi db Signed-off-by: Bernhard Kaindl <[email protected]>
5fa903c
to
0783b2f
Compare
This PR raises the code coverage from of the bugtool script itself
from 50% to 84% by running almost all of
bugtool
from a single testmodule by testing the bugtool's main() function.
This allows for full testing of nearly any other fixes and changes:
Add tests/unit/test_main.py which also uses test functions which were
added for earlier tests to test the main function of bugtool to produce
the bugtool output archives for all types: zip, tar, and tar.bz2.
The main test checks the output of the bugtool application to ensure that
it matches the expected output. It compares the captured output with the
expected output and performs various assertions to validate the output.
It extracts the output files from the archive and checks that the xAPI db
and the inventory.xml.
Tested output: