Skip to content

Commit bd9117c

Browse files
[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: #152198
1 parent 1d23005 commit bd9117c

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.ci/generate_test_report_github.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@
44
"""Script to generate a build report for Github."""
55

66
import argparse
7+
import platform
78

89
import generate_test_report_lib
910

11+
PLATFORM_TITLES = {
12+
"Windows": ":window: Windows x64 Test Results",
13+
"Linux": ":penguin: Linux x64 Test Results",
14+
}
15+
1016
if __name__ == "__main__":
1117
parser = argparse.ArgumentParser()
12-
parser.add_argument(
13-
"title", help="Title of the test report, without Markdown formatting."
14-
)
1518
parser.add_argument("return_code", help="The build's return code.", type=int)
1619
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
1720
args = parser.parse_args()
1821

1922
report = generate_test_report_lib.generate_report_from_files(
20-
args.title, args.return_code, args.junit_files
23+
PLATFORM_TITLES[platform.system()], args.return_code, args.junit_files
2124
)
2225

2326
print(report)

.ci/monolithic-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function at-exit {
3939
shopt -s nullglob
4040

4141
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
42-
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":penguin: Linux x64 Test Results" \
42+
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
4343
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
4444
fi
4545
}

.ci/monolithic-windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function at-exit {
3434
shopt -s nullglob
3535

3636
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
37-
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":window: Windows x64 Test Results" \
37+
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
3838
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
3939
fi
4040
}

0 commit comments

Comments
 (0)