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_reporting] Refactor parser and upload script to allow JSON files as input #2846

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

daall
Copy link
Contributor

@daall daall commented Jan 21, 2021

  • Refactor junit_xml_parser to validate JSON test result files
  • Refactor report_uploader to accept JSON files as input

Signed-off-by: Danny Allen [email protected]

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

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

…s as input

- Refactor junit_xml_parser to validate JSON test result files
- Refactor report_uploader to accept JSON files as input

Signed-off-by: Danny Allen <[email protected]>
@daall daall requested review from yxieca and a team January 21, 2021 22:14
@daall daall merged commit 2f0b561 into sonic-net:master Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants