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 3, 2025
1 parent c2e4f9f commit c8be930
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 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,9 @@
ansible.builtin.include_role:
name: 'install_yamls_makes'
tasks_from: 'make_{{ operator }}_kuttl.yml'
apply:
ignore_errors: true # noqa: ignore-errors
register: kuttl_run_results

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

- ansible.builtin.debug:
var: kuttl_run_results

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

0 comments on commit c8be930

Please sign in to comment.