Skip to content

Commit a246454

Browse files
[CI] Only upload test results if buildkite-agent is present (#119954)
This patch modifies the monolithic shell scrips to only run if the buildkite-agent application is present. This allows for running the scripts to completion outside of buildkite (eg inside of a GHA pipeline).
1 parent a35db28 commit a246454

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.ci/monolithic-linux.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ function at-exit {
3434

3535
# If building fails there will be no results files.
3636
shopt -s nullglob
37-
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":linux: Linux x64 Test Results" \
38-
"linux-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
37+
if command -v buildkite-agent 2>&1 >/dev/null
38+
then
39+
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":linux: Linux x64 Test Results" \
40+
"linux-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
41+
fi
3942
}
4043
trap at-exit EXIT
4144

.ci/monolithic-windows.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ function at-exit {
3333

3434
# If building fails there will be no results files.
3535
shopt -s nullglob
36-
python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \
37-
"windows-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
36+
if command -v buildkite-agent 2>&1 >/dev/null
37+
then
38+
python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \
39+
"windows-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
40+
fi
3841
}
3942
trap at-exit EXIT
4043

0 commit comments

Comments
 (0)