diff --git a/roles/run-tempest/README.rst b/roles/run-tempest/README.rst index 33dcce9f91..384ca38940 100644 --- a/roles/run-tempest/README.rst +++ b/roles/run-tempest/README.rst @@ -29,6 +29,12 @@ Run Tempest # Line with only a comment. (tempest\.(api|scenario|thirdparty)).*$ # Run only api scenario and third party +.. zuul:rolevar:: tempest_test_blacklist + + Specifies a blacklist file to skip tests that are not needed. + + Pass a full path to the file. + .. zuul:rolevar:: tox_envlist :default: smoke diff --git a/roles/run-tempest/tasks/main.yaml b/roles/run-tempest/tasks/main.yaml index 87898db189..b68507a0b8 100644 --- a/roles/run-tempest/tasks/main.yaml +++ b/roles/run-tempest/tasks/main.yaml @@ -20,8 +20,22 @@ default_concurrency: "{{ num_cores|int // 2 }}" when: num_cores|int > 3 +- when: + - tempest_test_blacklist is defined + block: + - name: Check for test blacklist file + stat: + path: "{{ tempest_test_blacklist }}" + register: + blacklist_stat + + - name: Build blacklist option + set_fact: + blacklist_option: "--blacklist-file={{ tempest_test_blacklist|quote }}" + when: blacklist_stat.stat.exists + - name: Run Tempest - command: tox -e {{tox_envlist}} -- {{tempest_test_regex|quote}} --concurrency={{tempest_concurrency|default(default_concurrency)}} + command: tox -e {{tox_envlist}} -- {{tempest_test_regex|quote}} {{blacklist_option|default('')}} --concurrency={{tempest_concurrency|default(default_concurrency)}} args: chdir: "{{devstack_base_dir}}/tempest" become: true