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:
James E. Blair
2018-06-11 16:37:38 -07:00
parent dec1900178
commit 6526ce8282
4 changed files with 22 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,3 @@
- name: Debug message
debug:
msg: "echo hi"

View File

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

View File

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