From: Thanh Ha Date: Sat, 15 Aug 2020 01:08:45 +0000 (-0400) Subject: Fix parallel tox mode when using bool jjb cfg X-Git-Tag: v0.57.0~5 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=82ca5419dbf134b9cb29f69a1c74e69c24af7456;p=releng%2Fglobal-jjb.git Fix parallel tox mode when using bool jjb cfg JJB takes in the word "true" unquoted as a boolean and converts it to the Python "True" boolean causing the bash script to ultimately receive a string that starts with an uppercase letter. Since we are comparing against a lowercase "true" we should ensure the string is lowercased before comparison. Signed-off-by: Thanh Ha Change-Id: If85c4411c73c18c931a339592a0dd352f574131a --- diff --git a/releasenotes/notes/fix-tox-parallel-mode-f4d61a27ecd83cff.yaml b/releasenotes/notes/fix-tox-parallel-mode-f4d61a27ecd83cff.yaml new file mode 100644 index 00000000..fff1b4bc --- /dev/null +++ b/releasenotes/notes/fix-tox-parallel-mode-f4d61a27ecd83cff.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Parallel mode for tox environments is broken if the user passes a JJB bool + value to the job-template. We now lowercase the PARALLEL variable when + comparing in the bash script to ensure the user provided value is compared + against the lowercase value. diff --git a/shell/tox-run.sh b/shell/tox-run.sh index 498ddc7f..91e040ad 100644 --- a/shell/tox-run.sh +++ b/shell/tox-run.sh @@ -28,7 +28,7 @@ if [[ -d /opt/pyenv ]]; then fi PARALLEL="${PARALLEL:-true}" -if [[ ${PARALLEL} = true ]]; then +if [[ ${PARALLEL,,} = true ]]; then if [[ -n ${TOX_ENVS:-} ]]; then tox -e "$TOX_ENVS" --parallel auto --parallel-live | tee -a "$ARCHIVE_TOX_DIR/tox.log" tox_status="${PIPESTATUS[0]}"