Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

This enables reuse in other CI components, like
premerge_advisor_explain.py.

@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 enables reuse in other CI components, like
premerge_advisor_explain.py.


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

2 Files Affected:

  • (modified) .ci/generate_test_report_github.py (+3-12)
  • (modified) .ci/generate_test_report_lib.py (+11)
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"

boomanaiden154 added a commit to boomanaiden154/llvm-project that referenced this pull request Nov 5, 2025
This enables reuse in other CI components, like
premerge_advisor_explain.py.

Pull Request: llvm#166604
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 changed the base branch from users/boomanaiden154/main.cinfc-refactor-compute_platform_title-into-generate_test_report_lib to main November 6, 2025 16:12
Created using spr 1.3.7
@boomanaiden154 boomanaiden154 merged commit 527b7a4 into main Nov 6, 2025
7 of 11 checks passed
@boomanaiden154 boomanaiden154 deleted the users/boomanaiden154/cinfc-refactor-compute_platform_title-into-generate_test_report_lib branch November 6, 2025 16:13
@IgWod-IMG
Copy link
Contributor

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:

2025-11-06T16:35:29.2658830Z + python C:/_work/llvm-project/llvm-project/.ci/generate_test_report_github.py 0 C:/_work/llvm-project/llvm-project/build/test-results.1em3gujk.xml C:/_work/llvm-project/llvm-project/ninja.log
2025-11-06T16:35:29.3379761Z Traceback (most recent call last):
2025-11-06T16:35:29.3380319Z   File "C:\_work\llvm-project\llvm-project\.ci\generate_test_report_github.py", line 8, in <module>
2025-11-06T16:35:29.3381529Z     import generate_test_report_lib
2025-11-06T16:35:29.3382093Z   File "C:\_work\llvm-project\llvm-project\.ci\generate_test_report_lib.py", line 14, in <module>
2025-11-06T16:35:29.3383102Z     class FailureExplanation(TypedDict):
2025-11-06T16:35:29.3383653Z   File "C:\_work\llvm-project\llvm-project\.ci\generate_test_report_lib.py", line 17, in FailureExplanation
2025-11-06T16:35:29.3384689Z     reason: str | None
2025-11-06T16:35:29.3385040Z TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
2025-11-06T16:35:29.3506607Z ##[error]Process completed with exit code 1.

It seems it may be related to this change --- unless I broke something, but I cannot see any other problems in the log.

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Nov 6, 2025
…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
@boomanaiden154
Copy link
Contributor Author

It was a different patch, but definitely an issue. I've pushed 83930be which should fix it.

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.

6 participants