test asserts aren't skipped

pull/82893/head
Martin Krizek 2 months ago
parent 0ec5dfeadc
commit 3dac95e3ef

@ -29,3 +29,7 @@
- after_end_role is undefined
- play_checkpoint|int == 4
- role_handler_ran is defined
- name: when running this playbook check this appears on stdout to ensure the above assert wasn't skipped
debug:
msg: CHECKPOINT

@ -4,6 +4,9 @@
- include_role:
name: end_role_inside_nested
- debug:
msg: CHECKPOINT
- assert:
that:
- after_end_role is undefined
@ -13,3 +16,7 @@
that:
- after_end_role
when: inventory_hostname == "host2"
- name: when running this playbook check this appears on stdout to ensure the above assert wasn't skipped
debug:
msg: CHECKPOINT

@ -55,8 +55,8 @@ ANSIBLE_PRIVATE_ROLE_VARS=0 ansible-playbook privacy.yml -e @vars/privacy_vars.y
ansible-playbook privacy.yml -e @vars/privacy_vars.yml "$@"
for strategy in linear free; do
ANSIBLE_STRATEGY=$strategy ansible-playbook end_role.yml "$@"
ANSIBLE_STRATEGY=$strategy ansible-playbook -i host1,host2 end_role_nested.yml "$@"
[ "$(ANSIBLE_STRATEGY=$strategy ansible-playbook end_role.yml | grep -c CHECKPOINT)" = "1" ]
[ "$(ANSIBLE_STRATEGY=$strategy ansible-playbook -i host1,host2 end_role_nested.yml | grep -c CHECKPOINT)" = "4" ]
done
[ $(ansible localhost -m meta -a "end_role" 2>&1 | grep -c "ERROR! Cannot execute 'end_role' from outside of a role") -eq 1 ]

Loading…
Cancel
Save