-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[CI][NFC] Generalize _format_ninja_failures #166589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI][NFC] Generalize _format_ninja_failures #166589
Conversation
Created using spr 1.3.7
|
@llvm/pr-subscribers-infrastructure Author: Aiden Grossman (boomanaiden154) ChangesThis is actually perfectly applicable to the test failure case as well Full diff: https://github.com/llvm/llvm-project/pull/166589.diff 1 Files Affected:
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])
|
This is actually perfectly applicable to the test failure case as well and results in some easy code consolidation/deletion. Pull Request: llvm#166589
DavidSpickett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
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
This is actually perfectly applicable to the test failure case as well
and results in some easy code consolidation/deletion.