From 82ca5419dbf134b9cb29f69a1c74e69c24af7456 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Fri, 14 Aug 2020 21:08:45 -0400 Subject: [PATCH] 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 --- releasenotes/notes/fix-tox-parallel-mode-f4d61a27ecd83cff.yaml | 7 +++++++ shell/tox-run.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-tox-parallel-mode-f4d61a27ecd83cff.yaml 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]}" -- 2.16.6