diff --git a/python/test/files/junit-xml/flaky.annotations b/python/test/files/junit-xml/flaky.annotations new file mode 100644 index 00000000..4c883a67 --- /dev/null +++ b/python/test/files/junit-xml/flaky.annotations @@ -0,0 +1,79 @@ +[ + { + 'name': 'Test Results', + 'head_sha': 'commit sha', + 'status': 'completed', + 'conclusion': 'failure', + 'output': { + 'title': '1 errors, 1 fail, 2 pass in 0s', + 'summary': + '1 files\u2004\u20031 suites\u2004\u2003\u20020s ' + '[:stopwatch:](https://github.com/EnricoMi/publish-unit-test-result-ac' + 'tion/blob/VERSION/README.md#the-symbols "duration of all tests")\n4 ' + 'tests\u20032 ' + '[:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-re' + 'sult-action/blob/VERSION/README.md#the-symbols "passed tests")\u2003' + '0 ' + '[:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/b' + 'lob/VERSION/README.md#the-symbols "skipped / disabled tests")\u20031 ' + '[:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blo' + 'b/VERSION/README.md#the-symbols "failed tests")\u20031 ' + '[:fire:](https://github.com/EnricoMi/publish-unit-test-result-action/' + 'blob/VERSION/README.md#the-symbols "test errors")\n2 runs\u2006\u2003' + '0 ' + '[:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-re' + 'sult-action/blob/VERSION/README.md#the-symbols "passed tests")\u2003' + '0 ' + '[:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/b' + 'lob/VERSION/README.md#the-symbols "skipped / disabled tests")\u20031 ' + '[:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blo' + 'b/VERSION/README.md#the-symbols "failed tests")\u20031 ' + '[:fire:](https://github.com/EnricoMi/publish-unit-test-result-action/' + 'blob/VERSION/README.md#the-symbols "test errors")\n\nResults for ' + 'commit commit s.\n\n' + '[test-results]:data:application/gzip;base64,H4sIAAAAAAAC/02MQQ6AIAwEv' + '0I4e1Djyc8QghobBUwLJ+PfrYjIbWe3nVMusM8kR9E1QlKEUGCKqAN4x9gy8hCeafiyom' + 'gMF/1fbHDU12rRsGfbW8yIHnOD0VF+f+Knawv/tsSVLHHtMt5aCAw5CVq1vG6wyJ3P3QA' + 'AAA==\n', + 'annotations': [ + { + 'path': 'example.ExampleTests', + 'start_line': 0, + 'end_line': 0, + 'annotation_level': 'failure', + 'message': 'flaky.xml\u2003[took 0s]', + 'title': 'throwsAlways (example.ExampleTests) with error', + 'raw_details': + 'Always throws exception\njava.lang.RuntimeException: Always throws ' + 'exception\n\tat ' + 'example.ExampleTests.throwsAlways(ExampleTests.java:26)' + }, + { + 'path': 'example.ExampleTests', + 'start_line': 0, + 'end_line': 0, + 'annotation_level': 'warning', + 'message': 'flaky.xml\u2003[took 0s]', + 'title': 'failsAssertionAlways (example.ExampleTests) failed', + 'raw_details': + 'Always fails assertion ==> expected: <1> but was: <2>\n' + 'org.opentest4j.AssertionFailedError: Always fails assertion ==> ' + 'expected: <1> but was: <2>\n\tat ' + 'example.ExampleTests.failsAssertionAlways(ExampleTests.java:40)' + }, + { + 'path': '.github', + 'start_line': 0, + 'end_line': 0, + 'annotation_level': 'notice', + 'message': 'There are 4 tests, see "Raw output" for the full list of tests.', + 'title': '4 tests found', + 'raw_details': + 'example.ExampleTests ‑ failsAssertionAlways\nexample.ExampleTests ' + '‑ failsAssertionOnlyFirstAttempt\nexample.ExampleTests ‑ ' + 'throwsAlways\nexample.ExampleTests ‑ throwsOnlyFirstAttempt' + } + ] + } + } +] \ No newline at end of file diff --git a/python/test/files/junit-xml/flaky.junit-xml b/python/test/files/junit-xml/flaky.junit-xml new file mode 100644 index 00000000..e01b48e0 --- /dev/null +++ b/python/test/files/junit-xml/flaky.junit-xml @@ -0,0 +1,57 @@ + + + + java.lang.RuntimeException: Always throws exception + at example.ExampleTests.throwsAlways(ExampleTests.java:26) + + + java.lang.RuntimeException: Always throws exception + at example.ExampleTests.throwsAlways(ExampleTests.java:26) + + + + java.lang.RuntimeException: Always throws exception + at example.ExampleTests.throwsAlways(ExampleTests.java:26) + + + + java.lang.RuntimeException: Always throws exception + at example.ExampleTests.throwsAlways(ExampleTests.java:26) + + + + + org.opentest4j.AssertionFailedError: Always fails assertion ==> expected: <1> but was: <2> + at example.ExampleTests.failsAssertionAlways(ExampleTests.java:40) + + + org.opentest4j.AssertionFailedError: Always fails assertion ==> expected: <1> but was: <2> + at example.ExampleTests.failsAssertionAlways(ExampleTests.java:40) + + + + org.opentest4j.AssertionFailedError: Always fails assertion ==> expected: <1> but was: <2> + at example.ExampleTests.failsAssertionAlways(ExampleTests.java:40) + + + + org.opentest4j.AssertionFailedError: Always fails assertion ==> expected: <1> but was: <2> + at example.ExampleTests.failsAssertionAlways(ExampleTests.java:40) + + + + + + org.opentest4j.AssertionFailedError: First attempt fails assertion ==> expected: <1> but was: <2> + at example.ExampleTests.failsAssertionOnlyFirstAttempt(ExampleTests.java:32) + + + + + + java.lang.RuntimeException: First attempt throws exception + at example.ExampleTests.throwsOnlyFirstAttempt(ExampleTests.java:18) + + + + diff --git a/python/test/files/junit-xml/flaky.results b/python/test/files/junit-xml/flaky.results new file mode 100644 index 00000000..35d60ed1 --- /dev/null +++ b/python/test/files/junit-xml/flaky.results @@ -0,0 +1,78 @@ +publish.unittestresults.ParsedUnitTestResults( + files=1, + errors=[], + suites=1, + suite_tests=2, + suite_skipped=0, + suite_failures=1, + suite_errors=1, + suite_time=0, + suite_details=[ + publish.unittestresults.UnitTestSuite( + name='example.ExampleTests', + tests=2, + skipped=0, + failures=1, + errors=1, + stdout=None, + stderr=None + ) + ], + cases=[ + publish.unittestresults.UnitTestCase( + result_file='flaky.xml', + test_file=None, + line=None, + class_name='example.ExampleTests', + test_name='throwsAlways', + result='error', + message='Always throws exception', + content='java.lang.RuntimeException: Always throws exception\n\tat ' + 'example.ExampleTests.throwsAlways(ExampleTests.java:26)\n', + stdout=None, + stderr=None, + time=0.01 + ), + publish.unittestresults.UnitTestCase( + result_file='flaky.xml', + test_file=None, + line=None, + class_name='example.ExampleTests', + test_name='failsAssertionAlways', + result='failure', + message='Always fails assertion ==> expected: <1> but was: <2>', + content='org.opentest4j.AssertionFailedError: Always fails assertion ==> ' + 'expected: <1> but was: <2>\n\tat ' + 'example.ExampleTests.failsAssertionAlways(ExampleTests.java:40)\n', + stdout=None, + stderr=None, + time=0.003 + ), + publish.unittestresults.UnitTestCase( + result_file='flaky.xml', + test_file=None, + line=None, + class_name='example.ExampleTests', + test_name='failsAssertionOnlyFirstAttempt', + result='success', + message=None, + content=None, + stdout=None, + stderr=None, + time=0.0 + ), + publish.unittestresults.UnitTestCase( + result_file='flaky.xml', + test_file=None, + line=None, + class_name='example.ExampleTests', + test_name='throwsOnlyFirstAttempt', + result='success', + message=None, + content=None, + stdout=None, + stderr=None, + time=0.001 + ) + ] +) \ No newline at end of file