35 lines
922 B
YAML
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"
|