From bae86c31183e66c7d98a76cded2f292cdcab73c1 Mon Sep 17 00:00:00 2001 From: Sergi Blanch Torne Date: Thu, 2 Apr 2026 09:16:15 +0200 Subject: [PATCH] ci: fix envvar default value With 047bb6b8 on !35740, when GIT_STRATEGY is not defined, the scripts can fail where we use `set -u` to raise an error when unset variables. Signed-off-by: Sergi Blanch Torne Part-of: --- .gitlab-ci/piglit/piglit-traces.sh | 2 +- .gitlab-ci/setup-test-env.sh | 2 +- .gitlab-ci/test/gitlab-ci-inc.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci/piglit/piglit-traces.sh b/.gitlab-ci/piglit/piglit-traces.sh index 771e02b21d0..ff812cb7e1a 100755 --- a/.gitlab-ci/piglit/piglit-traces.sh +++ b/.gitlab-ci/piglit/piglit-traces.sh @@ -135,7 +135,7 @@ replay_s3_upload_images() { SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD | tee /tmp/version.txt | grep \"Mesa $MESA_VERSION\(\s\|$\)\"" -if [ "$GIT_STRATEGY" = none ]; then +if [ "${GIT_STRATEGY:-}" = none ]; then cd $RESULTS_DIR && rm -rf ..?* .[!.]* * fi cd /piglit diff --git a/.gitlab-ci/setup-test-env.sh b/.gitlab-ci/setup-test-env.sh index 98a97673e3f..aac2b0ed84c 100755 --- a/.gitlab-ci/setup-test-env.sh +++ b/.gitlab-ci/setup-test-env.sh @@ -130,7 +130,7 @@ export -f _error_msg if [ -z "${RESULTS_DIR:-}" ]; then export RESULTS_DIR="${PWD%/}/results" - if [ "$GIT_STRATEGY" = none ]; then + if [ "${GIT_STRATEGY:-}" = none ]; then rm -rf "${RESULTS_DIR}" fi fi diff --git a/.gitlab-ci/test/gitlab-ci-inc.yml b/.gitlab-ci/test/gitlab-ci-inc.yml index c6656750741..c808c5992a5 100644 --- a/.gitlab-ci/test/gitlab-ci-inc.yml +++ b/.gitlab-ci/test/gitlab-ci-inc.yml @@ -149,7 +149,7 @@ .deqp-test: script: - - if [ "$GIT_STRATEGY" = none ]; then rm -rf results; fi # Clear out old results if the docker container was cached + - if [ "${GIT_STRATEGY:-}" = none ]; then rm -rf results; fi # Clear out old results if the docker container was cached - ./install/deqp-runner.sh artifacts: exclude: @@ -175,6 +175,6 @@ # setup). - section_start artifacts_download "Downloading artifacts from s3" # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY - - if [ "$GIT_STRATEGY" = none ]; then rm -rf install; fi + - if [ "${GIT_STRATEGY:-}" = none ]; then rm -rf install; fi - (set -x; curl -L --retry 4 -f --retry-all-errors --retry-delay 60 ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${S3_ARTIFACT_NAME}.tar.zst | tar --zstd -x) - section_end artifacts_download