[llvm] [CI] Make CI Jobs Upload Failures to Premerge Advisor (PR #163276)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 14 14:19:13 PDT 2025
https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/163276
>From 62255cbf19ab429f9dbce6b6a9e3a5b826995d04 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 13 Oct 2025 21:56:13 +0000
Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
=?UTF-8?q?anges=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.7
[skip ci]
---
.ci/generate_test_report_lib.py | 40 ++++++++++++++++++++-------------
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git a/.ci/generate_test_report_lib.py b/.ci/generate_test_report_lib.py
index 5026c292a7934..2d18932ace135 100644
--- a/.ci/generate_test_report_lib.py
+++ b/.ci/generate_test_report_lib.py
@@ -98,6 +98,23 @@ def _format_ninja_failures(ninja_failures: list[tuple[str, str]]) -> list[str]:
)
return output
+def get_failures(junit_objects) -> dict[str, list[tuple[str, str]]]:
+ failures = {}
+ for results in junit_objects:
+ for testsuite in results:
+ for test in testsuite:
+ if (
+ not test.is_passed
+ and test.result
+ and isinstance(test.result[0], Failure)
+ ):
+ if failures.get(testsuite.name) is None:
+ failures[testsuite.name] = []
+ failures[testsuite.name].append(
+ (test.classname + "/" + test.name, test.result[0].text)
+ )
+ return failures
+
# Set size_limit to limit the byte size of the report. The default is 1MB as this
# is the most that can be put into an annotation. If the generated report exceeds
@@ -113,7 +130,7 @@ def generate_report(
size_limit=1024 * 1024,
list_failures=True,
):
- failures = {}
+ failures = get_failures(junit_objects)
tests_run = 0
tests_skipped = 0
tests_failed = 0
@@ -124,18 +141,6 @@ def generate_report(
tests_skipped += testsuite.skipped
tests_failed += testsuite.failures
- for test in testsuite:
- if (
- not test.is_passed
- and test.result
- and isinstance(test.result[0], Failure)
- ):
- if failures.get(testsuite.name) is None:
- failures[testsuite.name] = []
- failures[testsuite.name].append(
- (test.classname + "/" + test.name, test.result[0].text)
- )
-
report = [f"# {title}", ""]
if tests_run == 0:
@@ -258,7 +263,7 @@ def plural(num_tests):
return report
-def generate_report_from_files(title, return_code, build_log_files):
+def load_info_from_files(build_log_files):
junit_files = [
junit_file for junit_file in build_log_files if junit_file.endswith(".xml")
]
@@ -271,6 +276,11 @@ def generate_report_from_files(title, return_code, build_log_files):
ninja_logs.append(
[log_line.strip() for log_line in ninja_log_file_handle.readlines()]
)
+ return [JUnitXml.fromfile(p) for p in junit_files], ninja_logs
+
+
+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, [JUnitXml.fromfile(p) for p in junit_files], ninja_logs
+ title, return_code, junit_objects, ninja_logs
)
>From 7df7aff85af72f06cb4e73906b6fe3d3fc13cca3 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 13 Oct 2025 22:02:24 +0000
Subject: [PATCH 2/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
=?UTF-8?q?anges=20introduced=20through=20rebase?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.7
[skip ci]
---
.ci/generate_test_report_lib.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/.ci/generate_test_report_lib.py b/.ci/generate_test_report_lib.py
index 2d18932ace135..36c95852452ac 100644
--- a/.ci/generate_test_report_lib.py
+++ b/.ci/generate_test_report_lib.py
@@ -281,6 +281,4 @@ 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
- )
+ return generate_report(title, return_code, junit_objects, ninja_logs)
>From 736fbda8f9e2e81f5db83ceccaa79feb13bdb9ea Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 13 Oct 2025 22:37:09 +0000
Subject: [PATCH 3/5] fix
Created using spr 1.3.7
---
.ci/premerge_advisor_upload.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/.ci/premerge_advisor_upload.py b/.ci/premerge_advisor_upload.py
index 27e45bdd7f589..fb2bc251044b3 100644
--- a/.ci/premerge_advisor_upload.py
+++ b/.ci/premerge_advisor_upload.py
@@ -45,4 +45,3 @@ def main(commit_sha, workflow_run_number, build_log_files):
args = parser.parse_args()
main(args.commit_sha, args.workflow_run_number, args.build_log_files)
- main()
>From cae46e55bae8f1edb36e030162836e99ae44e5d0 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 14 Oct 2025 21:13:18 +0000
Subject: [PATCH 4/5] fix
Created using spr 1.3.7
---
llvm/utils/TableGen/llvm-tblgen.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/utils/TableGen/llvm-tblgen.cpp b/llvm/utils/TableGen/llvm-tblgen.cpp
index e3bfa1faf03c6..b1d625e358ea4 100644
--- a/llvm/utils/TableGen/llvm-tblgen.cpp
+++ b/llvm/utils/TableGen/llvm-tblgen.cpp
@@ -12,7 +12,7 @@
#include "Basic/TableGen.h"
-#error compilation_erro
+#error compilation_error
/// Command line parameters are shared between llvm-tblgen and llvm-min-tblgen.
/// The indirection to tblgen_main exists to ensure that the static variables
>From 2ffbec77827877671dfe40cb1115fa6474a1e7ee Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 14 Oct 2025 21:19:01 +0000
Subject: [PATCH 5/5] fix
Created using spr 1.3.7
---
.ci/monolithic-linux.sh | 3 ++-
.ci/premerge_advisor_upload.py | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index c8f331204bd49..500e1c2721b78 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -65,7 +65,8 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
start-group "ninja"
# Targets are not escaped as they are passed as separate arguments.
-ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
+# DO NOT SUBMIT: Readd -k 0
+ninja -C "${BUILD_DIR}" ${targets} |& tee ninja.log
if [[ "${runtime_targets}" != "" ]]; then
start-group "ninja Runtimes"
diff --git a/.ci/premerge_advisor_upload.py b/.ci/premerge_advisor_upload.py
index fb2bc251044b3..b4a7694c376ef 100644
--- a/.ci/premerge_advisor_upload.py
+++ b/.ci/premerge_advisor_upload.py
@@ -10,7 +10,7 @@
import generate_test_report_lib
-PREMERGE_ADVISOR_URL = "http://premerge-advisor:5000/upload"
+PREMERGE_ADVISOR_URL = "http://premerge-advisor.premerge-advisor:5000/upload"
def main(commit_sha, workflow_run_number, build_log_files):
More information about the llvm-commits
mailing list