-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix result handling for class methods
Fix result handling for class methods Resolve the issue where the pytest plugin failed to update the original XML file for flaky tests when the test function was inside a class. Now it properly compares and updates test results for both standalone functions and class methods. Refactor uid handling for conciseness and clarity. ROCKY-18669
- Loading branch information
1 parent
27c6921
commit 946645d
Showing
8 changed files
with
152 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<testsuites> | ||
<testsuite errors="0" failures="0" hostname="BRWS009" name="pytest" skipped="0" tests="3" time="0.035" timestamp="2022-10-04T15:10:10.669419"> | ||
<testcase classname="src.test_flaky" name="test_xml_one_failed_two_passed" time="0.000" /> | ||
<testcase classname="src.test_flaky" name="test_xml_two_failed_one_passed" time="0.000" /> | ||
<testcase classname="src.test_flaky" name="test_xml_three_failed_zero_passed" time="0.000" /> | ||
<testcase classname="test.test_flaky" name="test_xml_first_retest_failed" time="0.000" /> | ||
<testcase classname="test.test_flaky" name="test_xml_second_retest_failed" time="0.000" /> | ||
</testsuite> | ||
</testsuites> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<testsuites> | ||
<testsuite errors="0" failures="1" hostname="BRWS009" name="pytest" skipped="0" tests="3" time="0.035" timestamp="2022-10-04T15:10:10.669419"> | ||
<testcase classname="src.test_flaky" name="test_xml_one_failed_two_passed" time="0.000" /> | ||
<testcase classname="src.test_flaky" name="test_xml_two_failed_one_passed" time="0.000" /> | ||
<testcase classname="src.test_flaky" name="test_xml_three_failed_zero_passed" time="0.000"> | ||
<failure message="assert False">def test_xml_three_failed_zero_passed(): | ||
<testcase classname="test.test_flaky" name="test_passed" time="0.000" /> | ||
<testcase classname="test.test_flaky" name="test_one_failure_passed" time="0.000"> | ||
<failure message="assert False">def test_one_failure_passed(): | ||
> assert False | ||
E assert False | ||
|
||
src/test_flaky.py:16: AssertionError</failure> | ||
test/test_flaky.py:16: AssertionError</failure> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> |
14 changes: 14 additions & 0 deletions
14
test/test_pytest_update_test_results/one_failure_duplicated_names.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<testsuites> | ||
<testsuite errors="0" failures="1" hostname="BRWS009" name="pytest" skipped="0" tests="3" time="0.035" timestamp="2022-10-04T15:10:10.669419"> | ||
<testcase classname="test.test_flaky" name="test_name" time="0.000" /> | ||
<testcase classname="test.test_flaky.OtherClassName" name="test_duplicated_test_names" time="0.000" /> | ||
<testcase classname="test.test_flaky.Test" name="test_duplicated_test_names" time="0.000"> | ||
<failure message="assert False">def test_duplicated_test_names(): | ||
> assert False | ||
E assert False | ||
|
||
test/test_flaky.py:8: AssertionError</failure> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> |
10 changes: 5 additions & 5 deletions
10
test/test_pytest_update_test_results/one_failure_one_error.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<testsuites> | ||
<testsuite errors="1" failures="1" hostname="BRWS009" name="pytest" skipped="0" tests="3" time="0.035" timestamp="2022-10-04T15:10:10.669419"> | ||
<testcase classname="src.test_flaky" name="test_xml_one_failed_two_passed" time="0.000"> | ||
<failure message="assert False">def test_xml_one_failed_two_passed(): | ||
<testcase classname="test.test_flaky" name="test_failure_passed" time="0.000"> | ||
<failure message="assert False">def test_failure_passed(): | ||
> assert False | ||
E assert False | ||
|
||
src/test_flaky.py:8: AssertionError</failure> | ||
</testcase><testcase classname="src.test_flaky" name="test_xml_two_failed_one_passed" time="0.000" /> | ||
<testcase classname="src.test_flaky" name="test_xml_three_failed_zero_passed" time="0.000"> | ||
<error message="failed on setup with "worker 'gw5' crashed while running 'test_xml_three_failed_zero_passed'"">worker 'gw5' crashed while running 'build/bare_tests/source/python/_python_tests/rocky30/core/simulator/_tests/test_rocky_solver_process.py::testRockyFluentTwoWaySolverMisconfiguration'</error> | ||
</testcase><testcase classname="src.test_flaky" name="test_error_passed" time="0.000" /> | ||
<testcase classname="test.test_flaky" name="test_error_passed" time="0.000"> | ||
<error message="failed on setup with "worker 'gw5' crashed while running 'test_error_passed'"">worker 'gw5' crashed while running 'build/bare_tests/source/python/_python_tests/rocky30/core/simulator/_tests/test_rocky_solver_process.py::testRockyFluentTwoWaySolverMisconfiguration'</error> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> |
13 changes: 13 additions & 0 deletions
13
test/test_pytest_update_test_results/one_failure_unittest_style.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<testsuites> | ||
<testsuite errors="0" failures="1" hostname="BRWS009" name="pytest" skipped="0" tests="3" time="0.035" timestamp="2022-10-04T15:10:10.669419"> | ||
<testcase classname="test.test_flaky" name="test_name" time="0.000" /> | ||
<testcase classname="test.test_flaky.Test" name="test_xml_failure_unittest_style" time="0.000"> | ||
<failure message="assert False">def test_xml_failure_unittest_style(): | ||
> assert False | ||
E assert False | ||
|
||
test/test_flaky.py:8: AssertionError</failure> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters