Add support for blacklist file for Zuul jobs

Currently there is tempest_test_regex that can be used to select or
ignore tests, however when the list is complex it can become complex to
maintain and define. For such complex scenarios is that the blacklist
file exist.

This patch adds support for the blacklist file in Zuul jobs.

Change-Id: Ib63955446ea59d81d0d882704666dcce4a625526
This commit is contained in:
Michel Peterson 2018-02-23 20:20:22 +02:00
parent 3a28a10aba
commit ef1a16d4a8
2 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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