X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Ftox-run.sh;h=90bd5465c5ecbceff6d3712b939230cb5c954693;hb=refs%2Ftags%2Fv0.41.0;hp=47380010fbd0386eb8f2b784f113b1e93553d90b;hpb=a9a25596239cc8b5fd374cf742764fe5a9c2a3d7;p=releng%2Fglobal-jjb.git diff --git a/shell/tox-run.sh b/shell/tox-run.sh index 47380010..90bd5465 100644 --- a/shell/tox-run.sh +++ b/shell/tox-run.sh @@ -24,11 +24,16 @@ if [ -d "/opt/pyenv" ]; then export PATH="$PYENV_ROOT/bin:$PATH" fi +# Set and pass in PYTHONPATH to circumvent installation bug in tox>=3.2.0 +PYTHONPATH=$(pwd) +export PYTHONPATH +export TOX_TESTENV_PASSENV=PYTHONPATH + set +e # Allow detox to fail so that we can collect the logs in the next step PARALLEL="${PARALLEL:-true}" if [ "${PARALLEL}" = true ]; then - if [ ! -z "$TOX_ENVS" ]; then + if [ -n "$TOX_ENVS" ]; then detox -e "$TOX_ENVS" | tee -a "$ARCHIVE_TOX_DIR/detox.log" tox_status="${PIPESTATUS[0]}" else @@ -36,7 +41,7 @@ if [ "${PARALLEL}" = true ]; then tox_status="${PIPESTATUS[0]}" fi else - if [ ! -z "$TOX_ENVS" ]; then + if [ -n "$TOX_ENVS" ]; then tox -e "$TOX_ENVS" | tee -a "$ARCHIVE_TOX_DIR/tox.log" tox_status="${PIPESTATUS[0]}" else @@ -48,7 +53,7 @@ fi # Disable SC2116 as we want to echo a space separated list of TOX_ENVS # shellcheck disable=SC2116 for i in .tox/*/log; do - tox_env=$(echo $i | awk -F'/' '{print $2}') + tox_env=$(echo "$i" | awk -F'/' '{print $2}') cp -r "$i" "$ARCHIVE_TOX_DIR/$tox_env" done set -e # Logs collected so re-enable