Add blocks to the zuul stream test

A further edge case which could potentially break in the future is
using blocks with rescue and always tasks. Add them to the test to
make sure they won't break.

Change-Id: I2a45ba303825dff8ed9f64a68a6b71c0e5afa08c
This commit is contained in:
Tobias Henkel 2018-06-12 10:33:49 +02:00 committed by James E. Blair
parent 1310aa592b
commit 28dc87d4ee
2 changed files with 15 additions and 1 deletions

View File

@ -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"

View File

@ -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/'