diff --git a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/command.yaml b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/command.yaml index ea3c92d8fb..65daf30a21 100644 --- a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/command.yaml +++ b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/command.yaml @@ -35,6 +35,18 @@ command: /bin/true notify: test handler + # Test cleanup task + - name: Block with cleanup + block: + - name: Run a command + command: /bin/false + rescue: + - name: Rescue task + command: echo "This is a rescue task" + always: + - name: Always task + command: echo "This is an always task" + handlers: - name: test handler command: echo "This is a handler" diff --git a/tests/remote/test_remote_zuul_stream.py b/tests/remote/test_remote_zuul_stream.py index 6aefdc6b46..db4b32154f 100644 --- a/tests/remote/test_remote_zuul_stream.py +++ b/tests/remote/test_remote_zuul_stream.py @@ -95,6 +95,8 @@ class TestZuulStream(AnsibleZuulTestCase): 'controller \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text) self.assertLogLine('TASK \[Show contents of second file\]', text) self.assertLogLine('controller \| command test two', text) + self.assertLogLine('controller \| This is a rescue task', text) + self.assertLogLine('controller \| This is an always task', text) self.assertLogLine('controller \| This is a handler', text) self.assertLogLine('controller \| First free task', text) self.assertLogLine('controller \| Second free task', text) @@ -102,7 +104,7 @@ class TestZuulStream(AnsibleZuulTestCase): 'controller \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text) self.assertLogLine('PLAY RECAP', text) self.assertLogLine( - 'controller \| ok: \d+ changed: \d+ unreachable: 0 failed: 0', + 'controller \| ok: \d+ changed: \d+ unreachable: 0 failed: 1', text) self.assertLogLine( 'RUN END RESULT_NORMAL: \[untrusted : review.example.com/'