Add test for shell after include_role
We have observed that if a shell task runs on multiple hosts after an include_role, the task will report a missing zuul_log_id on the second host. This adds a test for that. Change-Id: I59787285674947c24b8919f1c4d5ced9439da9f8 Story: 2002528 Task: 22067
This commit is contained in:
@@ -58,3 +58,9 @@
|
||||
command: echo "First free task"
|
||||
- name: Command task 2 within free strategy
|
||||
command: echo "Second free task"
|
||||
|
||||
# Test a role that has an include_role
|
||||
- hosts: all
|
||||
strategy: linear
|
||||
roles:
|
||||
- include-a-role
|
||||
|
||||
3
tests/fixtures/config/remote-zuul-stream/git/org_project/roles/debug-role/tasks/main.yaml
vendored
Normal file
3
tests/fixtures/config/remote-zuul-stream/git/org_project/roles/debug-role/tasks/main.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
- name: Debug message
|
||||
debug:
|
||||
msg: "echo hi"
|
||||
@@ -0,0 +1,7 @@
|
||||
# We've seen callback problems with shell tasks after included roles.
|
||||
- name: Emit a debug message
|
||||
include_role:
|
||||
name: debug-role
|
||||
|
||||
- name: Include role shell task
|
||||
shell: echo "This is a shell task after an included role"
|
||||
@@ -46,6 +46,8 @@ class TestZuulStream(AnsibleZuulTestCase):
|
||||
- zuul: org/common-config
|
||||
nodeset:
|
||||
nodes:
|
||||
- name: compute1
|
||||
label: whatever
|
||||
- name: controller
|
||||
label: whatever
|
||||
|
||||
@@ -100,6 +102,10 @@ class TestZuulStream(AnsibleZuulTestCase):
|
||||
self.assertLogLine('controller \| This is a handler', text)
|
||||
self.assertLogLine('controller \| First free task', text)
|
||||
self.assertLogLine('controller \| Second free task', text)
|
||||
self.assertLogLine('controller \| This is a shell task after an '
|
||||
'included role', text)
|
||||
self.assertLogLine('compute1 \| This is a shell task after an '
|
||||
'included role', text)
|
||||
self.assertLogLine(
|
||||
'controller \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
|
||||
self.assertLogLine('PLAY RECAP', text)
|
||||
|
||||
Reference in New Issue
Block a user