Skip to content

Commit

Permalink
Fix failure case number in test result summary incorrect issue (sonic…
Browse files Browse the repository at this point in the history
…-net#10485)

What is the motivation for this PR?
In test summary, failures += failure + error, but in fact, if a testcase failed with both failure and error, the count of failure and error would both +1, so it's unnecessary to calculate in that way

How did you do it?
Let failures += failure

How did you verify/test it?
Run a test with both failure and error, and check the test result xml file
  • Loading branch information
xwjiang-ms authored and mssonicbld committed Oct 26, 2023
1 parent 9566b55 commit b3d60c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_reporting/junit_xml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def _extract_test_summary(test_cases):
# The result field is unique per test case, either error or failure.
# xfails is the counter for all kinds of xfail results (include success/failure/error/skipped)
test_result_summary["tests"] += 1
test_result_summary["failures"] += case["result"] == "failure" or case["result"] == "error"
test_result_summary["failures"] += case["result"] == "failure"
test_result_summary["skipped"] += case["result"] == "skipped"
test_result_summary["errors"] += case["error"]
test_result_summary["time"] += float(case["time"])
Expand Down

0 comments on commit b3d60c4

Please sign in to comment.