From 8d649fefae679fb2f93deec1e576bdfbbd5098f8 Mon Sep 17 00:00:00 2001 From: favilo Date: Thu, 21 Mar 2024 10:24:06 -0700 Subject: [PATCH 1/2] Upload logs to buildkite even on failure --- .buildkite/it/run.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.buildkite/it/run.sh b/.buildkite/it/run.sh index 8e2e48798..943ac9211 100644 --- a/.buildkite/it/run.sh +++ b/.buildkite/it/run.sh @@ -4,6 +4,11 @@ set -eo pipefail source .buildkite/retry.sh +function upload_logs { + echo "--- Upload artifacts" + buildkite-agent artifact upload "${RALLY_HOME}/.rally/logs/*.log" +} + export TERM=dumb export LC_ALL=en_US.UTF-8 export TZ=Etc/UTC @@ -44,8 +49,8 @@ export LC_ALL=en_US.UTF-8 source .venv/bin/activate pip install nox -nox -s "it-${PYTHON_VERSION}" -echo "--- Upload artifacts" +trap upload_logs ERR +nox -s "it-${PYTHON_VERSION}" -buildkite-agent artifact upload "${RALLY_HOME}/.rally/logs/*.log" +upload_logs From 1e5294172c4c080322a9d48f8db2220f5e533609 Mon Sep 17 00:00:00 2001 From: favilo Date: Thu, 21 Mar 2024 10:38:09 -0700 Subject: [PATCH 2/2] Upload logs in `run_serverless.sh`, too --- .buildkite/it/run_serverless.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.buildkite/it/run_serverless.sh b/.buildkite/it/run_serverless.sh index 35c8e0d78..0c34c8a8b 100644 --- a/.buildkite/it/run_serverless.sh +++ b/.buildkite/it/run_serverless.sh @@ -4,6 +4,11 @@ set -eo pipefail source .buildkite/retry.sh +function upload_logs { + echo "--- Upload artifacts" + buildkite-agent artifact upload "${RALLY_HOME}/.rally/logs/*.log" +} + export TERM=dumb export LC_ALL=en_US.UTF-8 export TZ=Etc/UTC @@ -38,6 +43,8 @@ export THESPLOG_FILE_MAXSIZE=${THESPLOG_FILE_MAXSIZE:-204800} # adjust the default log level from WARNING export THESPLOG_THRESHOLD="INFO" +trap upload_logs ERR + case $TEST_NAME in "user") nox -s it_serverless @@ -50,3 +57,5 @@ case $TEST_NAME in exit 1 ;; esac + +upload_logs