blob: 64726ebe6919b777c99600183b5e534d53de11a0 [file] [log] [blame]
Jan Kundrát3a016432020-04-07 22:47:49 +02001- name: Prepare copy of the new version of sources
2 shell: |
3 set -ex
4 NEW_WORK={{ ansible_user_dir }}/new
5 mkdir "${NEW_WORK}"
6 NEW_SRCDIR=${NEW_WORK}/{{ zuul.project.short_name }}
7 pushd {{ zuul.project.src_dir }}
8 git worktree add "${NEW_SRCDIR}" {{ zuul.branch }}
9 popd
10
11- name: Retrieve coverage from parent jobs
12 get_url:
13 url: "{{ item.url }}"
14 dest: "{{ ansible_user_dir }}/new/coverage.xml"
15 when:
16 - item.metadata is defined
17 - item.metadata.type is defined
18 - item.metadata.type == "cobertura_xml"
19 loop: "{{ zuul.artifacts }}"
20
21- name: Generate pycobertura report
22 shell: |
23 set -ex
24 PATH=${PATH}:~/.local/bin
25 pycobertura show --format html --output "{{ ansible_user_dir }}/zuul-output/logs/coverage.html" \
26 --source "{{ ansible_user_dir }}/new/{{ zuul.project.short_name }}" "{{ ansible_user_dir }}/new/coverage.xml"
27 pycobertura diff --format html --output "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html" \
28 --source1 "{{ zuul.project.src_dir }}" "{{ coverage_xml_dir }}/coverage.xml" \
29 --source2 "{{ ansible_user_dir }}/new/{{ zuul.project.short_name }}" "{{ ansible_user_dir }}/new/coverage.xml"
30 sed -e 's;^ </body>$; <p>Show <a href="coverage.html">final coverage</a> only</p>\n </body>;' \
31 -i "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html"