[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: https://github.com/llvm/llvm-project/pull/147791
This commit is contained in:
Aiden Grossman 2025-07-10 06:29:18 -07:00 committed by GitHub
parent 2877d80155
commit 1469c339f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 30 deletions

View File

@ -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
)

View File

@ -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):

View File

@ -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):
</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",
)
),
)
MULTI_SUITE_OUTPUT = (
dedent(
"""\
MULTI_SUITE_OUTPUT = dedent(
"""\
# ABC and DEF
* 1 test passed
@ -204,8 +198,6 @@ class TestReports(unittest.TestCase):
</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_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",
)
),
)