Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 1 | - 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át | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame] | 6 | --source "{{ new_source_prefix }}/{{ zuul.project.short_name }}" "{{ new_source_prefix }}/coverage.xml" |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 7 | 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át | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame] | 9 | --source2 "{{ new_source_prefix }}/{{ zuul.project.short_name }}" "{{ new_source_prefix }}/coverage.xml" |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 10 | 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át | 1744cc0 | 2020-04-09 09:59:13 +0200 | [diff] [blame^] | 12 | |
| 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" |