Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .ci/generate_test_report_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
33 changes: 24 additions & 9 deletions .ci/generate_test_report_lib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
Expand Down Expand Up @@ -169,7 +171,9 @@ def test_report_single_file_single_testsuite(self):
```
Other output goes here
```
</details>"""
</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",
),
Expand Down Expand Up @@ -203,7 +207,9 @@ def test_report_single_file_single_testsuite(self):
```
DEF/test_2 output goes here
```
</details>"""
</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",
)
Expand Down Expand Up @@ -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",
),
Expand Down Expand Up @@ -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",
Expand All @@ -371,14 +382,16 @@ def test_report_size_limit(self):
<testsuites time="0.02">
<testsuite name="Bar" tests="1" failures="1" skipped="0" time="0.02">
<testcase classname="Bar/test_1" name="test_1" time="0.02">
<failure><![CDATA[Some long output goes here...]]></failure>
<failure><![CDATA[{output}]]></failure>
</testcase>
</testsuite>
</testsuites>"""
</testsuites>""".format(
output=test_output
)
)
)
],
size_limit=128,
size_limit=512,
),
(
dedent(
Expand All @@ -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",
),
Expand Down
Loading