From 1f0cc16ec0fd05044d7c553d6869a72eb620645f Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 24 Jan 2019 16:20:48 +0100 Subject: [PATCH] ceph_ansible: check if tox env is defined tox allows to run even if an env doesn't match all the factors in the full name. This commits check that the desired environment is well defined in envlist. Signed-off-by: Guillaume Abrioux --- scripts/build_utils.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index c464c149..de9c33b1 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -750,10 +750,21 @@ function build_job_name() { echo "${job_name}" } +# shellcheck disable=SC2153 +ENV_NAME="$(build_job_name "$RELEASE" "$DISTRIBUTION" "$DEPLOYMENT" "$SCENARIO")" + +for tox_env in $("$VENV"/tox -l) +do + if [[ "$ENV_NAME" == "$tox_env" ]]; then # shellcheck disable=SC2116 -if ! eval "$(echo "${TOX_RUN_ENV[@]}")" "$VENV"/tox --workdir="$TEMPVENV" -v -e="$(build_job_name $RELEASE $DISTRIBUTION $DEPLOYMENT $SCENARIO)" -- --provider=libvirt; then echo "ERROR: Job didn't complete successfully or got stuck for more than 3h." - exit 1 -fi + if ! eval "$(echo "${TOX_RUN_ENV[@]}")" "$VENV"/tox --workdir="$TEMPVENV" -v -e="$ENV_NAME" -- --provider=libvirt; then echo "ERROR: Job didn't complete successfully or got stuck for more than 3h." + exit 1 + fi + return 0 + fi +done +echo "ERROR: Environment $ENV_NAME is not defined in tox.ini!" +exit 1 } github_status_setup() { -- 2.39.5