diff --git a/.ci/generate_test_report_lib.py b/.ci/generate_test_report_lib.py index 4ea25b26b761b..1d34d57e80506 100644 --- a/.ci/generate_test_report_lib.py +++ b/.ci/generate_test_report_lib.py @@ -122,6 +122,17 @@ def plural(num_tests): ] ) + if failures or return_code != 0: + report.extend( + [ + "", + "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.", + ] + ) + report = "\n".join(report) if len(report.encode("utf-8")) > size_limit: return generate_report( diff --git a/.ci/generate_test_report_lib_test.py b/.ci/generate_test_report_lib_test.py index fad6ab2bec899..38ac24afd231c 100644 --- a/.ci/generate_test_report_lib_test.py +++ b/.ci/generate_test_report_lib_test.py @@ -109,7 +109,9 @@ def test_no_failures_build_failed(self): All tests passed but another part of the build **failed**. - [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.""" + [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) 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", ), @@ -169,7 +171,9 @@ def test_report_single_file_single_testsuite(self): ``` Other output goes here ``` - """ + + + 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", ), @@ -203,7 +207,9 @@ def test_report_single_file_single_testsuite(self): ``` DEF/test_2 output goes here ``` - """ + + + 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", ) @@ -311,7 +317,9 @@ def test_report_dont_list_failures(self): * 1 test failed - Failed tests and their output was too large to report. Download the build's log file to see the details.""" + 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", ), @@ -352,13 +360,16 @@ def test_report_dont_list_failures_link_to_log(self): * 1 test failed - Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.""" + Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) 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", ), ) def test_report_size_limit(self): + test_output = "f" * 1000 self.assertEqual( generate_test_report_lib.generate_report( "Foo", @@ -371,14 +382,16 @@ def test_report_size_limit(self): - + - """ + """.format( + output=test_output + ) ) ) ], - size_limit=128, + size_limit=512, ), ( dedent( @@ -387,7 +400,9 @@ def test_report_size_limit(self): * 1 test failed - Failed tests and their output was too large to report. Download the build's log file to see the details.""" + 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", ),