Jan Kundrát | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame] | 1 | - name: Place for new version of sources |
| 2 | file: |
| 3 | path: "{{ new_source_prefix }}" |
| 4 | state: directory |
| 5 | |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 6 | - name: Prepare copy of the new version of sources |
Jan Kundrát | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame] | 7 | command: git worktree add {{ new_source_prefix }}/{{ zuul.project.short_name }} {{ zuul.branch }} |
| 8 | args: |
| 9 | chdir: "{{ zuul.project.src_dir }}" |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 10 | |
| 11 | - name: Retrieve coverage from parent jobs |
Jan Kundrát | 6e2570d | 2020-04-08 18:52:51 +0200 | [diff] [blame^] | 12 | include_task: download.yaml |
| 13 | loop: "{{ zuul.artifacts | json_query(artifact_seletctor) }}" |
| 14 | vars: |
| 15 | artifact_seletctor: "[([?metadata.type == 'cobertura_xml' && project == '{{ zuul.project.name }}'])[-1]]" |
| 16 | loop_control: |
| 17 | loop_var: artifact |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 18 | |
| 19 | - name: Generate pycobertura report |
| 20 | shell: | |
| 21 | set -ex |
| 22 | PATH=${PATH}:~/.local/bin |
| 23 | 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] | 24 | --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] | 25 | pycobertura diff --format html --output "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html" \ |
| 26 | --source1 "{{ zuul.project.src_dir }}" "{{ coverage_xml_dir }}/coverage.xml" \ |
Jan Kundrát | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame] | 27 | --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] | 28 | sed -e 's;^ </body>$; <p>Show <a href="coverage.html">final coverage</a> only</p>\n </body>;' \ |
| 29 | -i "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html" |