Skip to content

Commit

Permalink
Save kuttl JUnitXML result files
Browse files Browse the repository at this point in the history
Grab the results JUnitXML file (if any) returned by kuttl tests
(they may not be configured to do so, so ignore the failures)
and copy them to a location that will be collected.
  • Loading branch information
tosky committed Dec 18, 2024
1 parent 5731e27 commit 4219411
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ci/playbooks/kuttl/run-kuttl-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,30 @@
{{ item }} > {{ cifmw_artifacts_basedir }}/logs/cmd_after_{{ operator }}_kuttl.log
loop: "{{ commands_after_kuttl_run }}"
ignore_errors: true

# Some of the xml files may not be the JUnitXML results, but getting the exact file
# name (parsing the KUTTL configuration) may be too cumbersome.
- name: Find the generated JUnitXML files
ansible.builtin.find:
paths: "{{ cifmw_installyamls_repos }}"
file_type: file
patterns: '*.xml'
register: "_cifmw_kuttl_xml_files"

- name: Copy the log results of {{ operator }}
vars:
_kuttl_test_result_dir: "{{ cifmw_artifacts_basedir }}/tests/kuttl_{{ operator }}"
block:
- name: Create the test results directory
ansible.builtin.file:
path: "{{ _kuttl_test_result_dir }}"
state: directory
mode: '0755'

- name: Copy the generated test results to the test results directory
ansible.builtin.copy:
src: "{{ item.path }}"
dest: "{{ _kuttl_test_result_dir }}"
mode: '0644'
loop: "{{ _cifmw_kuttl_xml_files.files }}"
ignore_errors: true # noqa: ignore-errors

0 comments on commit 4219411

Please sign in to comment.