zuul-jobs/roles/fetch-stestr-output/tasks/process.yaml
Matthew Treinish 131e8544b8 Add fetch-stestr-output role
This commit adds a new role for jobs that run stestr instead of
testrepository. This will generate the output using stestr for those
cases like we do with testr for the old jobs which leverage
testrepository. This change is the dual of the jenkins script patch:
I1fc3b146e99e3484fa009b227ee5d0aeb6ed6084

Change-Id: Ibf652801507ad2845281dd540b4007b04875b2ae
2017-08-07 16:28:12 -04:00

32 lines
821 B
YAML

- name: Generate testrepository.subunit file
shell: ".tox/{{ tox_envlist }}/bin/stestr last --subunit > ./testrepository.subunit"
args:
chdir: "{{ zuul_work_dir }}"
- name: Generate testr_results.html file
command: "/usr/os-testr-env/bin/subunit2html ./testrepository.subunit testr_results.html"
args:
chdir: "{{ zuul_work_dir }}"
- name: Register testrepository.subunit file
stat:
path: "{{ zuul_work_dir }}/testrepository.subunit"
register: p
- name: Compress testrepository.subunit file
archive:
path: "{{ p.stat.path }}"
when:
- p.stat.exists
- name: Register testr_results.html file
stat:
path: "{{ zuul_work_dir }}/testr_results.html"
register: html
- name: Compress testr_results.html file
archive:
path: "{{ html.stat.path }}"
when:
- html.stat.exists