ansible-role-refstack-client/tasks/run-refstack-client.yaml
Martin Kopec 5c0373b287 Run all main target programs' tests
Run tests from all main target programs, for that a new
refstack_target_programs var is defined. The var will cause the
role to execute  'refstack-client test' command for every given
target program.
Collect whole .stestr dir in the zuul jobs as there will be
multiple output files (for every given target program).
Bump the default guideline to the latest one (2020.11).
The patch also fixes a few style mistakes/typos.

Change-Id: I82ba0bf26b994d4e21acabcb015d798081a33da2
2021-03-18 16:43:49 +00:00

55 lines
1.7 KiB
YAML

---
- name: Validate setup
shell: |
set -ex
source .venv/bin/activate
refstack-client test -c {{ path_to_tempest_config }} \
-v \
-- \
--regex tempest.api.identity.v3.test_tokens.TokensV3Test.test_create_token
args:
chdir: "{{ refstack_client_source }}"
executable: /bin/bash
changed_when: false
- name: Run tests with the defined test list
shell: |
set -ex
export PATH=$PATH:/usr/local/sbin:/usr/sbin
source .venv/bin/activate
printenv
refstack-client test \
-c {{ path_to_tempest_config }} \
-v \
--test-list {{ test_list }}
args:
chdir: "{{ refstack_client_source }}"
executable: /bin/bash
register: refstack_result
# don't fail here in order to allow post_tasks be executed,
# the refstack_result is inspected in the last task of the role where it
# fails if it failed here
ignore_errors: true
when: test_list is defined
- name: "Run {{ refstack_target_programs }} program tests associated within the {{ guideline }} guideline"
shell: |
set -ex
export PATH=$PATH:/usr/local/sbin:/usr/sbin
source .venv/bin/activate
printenv
refstack-client test \
-c {{ path_to_tempest_config }} \
-v \
--test-list "https://refstack.openstack.org/api/v1/guidelines/{{ guideline }}/tests?target={{ item }}&type=required&alias=true&flag=false"
args:
chdir: "{{ refstack_client_source }}"
executable: /bin/bash
register: refstack_result
# don't fail here in order to allow post_tasks be executed,
# the refstack_result is inspected in the last task of the role where it
# fails if it failed here
ignore_errors: true
with_items: "{{ refstack_target_programs }}"
when: test_list is not defined