diff --git a/.ci/generate_test_report_github.py b/.ci/generate_test_report_github.py index 2b4da56c68de..be43c4b4f693 100644 --- a/.ci/generate_test_report_github.py +++ b/.ci/generate_test_report_github.py @@ -16,7 +16,7 @@ if __name__ == "__main__": parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*") args = parser.parse_args() - report, _ = generate_test_report_lib.generate_report_from_files( + report = generate_test_report_lib.generate_report_from_files( args.title, args.return_code, args.junit_files ) diff --git a/.ci/generate_test_report_lib.py b/.ci/generate_test_report_lib.py index 64d74a928a4e..dd203b5169d9 100644 --- a/.ci/generate_test_report_lib.py +++ b/.ci/generate_test_report_lib.py @@ -25,7 +25,7 @@ def generate_report( # # If we were going to post a report, then yes, it would be misleading # to say we succeeded when the final return code was non-zero. - return ("", "success") + return "" failures = {} tests_run = 0 @@ -51,12 +51,7 @@ def generate_report( ) if not tests_run: - return ("", None) - - style = "success" - # Either tests failed, or all tests passed but something failed to build. - if tests_failed or return_code != 0: - style = "error" + return "" report = [f"# {title}", ""] @@ -132,7 +127,7 @@ def generate_report( list_failures=False, ) - return report, style + return report def generate_report_from_files(title, return_code, junit_files): diff --git a/.ci/generate_test_report_lib_test.py b/.ci/generate_test_report_lib_test.py index e1bcd311cb50..89dfed97a359 100644 --- a/.ci/generate_test_report_lib_test.py +++ b/.ci/generate_test_report_lib_test.py @@ -20,9 +20,7 @@ def junit_from_xml(xml): class TestReports(unittest.TestCase): def test_title_only(self): - self.assertEqual( - generate_test_report_lib.generate_report("Foo", 0, []), ("", "success") - ) + self.assertEqual(generate_test_report_lib.generate_report("Foo", 0, []), "") def test_no_tests_in_testsuite(self): self.assertEqual( @@ -42,7 +40,7 @@ class TestReports(unittest.TestCase): ) ], ), - ("", None), + "", ) def test_no_failures(self): @@ -70,8 +68,7 @@ class TestReports(unittest.TestCase): # Foo * 1 test passed""" - ), - "success", + ) ), ) @@ -106,8 +103,7 @@ class TestReports(unittest.TestCase): Download the build's log file to see the details. If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.""" - ), - "error", + ) ), ) @@ -168,14 +164,12 @@ class TestReports(unittest.TestCase): If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.""" - ), - "error", + ) ), ) - MULTI_SUITE_OUTPUT = ( - dedent( - """\ + MULTI_SUITE_OUTPUT = dedent( + """\ # ABC and DEF * 1 test passed @@ -204,8 +198,6 @@ class TestReports(unittest.TestCase): If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.""" - ), - "error", ) def test_report_single_file_multiple_testsuites(self): @@ -314,8 +306,7 @@ class TestReports(unittest.TestCase): Failed tests and their output was too large to report. Download the build's log file to see the details. If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.""" - ), - "error", + ) ), ) @@ -351,8 +342,7 @@ class TestReports(unittest.TestCase): Failed tests and their output was too large to report. Download the build's log file to see the details. If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.""" - ), - "error", + ) ), ) @@ -391,7 +381,6 @@ class TestReports(unittest.TestCase): Failed tests and their output was too large to report. Download the build's log file to see the details. If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.""" - ), - "error", + ) ), )