ansible-role-refstack-client/tasks/run-refstack-client.yaml
Martin Kopec 3a3fb4f48b Fix linters python3.10 issues
Bump the version of ansible-lint and fix all warnings and failures
found by ansible-lint.
Also remove any python2 related code/tasks from
install-packages.yaml

Change-Id: If466227fb9872f1112b4577670c891bef5b31627
2023-06-22 00:08:33 +02:00

54 lines
1.8 KiB
YAML

---
- name: Validate setup
ansible.builtin.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
ansible.builtin.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"
ansible.builtin.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