ansible-role-refstack-client/tasks/post-tasks.yaml
Martin Kopec 30c7a1301d Do not run orchestration program by default and fix lint
Don't run heat tempest tests by default until they're fixed.
Most of them currently fail, it seems, they are incompatible
with the latest gabbi.

The patch fixes 'All tasks should be named' linters error.
and bumps version of the linters which includes a fix for
the linters issue:
ImportError: cannot import name 'render_group'

Install python-manilaclient from source so that it contains
latest (not yet packaged) changes.

Change-Id: Idd9180ecbe396f73a03922982a4e005a84a77d02
2022-01-18 07:43:38 +00:00

88 lines
2.9 KiB
YAML

---
# The task finds the latest result file in case there are more of them
# e.g. refstack-client was already executed in the current env
- name: Find the test result json file
find:
path: "{{ refstack_client_source }}/.tempest/.stestr"
patterns: '*.json'
register: ls_out
- when: upload_results | bool
block:
# refstack doesn't allow annonymous results uploading anymore, therefore
# this task copies user's key to the target machine (if needed) so that it
# can be used in the following task which uploads the result to the user's
# refstack account
- name: Copy private key
copy:
src: "{{ private_key_path_src }}"
dest: "{{ private_key_path }}"
mode: '0600'
when:
- private_key_path is defined
- private_key_path_src is defined
- name: Upload results with signature
shell: |
set -ex
source .venv/bin/activate
refstack-client upload -y "{{ ls_out.files[-(item[0] | int + 1) | int].path }}" \
--url {{ server }} \
-i {{ private_key_path }}
register: upload_out
args:
chdir: "{{ refstack_client_source }}"
executable: /bin/bash
with_indexed_items: "{{ refstack_target_programs }}"
when:
- private_key_path is defined
- name: Print output of the upload command
debug:
msg: "{{ upload_out }}"
# this becomes handy when the role is executed on a remote node from
# an executor node (e.g. a Jenkins job) when the below artifacts might be
# needed for a further processing (e.g. part of log collection of the job)
- when: download_artifacts | bool
block:
- name: Download results file in .json
fetch:
src: "{{ ls_out.files[-(item[0] | int + 1) | int].path }}"
dest: "{{ dest_dir }}/test_results{{ (item[0] | int + 1) | int }}.json"
flat: true
with_indexed_items: "{{ refstack_target_programs }}"
- name: Download results file in subunit
fetch:
src: "{{ ls_out.files[-(item[0] | int + 1) | int].path | splitext | first }}"
dest: "{{ dest_dir }}/test_results_subunit {{ (item[0] | int + 1) | int }}"
flat: true
with_indexed_items: "{{ refstack_target_programs }}"
- name: Dump output of upload command
copy:
content: "{{ upload_out }}"
dest: "{{ dest_dir }}/upload_output.txt"
mode: '0644'
delegate_to: localhost
when: upload_results | bool
- name: Download tempest_admin.conf file
fetch:
src: "{{ path_to_admin_tempest_config }}"
dest: "{{ dest_dir }}/tempest_admin.conf"
flat: true
- name: Download tempest.conf file
fetch:
src: "{{ path_to_tempest_config }}"
dest: "{{ dest_dir }}/tempest.conf"
flat: true
- name: Download accounts.yaml file
fetch:
src: "{{ path_to_accounts_file }}"
dest: "{{ dest_dir }}/accounts.yaml"
flat: true