ba2f479dc2
For consistency with the tox jobs, use tox_envlist instead of tox_venvlist. See https://docs.openstack.org/infra/zuul-jobs/jobs.html#job-tox for definition of tox job. All projects using tox_venvlist have been changed to use tox_envlist as well (see dependencies). Now we can rename tox_venvlist to tox_envlist - and then the projects can remove tox_venvlist and use only tox_envlist. Change-Id: I67a20b1faa77ff0166ad96fd95432c11948abc74 Depends-On: I035584aaeaa71b62c1d0c7e0a62dbf053a3488b6 Depends-On: I2fb02ead3b45c2a05d28f59fd28d062a3b40e07e Depends-On: Id03d4c1351d5a002dc9d73247d0315bef274f627 Depends-On: Iff3093e61c7d2cb684667d5bc5f2a75580569aab
29 lines
999 B
YAML
29 lines
999 B
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
|
|
|
|
- name: Run Tempest
|
|
command: tox -e {{tox_envlist}} -- {{tempest_test_regex|quote}} --concurrency={{tempest_concurrency|default(default_concurrency)}}
|
|
args:
|
|
chdir: "{{devstack_base_dir}}/tempest"
|
|
become: true
|
|
become_user: tempest
|