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 41c603b3e0..ea3c92d8fb 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 @@ -38,3 +38,11 @@ handlers: - name: test handler command: echo "This is a handler" + +- hosts: all + strategy: free + tasks: + - name: Command task 1 within free strategy + command: echo "First free task" + - name: Command task 2 within free strategy + command: echo "Second free task" diff --git a/tests/remote/test_remote_zuul_stream.py b/tests/remote/test_remote_zuul_stream.py index a6024f6014..6aefdc6b46 100644 --- a/tests/remote/test_remote_zuul_stream.py +++ b/tests/remote/test_remote_zuul_stream.py @@ -96,6 +96,8 @@ class TestZuulStream(AnsibleZuulTestCase): self.assertLogLine('TASK \[Show contents of second file\]', text) self.assertLogLine('controller \| command test two', text) 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 \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text) self.assertLogLine('PLAY RECAP', text) diff --git a/zuul/ansible/callback/zuul_stream.py b/zuul/ansible/callback/zuul_stream.py index 00e1a78abd..6c60ff62e1 100644 --- a/zuul/ansible/callback/zuul_stream.py +++ b/zuul/ansible/callback/zuul_stream.py @@ -210,6 +210,9 @@ class CallbackModule(default.CallbackModule): if self._play.strategy != 'free': task_name = self._print_task_banner(task) + else: + task_name = task.get_name().strip() + if task.action in ('command', 'shell'): log_id = uuid.uuid4().hex task.args['zuul_log_id'] = log_id