[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:
parent
1d23005b8e
commit
bd9117c569
@ -4,20 +4,23 @@
|
|||||||
"""Script to generate a build report for Github."""
|
"""Script to generate a build report for Github."""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import platform
|
||||||
|
|
||||||
import generate_test_report_lib
|
import generate_test_report_lib
|
||||||
|
|
||||||
|
PLATFORM_TITLES = {
|
||||||
|
"Windows": ":window: Windows x64 Test Results",
|
||||||
|
"Linux": ":penguin: Linux x64 Test Results",
|
||||||
|
}
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
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("return_code", help="The build's return code.", type=int)
|
||||||
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
|
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
report = generate_test_report_lib.generate_report_from_files(
|
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)
|
print(report)
|
||||||
|
@ -39,7 +39,7 @@ function at-exit {
|
|||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
|
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
|
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ function at-exit {
|
|||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
|
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
|
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user