-
Notifications
You must be signed in to change notification settings - Fork 2
Refactor integration test XML parsing #520
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
Conversation
- Move parsing from other modules into this XML parser - Remove unnecessary arguments, functions, etc. - Reduce coupling
Also, remove the parsers directory, move the integration test parser back to github-ci, and separate out the JUnitXMLParser and IntegrationTestSummary classes
…o amogan/refactor_xml_parsing
|
Approved, based on the following:
|
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
…o amogan/refactor_xml_parsing
In the process of trying to centralize some Slack message payload generation logic, I noticed significant duplication of junit XML parsing logic (my fault). This PR centralizes all parsing of junit XML files output by integration tests into the
JUnitXMLParserclass. Furthermore, this parser class makes use of theIntegrationTestSummary,PytestResult, andTestCaseResultclasses, which better reflect the hierarchical structure of pytest output. For example, thelistrev_test.pyresult is summarized in aPytestResult, while individual tests such astest_nanorc_successare summarized in aTestCaseResult. TheIntegrationTestSummarythen contains a list ofPytestResults(which themselves contain a list ofTestCaseResults) and computes the totals automatically. These classes were previously contained in the CI dashboard module which parses integration test results, but are now contained inscripts/github-ci/integration_test_summary.py. Basically, this provides better separation of concerns and reduces unnecessary coupling.Realizing this structure involves several changes to other modules account for this:
Successful workflows using this branch:
Note that
slack_payload_generator.pyis still using its own, redundant parsing logic. This PR is already quite invasive, so I'll file a separate PR for overhauling the Slack message logic, which similarly could use some refactoring.