From a24645463bd8a758005f4e5fdcd78971f87e3ba1 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 16 Dec 2024 09:01:05 +0000 Subject: [PATCH] [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). --- .ci/monolithic-linux.sh | 7 +++++-- .ci/monolithic-windows.sh | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index a4aeea7a16ad..4bfebd5f7527 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -34,8 +34,11 @@ function at-exit { # If building fails there will be no results files. shopt -s nullglob - python3 "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":linux: Linux x64 Test Results" \ - "linux-x64-test-results" "${BUILD_DIR}"/test-results.*.xml + if command -v buildkite-agent 2>&1 >/dev/null + then + python3 "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":linux: Linux x64 Test Results" \ + "linux-x64-test-results" "${BUILD_DIR}"/test-results.*.xml + fi } trap at-exit EXIT diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh index 4ead122212f4..25cdd2f419f4 100755 --- a/.ci/monolithic-windows.sh +++ b/.ci/monolithic-windows.sh @@ -33,8 +33,11 @@ function at-exit { # If building fails there will be no results files. shopt -s nullglob - python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \ - "windows-x64-test-results" "${BUILD_DIR}"/test-results.*.xml + if command -v buildkite-agent 2>&1 >/dev/null + then + python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \ + "windows-x64-test-results" "${BUILD_DIR}"/test-results.*.xml + fi } trap at-exit EXIT