diff options
author | Zuul <zuul@review.opendev.org> | 2022-09-07 20:57:07 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-09-07 20:57:07 +0000 |
commit | 1db67256419fce40a5934f5e388508ab74a386df (patch) | |
tree | c871c8fa11d0d3c357faf96dc550ac3f01805b2a | |
parent | f5188c6914eb02856af354ad60da96fd21852dc2 (diff) | |
parent | 98296dd5f6e27993f8ccd85dc439d3a54f66a112 (diff) | |
download | zuul-1db67256419fce40a5934f5e388508ab74a386df.tar.gz |
Merge "zuul_stream: handle failed_when tasks"
-rw-r--r-- | tests/remote/test_remote_zuul_stream.py | 4 | ||||
-rw-r--r-- | zuul/ansible/base/callback/zuul_stream.py | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/tests/remote/test_remote_zuul_stream.py b/tests/remote/test_remote_zuul_stream.py index c163b3488..03247b9ce 100644 --- a/tests/remote/test_remote_zuul_stream.py +++ b/tests/remote/test_remote_zuul_stream.py @@ -139,9 +139,7 @@ class FunctionalZuulStreamMixIn: # Callback Exception: # ... # - # NOTE(ianw) 2022-08-24 : needs a couple of fixes before - # we can turn on. - self.assertIn('[WARNING]: Failure using method', console_output) + self.assertNotIn('[WARNING]: Failure using method', console_output) text = self._get_job_output(build) self.assertLogLine( diff --git a/zuul/ansible/base/callback/zuul_stream.py b/zuul/ansible/base/callback/zuul_stream.py index 39d3aa953..03cc6a1f8 100644 --- a/zuul/ansible/base/callback/zuul_stream.py +++ b/zuul/ansible/base/callback/zuul_stream.py @@ -542,10 +542,18 @@ class CallbackModule(default.CallbackModule): elif result_dict.get('msg') == 'All items completed': self._log_message(result, result_dict['msg']) else: - self._log_message( - result, - "Runtime: {delta}".format( - **result_dict)) + if 'delta' in result_dict: + self._log_message( + result, + "Runtime: {delta}".format( + **result_dict)) + else: + # NOTE(ianw) 2022-08-24 : *Fairly* sure that you only + # fall into here when the call actually fails (and has + # not start/end time), but it is ignored by + # failed_when matching. + self._log_message(result, msg='ERROR (ignored)', + result_dict=result_dict) def v2_runner_item_on_ok(self, result): result_dict = dict(result._result) |