Skip to content

Commit 2877d80

Browse files
[CI] Remove Remaining Buildkite References in generate_test_report_lib
This patch removes the buildkite_info object from generate_test_report_lib as we no longer support buildkite so it is dead code now. Eventually we should set up equivalent functionality on the Github side for downloading the logs from a convenient link, but for now clean up the code. Reviewers: cmtice, DavidSpickett, lnihlen Reviewed By: DavidSpickett Pull Request: #147784
1 parent 7daa1de commit 2877d80

File tree

3 files changed

+6
-31
lines changed

3 files changed

+6
-31
lines changed

.ci/generate_test_report_github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
args = parser.parse_args()
1818

1919
report, _ = generate_test_report_lib.generate_report_from_files(
20-
args.title, args.return_code, args.junit_files, None
20+
args.title, args.return_code, args.junit_files
2121
)
2222

2323
print(report)

.ci/generate_test_report_lib.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def generate_report(
1818
junit_objects,
1919
size_limit=1024 * 1024,
2020
list_failures=True,
21-
buildkite_info=None,
2221
):
2322
if not junit_objects:
2423
# Note that we do not post an empty report, therefore we can ignore a
@@ -73,22 +72,12 @@ def plural(num_tests):
7372
if tests_failed:
7473
report.append(f"* {tests_failed} {plural(tests_failed)} failed")
7574

76-
if buildkite_info is not None:
77-
log_url = (
78-
"https://buildkite.com/organizations/{BUILDKITE_ORGANIZATION_SLUG}/"
79-
"pipelines/{BUILDKITE_PIPELINE_SLUG}/builds/{BUILDKITE_BUILD_NUMBER}/"
80-
"jobs/{BUILDKITE_JOB_ID}/download.txt".format(**buildkite_info)
81-
)
82-
download_text = f"[Download]({log_url})"
83-
else:
84-
download_text = "Download"
85-
8675
if not list_failures:
8776
report.extend(
8877
[
8978
"",
9079
"Failed tests and their output was too large to report. "
91-
f"{download_text} the build's log file to see the details.",
80+
"Download the build's log file to see the details.",
9281
]
9382
)
9483
elif failures:
@@ -118,7 +107,7 @@ def plural(num_tests):
118107
"",
119108
"All tests passed but another part of the build **failed**.",
120109
"",
121-
f"{download_text} the build's log file to see the details.",
110+
"Download the build's log file to see the details.",
122111
]
123112
)
124113

@@ -141,16 +130,14 @@ def plural(num_tests):
141130
junit_objects,
142131
size_limit,
143132
list_failures=False,
144-
buildkite_info=buildkite_info,
145133
)
146134

147135
return report, style
148136

149137

150-
def generate_report_from_files(title, return_code, junit_files, buildkite_info):
138+
def generate_report_from_files(title, return_code, junit_files):
151139
return generate_report(
152140
title,
153141
return_code,
154142
[JUnitXml.fromfile(p) for p in junit_files],
155-
buildkite_info=buildkite_info,
156143
)

.ci/generate_test_report_lib_test.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ def test_no_failures_build_failed(self):
9393
)
9494
)
9595
],
96-
buildkite_info={
97-
"BUILDKITE_ORGANIZATION_SLUG": "organization_slug",
98-
"BUILDKITE_PIPELINE_SLUG": "pipeline_slug",
99-
"BUILDKITE_BUILD_NUMBER": "build_number",
100-
"BUILDKITE_JOB_ID": "job_id",
101-
},
10296
),
10397
(
10498
dedent(
@@ -109,7 +103,7 @@ def test_no_failures_build_failed(self):
109103
110104
All tests passed but another part of the build **failed**.
111105
112-
[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.
106+
Download the build's log file to see the details.
113107
114108
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."""
115109
),
@@ -346,12 +340,6 @@ def test_report_dont_list_failures_link_to_log(self):
346340
)
347341
],
348342
list_failures=False,
349-
buildkite_info={
350-
"BUILDKITE_ORGANIZATION_SLUG": "organization_slug",
351-
"BUILDKITE_PIPELINE_SLUG": "pipeline_slug",
352-
"BUILDKITE_BUILD_NUMBER": "build_number",
353-
"BUILDKITE_JOB_ID": "job_id",
354-
},
355343
),
356344
(
357345
dedent(
@@ -360,7 +348,7 @@ def test_report_dont_list_failures_link_to_log(self):
360348
361349
* 1 test failed
362350
363-
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.
351+
Failed tests and their output was too large to report. Download the build's log file to see the details.
364352
365353
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."""
366354
),

0 commit comments

Comments
 (0)