ansible-role-refstack-client/tasks/run-refstack-client.yaml
Martin Kopec f865af4563 Fix inspecting refstack_result
refstack_result is used to register result of running
refstack-client, however, it was used in 2 different tasks one of
which was always skipped. There may happen a situation (when the
latter task is skipped), the skipped task overrides the result
of the refstack-client execution from the other task.
The patch fixes that by using a different variable for each of
the tasks running refstack-client.

Change-Id: I6f524df674dfbb2d6b9372dce51f1e1aec8ed9be
2021-05-17 18:38:24 +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_results
# don't fail here in order to allow post_tasks be executed,
# the refstack_results 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