a9445043df
* https://review.openstack.org/547106 adds a black_regex flag to tempest run. We can use the same in devstack-tempest base job to skip/blacklist tests. Change-Id: I9ed91b01ddb7ec0a3d23305031afbac7c4b16c55
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
# NOTE(andreaf) The number of vcpus is not available on all systems.
|
|
# See https://github.com/ansible/ansible/issues/30688
|
|
# When not available, we fall back to ansible_processor_cores
|
|
- name: Get hw.logicalcpu from sysctl
|
|
shell: sysctl hw.logicalcpu | cut -d' ' -f2
|
|
register: sysctl_hw_logicalcpu
|
|
when: ansible_processor_vcpus is not defined
|
|
|
|
- name: Number of cores
|
|
set_fact:
|
|
num_cores: "{{ansible_processor_vcpus|default(sysctl_hw_logicalcpu.stdout)}}"
|
|
|
|
- name: Set concurrency for cores == 3 or less
|
|
set_fact:
|
|
default_concurrency: "{{ num_cores }}"
|
|
when: num_cores|int <= 3
|
|
|
|
- name: Limit max concurrency when more than 3 vcpus are available
|
|
set_fact:
|
|
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}} {{blacklist_option|default('')}} \
|
|
--concurrency={{tempest_concurrency|default(default_concurrency)}} \
|
|
--black-regex={{tempest_black_regex|quote}}
|
|
args:
|
|
chdir: "{{devstack_base_dir}}/tempest"
|
|
become: true
|
|
become_user: tempest
|