-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[CI][NFC] Refactor compute_platform_title into generate_test_report_lib #166604
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] Refactor compute_platform_title into generate_test_report_lib #166604
Conversation
Created using spr 1.3.7 [skip ci]
Created using spr 1.3.7
|
@llvm/pr-subscribers-infrastructure Author: Aiden Grossman (boomanaiden154) ChangesThis enables reuse in other CI components, like Full diff: https://github.com/llvm/llvm-project/pull/166604.diff 2 Files Affected:
diff --git a/.ci/generate_test_report_github.py b/.ci/generate_test_report_github.py
index 08387de817467..18c5e078a5064 100644
--- a/.ci/generate_test_report_github.py
+++ b/.ci/generate_test_report_github.py
@@ -4,21 +4,10 @@
"""Script to generate a build report for Github."""
import argparse
-import platform
import generate_test_report_lib
-def compute_platform_title() -> str:
- logo = ":window:" if platform.system() == "Windows" else ":penguin:"
- # On Linux the machine value is x86_64 on Windows it is AMD64.
- if platform.machine() == "x86_64" or platform.machine() == "AMD64":
- arch = "x64"
- else:
- arch = platform.machine()
- return f"{logo} {platform.system()} {arch} Test Results"
-
-
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("return_code", help="The build's return code.", type=int)
@@ -28,7 +17,9 @@ def compute_platform_title() -> str:
args = parser.parse_args()
report = generate_test_report_lib.generate_report_from_files(
- compute_platform_title(), args.return_code, args.build_test_logs
+ generate_test_report_lib.compute_platform_title(),
+ args.return_code,
+ args.build_test_logs,
)
print(report)
diff --git a/.ci/generate_test_report_lib.py b/.ci/generate_test_report_lib.py
index c9a2aaeb10f8c..48a6be903da41 100644
--- a/.ci/generate_test_report_lib.py
+++ b/.ci/generate_test_report_lib.py
@@ -4,6 +4,7 @@
"""Library to parse JUnit XML files and return a markdown report."""
from typing import TypedDict
+import platform
from junitparser import JUnitXml, Failure
@@ -305,3 +306,13 @@ def load_info_from_files(build_log_files):
def generate_report_from_files(title, return_code, build_log_files):
junit_objects, ninja_logs = load_info_from_files(build_log_files)
return generate_report(title, return_code, junit_objects, ninja_logs)
+
+
+def compute_platform_title() -> str:
+ logo = ":window:" if platform.system() == "Windows" else ":penguin:"
+ # On Linux the machine value is x86_64 on Windows it is AMD64.
+ if platform.machine() == "x86_64" or platform.machine() == "AMD64":
+ arch = "x64"
+ else:
+ arch = platform.machine()
+ return f"{logo} {platform.system()} {arch} Test Results"
|
This enables reuse in other CI components, like premerge_advisor_explain.py. Pull Request: llvm#166604
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
|
One of the pre-merge jobs on my PR has unexpectedly failed (https://github.com/llvm/llvm-project/actions/runs/19142383289/job/54710765868?pr=166794) with: It seems it may be related to this change --- unless I broke something, but I cannot see any other problems in the log. |
…st_report_lib This enables reuse in other CI components, like premerge_advisor_explain.py. Reviewers: DavidSpickett, gburgessiv, Keenuts, dschuff, lnihlen Reviewed By: Keenuts, DavidSpickett Pull Request: llvm/llvm-project#166604
|
It was a different patch, but definitely an issue. I've pushed 83930be which should fix it. |
This enables reuse in other CI components, like
premerge_advisor_explain.py.