From 943a87cfde788a499e32eb9e9191afd2fb2ed487 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 1 Sep 2022 21:42:24 +0200 Subject: [PATCH] murdock: allow to fully disable RUN_TESTS from passed env --- .murdock | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.murdock b/.murdock index e2432b2c09..b009efbe3c 100755 --- a/.murdock +++ b/.murdock @@ -143,8 +143,8 @@ export CFLAGS_DBG="" export DLCACHE_DIR=${DLCACHE_DIR:-~/.dlcache} export ENABLE_TEST_CACHE=${ENABLE_TEST_CACHE:-1} export MURDOCK_REDIS_HOST=${MURDOCK_REDIS_HOST:-127.0.0.1} + NIGHTLY=${NIGHTLY:-0} -RUN_TESTS=${RUN_TESTS:-${NIGHTLY}} FULL_BUILD=${FULL_BUILD:-${NIGHTLY}} # This is a work around for a bug in CCACHE which interacts very badly with @@ -229,9 +229,16 @@ check_label() { return $? } -[ "$RUN_TESTS" != "1" ] && { - check_label "CI: run tests" && RUN_TESTS=1 -} +# if RUN_TESTS is unset (e.g., not passed from the outside), +# set to 1 if NIGHTLY=1 or if the label "CI: run tests" is set, +# otherwise set 0. +if [ -z "$RUN_TESTS" ]; then + if [ "$NIGHTLY" = "1" ] || check_label "CI: run tests" ; then + RUN_TESTS=1 + else + RUN_TESTS=0 + fi +fi [ "$ENABLE_TEST_CACHE" = "1" ] && { check_label "CI: disable test cache" && export ENABLE_TEST_CACHE=0