Attempt to copy the coverage report even if job fails

Some cover jobs such as the one in openstack/manila [1]
run custom coverage jobs and zuul_success=false doesn't
always mean that the 'coverage' tool itself has failed
to run.

So, attempt to copy the coverage report if it exists.

[1] http://git.openstack.org/cgit/openstack/manila/tree/tools/cover.sh

Change-Id: I5487f8c6ba8185fa0bfe7d83d24df3e065e0a903
This commit is contained in:
Goutham Pacha Ravi 2018-07-13 14:25:54 -07:00
parent 8855392890
commit 046278c147

View File

@ -1,20 +1,19 @@
- when: zuul_success | default(true) | bool - name: Check to see if coverage report exists
block: stat:
path: "{{ coverage_output_src }}"
register: coverage_report_stat
- name: Check to see if coverage report exists - when:
stat: - zuul_success | default(true) | bool
path: "{{ coverage_output_src }}" - not coverage_report_stat.stat.exists
register: coverage_report_stat name: Fail if coverage job succeeded and report is not present
fail:
msg: "Coverage report was not found even though tests succeeded"
- name: Collect coverage details output - when: coverage_report_stat.stat.exists
synchronize: name: Collect coverage details output
dest: "{{ zuul_executor_dest }}" synchronize:
mode: pull dest: "{{ zuul_executor_dest }}"
src: "{{ coverage_output_src }}" mode: pull
verify_host: true src: "{{ coverage_output_src }}"
when: coverage_report_stat.stat.exists verify_host: true
- name: Fail if coverage report not found
fail:
msg: "Coverage report was not found even though tests succeeded"
when: not coverage_report_stat.stat.exists