ansible-role-refstack-client/tasks/run-refstack-client.yaml
Martin Kopec f448d8c15d Run add-ons tests as well
Run tests of all target programs we have.
The patch enables required services in devstack (environment
the tests are executed on in Zuul) and implements a logic when
share config options which can be discovered only by using admin
credentials are passed to the second tempestconf execution
(with demo creds) so that they are set in tempest.conf used to run
refstack-client.

Change-Id: I79b7611f47d7d67d439e24c2427ee59870732172
2021-04-11 08:11:18 +00:00

54 lines
1.8 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/\
{{ (item in ['dns', 'orchestration', 'shared_file_system']) | ternary(item + '.', '' ) }}\
{{ 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