Skip to content

Commit

Permalink
Change generate_json_report to parse root <testsuites> tag
Browse files Browse the repository at this point in the history
On August 15th, `pytest` released version 5.1.0 https://pypi.org/project/pytest/#history

This version adds a new root `<testsuites>` tag. See pytest-dev/pytest#5477

```xml
<testsuites>
<testsuite errors="0" failures="18" hostname="3a266349df18" name="pytest" skipped="0" tests="30" time="13427.235" timestamp="2019-08-23T04:05:15.798369">
...
```

```xml
<testsuite errors="204" failures="9" name="pytest" skipped="0" tests="793" time="947565.5930000005">
...
```

This patch parses that tag properly.

Signed-off-by: Sean Smith <[email protected]>
  • Loading branch information
sean-smith authored and lukeseawalker committed Nov 13, 2019
1 parent 8f5359f commit b110909
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration-tests/reports_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def generate_json_report(test_results_dir, save_to_file=True):
result_to_label_mapping = {"skipped": "skipped", "failure": "failures", "error": "errors"}
results = {"all": _empty_results_dict()}
xml = untangle.parse(test_report_file)
for testcase in xml.testsuite.children:
for testcase in xml.testsuites.testsuite.children:
label = "succeeded"
for key, value in result_to_label_mapping.items():
if hasattr(testcase, key):
Expand Down

0 comments on commit b110909

Please sign in to comment.