diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2023-01-18 23:22:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 16:22:34 -0600 |
commit | c297ee9b5da91a0054feb2ea6fd971e21e22d4f5 (patch) | |
tree | 96b11ed5f318d3f7f83447ab435d605b32419ad4 /test | |
parent | 3a21caa2179437aecd5455c91f9dec88c19653a5 (diff) | |
download | ansible-c297ee9b5da91a0054feb2ea6fd971e21e22d4f5.tar.gz |
Correctly count rescued tasks in play stats (#79724) (#79728)
Fixes #79711
ci_complete
(cherry picked from commit e38b3e64fd5f9bb6c5ca9462150c89f0932fd2c4)
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/targets/blocks/79711.yml | 17 | ||||
-rwxr-xr-x | test/integration/targets/blocks/runme.sh | 9 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/integration/targets/blocks/79711.yml b/test/integration/targets/blocks/79711.yml new file mode 100644 index 0000000000..ca9bfbb498 --- /dev/null +++ b/test/integration/targets/blocks/79711.yml @@ -0,0 +1,17 @@ +- hosts: localhost + gather_facts: false + tasks: + - block: + - block: + - debug: + - name: EXPECTED FAILURE + fail: + rescue: + - debug: + - debug: + - name: EXPECTED FAILURE + fail: + always: + - debug: + always: + - debug: diff --git a/test/integration/targets/blocks/runme.sh b/test/integration/targets/blocks/runme.sh index 06e3ddee83..820107bbe1 100755 --- a/test/integration/targets/blocks/runme.sh +++ b/test/integration/targets/blocks/runme.sh @@ -127,3 +127,12 @@ rm -f 78612.out ansible-playbook -vv 43191.yml ansible-playbook -vv 43191-2.yml + +# https://github.com/ansible/ansible/issues/79711 +set +e +ANSIBLE_FORCE_HANDLERS=0 ansible-playbook -vv 79711.yml | tee 79711.out +set -e +[ "$(grep -c 'ok=5' 79711.out)" -eq 1 ] +[ "$(grep -c 'failed=1' 79711.out)" -eq 1 ] +[ "$(grep -c 'rescued=1' 79711.out)" -eq 1 ] +rm -f 79711.out |