Browse Source

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
changes/43/574643/4
Tobias Henkel 3 years ago
committed by James E. Blair
parent
commit
28dc87d4ee
  1. 12
      tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/command.yaml
  2. 4
      tests/remote/test_remote_zuul_stream.py

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

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

Loading…
Cancel
Save