From bd6481d93431738c72964ea0f8dd1d3e40c9778a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Piwowarski?= Date: Fri, 6 Jan 2023 09:57:04 +0100 Subject: [PATCH] Fix default values for variables in run-tempest role With the new version of tox the parsing of postargs value has changed. Previously an empty string was discarded by tox if it appeared in the postargs value in contrast with the latest version of tox which leaves the empty string intact. The behavior of the latest tox version makes some jobs fail as some variables in the run-tempest role have an empty string as a default value. This leads in some cases to the execution of an incorrect tempest command, for example: tempest run --regex '[.*\bsmoke\b.*]' '' --concurrency=2 The patch changes the default value for blacklist_option, exclude_list_option and tempest_test_regex variables to None to prevent an empty string from being passed to postargs variable in tox. Change-Id: I006e33c5ea0753b68cf1feb8580cb029209af9a8 --- roles/run-tempest-26/tasks/main.yaml | 4 +++- roles/run-tempest/tasks/main.yaml | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/roles/run-tempest-26/tasks/main.yaml b/roles/run-tempest-26/tasks/main.yaml index f8460063c3..7423bfba4b 100644 --- a/roles/run-tempest-26/tasks/main.yaml +++ b/roles/run-tempest-26/tasks/main.yaml @@ -62,7 +62,9 @@ when: blacklist_stat.stat.exists - name: Run Tempest - command: tox -e {{tox_envlist}} {{tox_extra_args}} -- {{tempest_test_regex|quote}} {{blacklist_option|default('')}} \ + command: tox -e {{tox_envlist}} {{tox_extra_args}} -- \ + {{tempest_test_regex|quote if (tempest_test_regex|length>0)|default(None, True)}} \ + {{blacklist_option|default(None)}} \ --concurrency={{tempest_concurrency|default(default_concurrency)}} \ --black-regex={{tempest_black_regex|quote}} args: diff --git a/roles/run-tempest/tasks/main.yaml b/roles/run-tempest/tasks/main.yaml index e569e53e07..3fb494f349 100644 --- a/roles/run-tempest/tasks/main.yaml +++ b/roles/run-tempest/tasks/main.yaml @@ -120,10 +120,11 @@ - target_branch in ["stable/train", "stable/ussuri", "stable/victoria"] - name: Run Tempest - command: tox -e {{tox_envlist}} {{tox_extra_args}} -- {{tempest_test_regex|quote}} \ - {{blacklist_option|default('')}} {{exclude_list_option|default('')}} \ + command: tox -e {{tox_envlist}} {{tox_extra_args}} -- \ + {{tempest_test_regex|quote if (tempest_test_regex|length>0)|default(None, True)}} \ + {{blacklist_option|default(None)}} {{exclude_list_option|default(None)}} \ --concurrency={{tempest_concurrency|default(default_concurrency)}} \ - {{tempest_test_exclude_regex|default('')}} + {{tempest_test_exclude_regex|default(None)}} args: chdir: "{{devstack_base_dir}}/tempest" register: tempest_run_result