Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

This is actually perfectly applicable to the test failure case as well
and results in some easy code consolidation/deletion.

Created using spr 1.3.7
@llvmbot llvmbot added the infrastructure Bugs about LLVM infrastructure label Nov 5, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 5, 2025

@llvm/pr-subscribers-infrastructure

Author: Aiden Grossman (boomanaiden154)

Changes

This is actually perfectly applicable to the test failure case as well
and results in some easy code consolidation/deletion.


Full diff: https://github.com/llvm/llvm-project/pull/166589.diff

1 Files Affected:

  • (modified) .ci/generate_test_report_lib.py (+6-17)
diff --git a/.ci/generate_test_report_lib.py b/.ci/generate_test_report_lib.py
index 0c025c561f6f7..82752aae66ad7 100644
--- a/.ci/generate_test_report_lib.py
+++ b/.ci/generate_test_report_lib.py
@@ -82,10 +82,10 @@ def find_failure_in_ninja_logs(ninja_logs: list[list[str]]) -> list[tuple[str, s
     return failures
 
 
-def _format_ninja_failures(ninja_failures: list[tuple[str, str]]) -> list[str]:
-    """Formats ninja failures into summary views for the report."""
+def _format_failures(failures: list[tuple[str, str]]) -> list[str]:
+    """Formats failures into summary views for the report."""
     output = []
-    for build_failure in ninja_failures:
+    for build_failure in failures:
         failed_action, failure_message = build_failure
         output.extend(
             [
@@ -176,7 +176,7 @@ def generate_report(
                         "",
                     ]
                 )
-                report.extend(_format_ninja_failures(ninja_failures))
+                report.extend(_format_failures(ninja_failures))
                 report.extend(
                     [
                         "",
@@ -212,18 +212,7 @@ def plural(num_tests):
 
         for testsuite_name, failures in failures.items():
             report.extend(["", f"### {testsuite_name}"])
-            for name, output in failures:
-                report.extend(
-                    [
-                        "<details>",
-                        f"<summary>{name}</summary>",
-                        "",
-                        "```",
-                        output,
-                        "```",
-                        "</details>",
-                    ]
-                )
+            report.extend(_format_failures(failures))
     elif return_code != 0:
         # No tests failed but the build was in a failed state. Bring this to the user's
         # attention.
@@ -248,7 +237,7 @@ def plural(num_tests):
                     "",
                 ]
             )
-            report.extend(_format_ninja_failures(ninja_failures))
+            report.extend(_format_failures(ninja_failures))
 
     if failures or return_code != 0:
         report.extend(["", UNRELATED_FAILURES_STR])

boomanaiden154 added a commit to boomanaiden154/llvm-project that referenced this pull request Nov 5, 2025
This is actually perfectly applicable to the test failure case as well
and results in some easy code consolidation/deletion.

Pull Request: llvm#166589
Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boomanaiden154 boomanaiden154 merged commit 96d4cb0 into main Nov 6, 2025
12 of 13 checks passed
@boomanaiden154 boomanaiden154 deleted the users/boomanaiden154/cinfc-generalize-_format_ninja_failures branch November 6, 2025 15:58
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Nov 6, 2025
This is actually perfectly applicable to the test failure case as well
and results in some easy code consolidation/deletion.

Reviewers: dschuff, lnihlen, gburgessiv, Keenuts, DavidSpickett

Reviewed By: Keenuts, DavidSpickett

Pull Request: llvm/llvm-project#166589
vinay-deshmukh pushed a commit to vinay-deshmukh/llvm-project that referenced this pull request Nov 8, 2025
This is actually perfectly applicable to the test failure case as well
and results in some easy code consolidation/deletion.

Reviewers: dschuff, lnihlen, gburgessiv, Keenuts, DavidSpickett

Reviewed By: Keenuts, DavidSpickett

Pull Request: llvm#166589
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Bugs about LLVM infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants