Skip to content

Commit 0036142

Browse files
authored
Fixing errors caused by missing variable in when clause. (#718)
1 parent 41094c3 commit 0036142

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

roles/tests/tests_behat/tasks/main.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,18 @@
3232
- behat.fail_builds
3333

3434
- name: Run Behat command without failing build.
35-
ansible.builtin.command:
36-
cmd: "{{ behat.bin }} --config={{ behat.config_file }} --tags={{ behat.tags }} {{ _behat_outputs }}"
37-
chdir: "{{ behat.working_dir }}"
38-
register: _tests_behat_output # if we do not fail the build, we do not see the output if tests fail
39-
failed_when: false
4035
when:
4136
- behat.outputs | length > 0
4237
- not behat.fail_builds
38+
block:
39+
- name: Run Behat command.
40+
ansible.builtin.command:
41+
cmd: "{{ behat.bin }} --config={{ behat.config_file }} --tags={{ behat.tags }} {{ _behat_outputs }}"
42+
chdir: "{{ behat.working_dir }}"
43+
register: _tests_behat_output # if we do not fail the build, we do not see the output if tests fail
44+
failed_when: false
4345

44-
- name: Show Behat output.
45-
ansible.builtin.debug:
46-
msg: "{{ _tests_behat_output.stdout }}"
47-
when:
48-
- _tests_behat_output is defined
49-
- _tests_behat_output.stdout
50-
- behat.show_results
46+
- name: Show Behat output.
47+
ansible.builtin.debug:
48+
msg: "{{ _tests_behat_output.stdout }}"
49+
when: behat.show_results

0 commit comments

Comments
 (0)