[test_reporting] Refactor parser and upload script to allow JSON files as input #2846
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Danny Allen [email protected]
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
It would be helpful to be able to use the junit_xml_parser to produce JSON files, so they can be saved/shared later, but also be able to re-use that JSON file in the test_report_uploader script without having to parse the XML files again.
How did you do it?
I added methods for validating the correctness of a given JSON test result file to the parser. Then, I added options so that a JSON file with test results already parsed can be passed into both the parser script and report_uploader script so that it can be used instead of an XML file/directory.
How did you verify/test it?
Verified that files output from the junit_xml_parser tool succesfully validate, and that removing fields from these files (like test names, timestamps, etc.) causes the files to fail to validate/upload.
Any platform specific information?
N/A
Supported testbed topology if it's a new test case?
N/A
Documentation