Skip to content

Commit 1469c33

Browse files
[CI] Remove Style from generate_test_report_lib
This is another Buildkite relic that we can get rid of now to simplify things a bit. Reviewers: cmtice, DavidSpickett, lnihlen Reviewed By: DavidSpickett Pull Request: #147791
1 parent 2877d80 commit 1469c33

File tree

3 files changed

+14
-30
lines changed

3 files changed

+14
-30
lines changed

.ci/generate_test_report_github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
1717
args = parser.parse_args()
1818

19-
report, _ = generate_test_report_lib.generate_report_from_files(
19+
report = generate_test_report_lib.generate_report_from_files(
2020
args.title, args.return_code, args.junit_files
2121
)
2222

.ci/generate_test_report_lib.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def generate_report(
2525
#
2626
# If we were going to post a report, then yes, it would be misleading
2727
# to say we succeeded when the final return code was non-zero.
28-
return ("", "success")
28+
return ""
2929

3030
failures = {}
3131
tests_run = 0
@@ -51,12 +51,7 @@ def generate_report(
5151
)
5252

5353
if not tests_run:
54-
return ("", None)
55-
56-
style = "success"
57-
# Either tests failed, or all tests passed but something failed to build.
58-
if tests_failed or return_code != 0:
59-
style = "error"
54+
return ""
6055

6156
report = [f"# {title}", ""]
6257

@@ -132,7 +127,7 @@ def plural(num_tests):
132127
list_failures=False,
133128
)
134129

135-
return report, style
130+
return report
136131

137132

138133
def generate_report_from_files(title, return_code, junit_files):

.ci/generate_test_report_lib_test.py

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ def junit_from_xml(xml):
2020

2121
class TestReports(unittest.TestCase):
2222
def test_title_only(self):
23-
self.assertEqual(
24-
generate_test_report_lib.generate_report("Foo", 0, []), ("", "success")
25-
)
23+
self.assertEqual(generate_test_report_lib.generate_report("Foo", 0, []), "")
2624

2725
def test_no_tests_in_testsuite(self):
2826
self.assertEqual(
@@ -42,7 +40,7 @@ def test_no_tests_in_testsuite(self):
4240
)
4341
],
4442
),
45-
("", None),
43+
"",
4644
)
4745

4846
def test_no_failures(self):
@@ -70,8 +68,7 @@ def test_no_failures(self):
7068
# Foo
7169
7270
* 1 test passed"""
73-
),
74-
"success",
71+
)
7572
),
7673
)
7774

@@ -106,8 +103,7 @@ def test_no_failures_build_failed(self):
106103
Download the build's log file to see the details.
107104
108105
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."""
109-
),
110-
"error",
106+
)
111107
),
112108
)
113109

@@ -168,14 +164,12 @@ def test_report_single_file_single_testsuite(self):
168164
</details>
169165
170166
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."""
171-
),
172-
"error",
167+
)
173168
),
174169
)
175170

176-
MULTI_SUITE_OUTPUT = (
177-
dedent(
178-
"""\
171+
MULTI_SUITE_OUTPUT = dedent(
172+
"""\
179173
# ABC and DEF
180174
181175
* 1 test passed
@@ -204,8 +198,6 @@ def test_report_single_file_single_testsuite(self):
204198
</details>
205199
206200
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."""
207-
),
208-
"error",
209201
)
210202

211203
def test_report_single_file_multiple_testsuites(self):
@@ -314,8 +306,7 @@ def test_report_dont_list_failures(self):
314306
Failed tests and their output was too large to report. Download the build's log file to see the details.
315307
316308
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."""
317-
),
318-
"error",
309+
)
319310
),
320311
)
321312

@@ -351,8 +342,7 @@ def test_report_dont_list_failures_link_to_log(self):
351342
Failed tests and their output was too large to report. Download the build's log file to see the details.
352343
353344
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."""
354-
),
355-
"error",
345+
)
356346
),
357347
)
358348

@@ -391,7 +381,6 @@ def test_report_size_limit(self):
391381
Failed tests and their output was too large to report. Download the build's log file to see the details.
392382
393383
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."""
394-
),
395-
"error",
384+
)
396385
),
397386
)

0 commit comments

Comments
 (0)