blob: 418b2739c6fa606aec0236bf99299c77a2840625 [file] [log] [blame]
Jan Kundrát3a016432020-04-07 22:47:49 +02001- name: Generate pycobertura report
2 shell: |
3 set -ex
4 PATH=${PATH}:~/.local/bin
5 pycobertura show --format html --output "{{ ansible_user_dir }}/zuul-output/logs/coverage.html" \
Jan Kundrát67008092020-04-08 19:06:12 +02006 --source "{{ new_source_prefix }}/{{ zuul.project.short_name }}" "{{ new_source_prefix }}/coverage.xml"
Jan Kundrát3a016432020-04-07 22:47:49 +02007 pycobertura diff --format html --output "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html" \
8 --source1 "{{ zuul.project.src_dir }}" "{{ coverage_xml_dir }}/coverage.xml" \
Jan Kundrát67008092020-04-08 19:06:12 +02009 --source2 "{{ new_source_prefix }}/{{ zuul.project.short_name }}" "{{ new_source_prefix }}/coverage.xml"
Jan Kundrát3a016432020-04-07 22:47:49 +020010 sed -e 's;^ </body>$; <p>Show <a href="coverage.html">final coverage</a> only</p>\n </body>;' \
11 -i "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html"
Jan Kundrát1744cc02020-04-09 09:59:13 +020012
13- name: Check for coverage-diff.html
14 stat:
15 path: "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html"
16 get_checksum: false
17 get_mime: false
18 get_md5: false
19 register: coverage_diff_html_stat
20
21- name: Check for coverage.html
22 stat:
23 path: "{{ ansible_user_dir }}/zuul-output/logs/coverage.html"
24 get_checksum: false
25 get_mime: false
26 get_md5: false
27 register: coverage_html_stat
28
29- name: Register coverage reports as artifacts
30 when: coverage_html_stat.stat.exists
31 zuul_return:
32 data:
33 zuul:
34 artifacts:
35 - name: "Full coverage report"
36 url: "coverage.html"
37
38- name: Register coverage reports as artifacts
39 when: coverage_diff_html_stat.stat.exists
40 zuul_return:
41 data:
42 zuul:
43 artifacts:
44 - name: "Change of code coverage report"
45 url: "coverage-diff.html"