From 6a7cbe53c0dda4a2eb400faeff62d04e99192511 Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Tue, 15 Jul 2025 12:53:47 +0200 Subject: [PATCH] Fixing errors caused by missing variable in when clause. --- roles/tests/tests_behat/tasks/main.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/roles/tests/tests_behat/tasks/main.yml b/roles/tests/tests_behat/tasks/main.yml index 52c81012..9a016ec7 100644 --- a/roles/tests/tests_behat/tasks/main.yml +++ b/roles/tests/tests_behat/tasks/main.yml @@ -32,19 +32,18 @@ - behat.fail_builds - name: Run Behat command without failing build. - ansible.builtin.command: - cmd: "{{ behat.bin }} --config={{ behat.config_file }} --tags={{ behat.tags }} {{ _behat_outputs }}" - chdir: "{{ behat.working_dir }}" - register: _tests_behat_output # if we do not fail the build, we do not see the output if tests fail - failed_when: false when: - behat.outputs | length > 0 - not behat.fail_builds + block: + - name: Run Behat command. + ansible.builtin.command: + cmd: "{{ behat.bin }} --config={{ behat.config_file }} --tags={{ behat.tags }} {{ _behat_outputs }}" + chdir: "{{ behat.working_dir }}" + register: _tests_behat_output # if we do not fail the build, we do not see the output if tests fail + failed_when: false -- name: Show Behat output. - ansible.builtin.debug: - msg: "{{ _tests_behat_output.stdout }}" - when: - - _tests_behat_output is defined - - _tests_behat_output.stdout - - behat.show_results + - name: Show Behat output. + ansible.builtin.debug: + msg: "{{ _tests_behat_output.stdout }}" + when: behat.show_results