Skip to content

Commit

Permalink
KUTTL: don't bail out immediately, save the test reports
Browse files Browse the repository at this point in the history
Execute all KUTTL tests without bailing out at the first error.
Instead make sure that the tests are executed and their JUnitXML
reports are collected if available.
Move the accept/fail condition at the end, following the same
pattern used elsewhere when running tests.
  • Loading branch information
tosky committed Jan 2, 2025
1 parent c2e4f9f commit 599dd07
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ci/playbooks/kuttl/run-kuttl-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
ansible.builtin.include_role:
name: 'install_yamls_makes'
tasks_from: 'make_{{ operator }}_kuttl.yml'
register: kuttl_run_results
ignore_errors: true # noqa: ignore-errors

- name: 'Get resource status after {{ operator }}_kuttl run'
environment:
Expand Down Expand Up @@ -88,3 +90,11 @@
mode: '0644'
loop: "{{ _cifmw_kuttl_xml_files.files }}"
ignore_errors: true # noqa: ignore-errors

- name: Fail when any tests failed
ansible.builtin.assert:
that:
- item.rc != 0
success_msg: "{{ item.cmd }} passed"
fail_msg: "{{ item.cmd }} failed"
loop: "{{ kuttl_run_results | default({}) | dict2items }}"

0 comments on commit 599dd07

Please sign in to comment.