zuul-jobs/roles/fetch-subunit-output/tasks/process.yaml
Sorin Sbarnea 6b8cc6d468 More E208 (final)
Change-Id: I705d1b10696326f3d4d5bef4b5a88a83f2c3d960
2020-11-10 19:34:45 +00:00

56 lines
1.4 KiB
YAML

- name: Find subunit2html
import_tasks: find-subunit-html.yaml
- name: Generate testr_results.html file
command: "{{ subunit_html_command }} ./testrepository.subunit testr_results.html"
args:
chdir: "{{ zuul_work_dir }}"
when: subunit_html_command is defined
- name: Find subunit files
find:
paths:
- "{{ zuul_work_dir }}"
patterns:
- testr_results.html
- testrepository.subunit
register: subunit_files
- name: Collect test-results
synchronize:
dest: "{{ zuul.executor.log_root }}"
mode: pull
src: "{{ zj_subunit_file.path }}"
verify_host: true
owner: no
group: no
with_items: "{{ subunit_files.files }}"
loop_control:
loop_var: zj_subunit_file
when: not zuul_use_fetch_output
- name: Copy test-results
copy:
dest: "{{ zuul_output_dir }}/logs/"
src: "{{ zj_subunit_file.path }}"
remote_src: true
mode: 0644
with_items: "{{ subunit_files.files }}"
loop_control:
loop_var: zj_subunit_file
when: zuul_use_fetch_output
- name: Return artifact to Zuul
zuul_return:
data:
zuul:
artifacts:
- name: "Unit Test Report"
url: "testr_results.html"
metadata:
type: unit_test_report
when: "'testr_results.html' in zj_subunit_file.path"
with_items: "{{ subunit_files.files }}"
loop_control:
loop_var: zj_subunit_file