Files
tripleo-quickstart-extras/roles/validate-tobiko/tasks/tobiko-results.yml
Sorin Sbarnea 8b2e5653e4 lint: fixed ansible-lint 301 rule
Change-Id: I8ce7e11cd6027b53f1112c5880a5891c778db9d4
2020-01-05 19:37:09 +00:00

35 lines
922 B
YAML

---
- name: Check for .stestr directory
stat:
path: "{{ working_dir }}/tobiko/.stestr"
register: testr_dir
- name: Define testr facts
set_fact:
testr_command: "{{ python_cmd }} -m stestr.cli"
- name: Generate testrepository.subunit results file
shell: >
set -o pipefail &&
{{ testr_command }} last --subunit > {{ tobiko_log_dir }}/testrepository.subunit
args:
chdir: "{{ working_dir }}/tobiko"
changed_when: true
- name: Generate HTML results file
shell: |
set -o pipefail &&
subunit2html {{ tobiko_log_dir }}/testrepository.subunit {{ tobiko_log_dir }}/{{ tobiko_log_file }}.html
changed_when: true
- name: Fetch HTML results
fetch:
src: "{{ tobiko_log_dir }}/{{ tobiko_log_file }}.html"
dest: "{{ local_working_dir }}/{{ tobiko_log_file }}.html"
flat: true
- name: Fail if tobiko tests did not succeed
assert:
that:
- "tobiko_tests_run.rc == 0"