[CI] Move platform specific test report titles to python

This patch moves the platform specific test report titles to the
generate_test_report_github.py script. This means that the functions in
the monolithic-* scripts are exactly the same now and can be moved into
a separate script that can be shared between the two scripts.

Reviewers: DavidSpickett, cmtice, lnihlen, dschuff, Keenuts, gburgessiv

Reviewed By: DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/152198
This commit is contained in:
Aiden Grossman 2025-08-06 08:17:48 -07:00 committed by GitHub
parent 1d23005b8e
commit bd9117c569
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 6 deletions

View File

@ -4,20 +4,23 @@
"""Script to generate a build report for Github."""
import argparse
import platform
import generate_test_report_lib
PLATFORM_TITLES = {
"Windows": ":window: Windows x64 Test Results",
"Linux": ":penguin: Linux x64 Test Results",
}
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"title", help="Title of the test report, without Markdown formatting."
)
parser.add_argument("return_code", help="The build's return code.", type=int)
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
args = parser.parse_args()
report = generate_test_report_lib.generate_report_from_files(
args.title, args.return_code, args.junit_files
PLATFORM_TITLES[platform.system()], args.return_code, args.junit_files
)
print(report)

View File

@ -39,7 +39,7 @@ function at-exit {
shopt -s nullglob
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":penguin: Linux x64 Test Results" \
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
fi
}

View File

@ -34,7 +34,7 @@ function at-exit {
shopt -s nullglob
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":window: Windows x64 Test Results" \
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
fi
}