Skip to content

Commit 52af24e

Browse files
toskyopenshift-merge-bot[bot]
authored andcommitted
KUTTL: don't bail out immediately, save the test reports
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.
1 parent 501c9de commit 52af24e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ci/playbooks/kuttl/run-kuttl-tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
ansible.builtin.include_role:
5353
name: 'install_yamls_makes'
5454
tasks_from: 'make_{{ operator }}_kuttl.yml'
55+
apply:
56+
ignore_errors: true # noqa: ignore-errors
5557

5658
- name: 'Get resource status after {{ operator }}_kuttl run'
5759
environment:
@@ -88,3 +90,14 @@
8890
mode: '0644'
8991
loop: "{{ _cifmw_kuttl_xml_files.files }}"
9092
ignore_errors: true # noqa: ignore-errors
93+
94+
# Note: the variable checked here is set by the specific autogenerated task
95+
# for the autogenerated install_yamls_makes role.
96+
- name: Fail when any tests failed
97+
vars:
98+
_kuttl_curr_operator_result: "{{ lookup('vars', 'make_' + operator + '_kuttl_status')|default(1) }}"
99+
ansible.builtin.assert:
100+
that:
101+
- _kuttl_curr_operator_result.rc == 0
102+
success_msg: "KUTTL tests for {{ operator }} passed"
103+
fail_msg: "KUTTL tests for {{ operator }} failed"

0 commit comments

Comments
 (0)