diff options
author | Zuul <zuul@review.opendev.org> | 2022-07-07 06:37:26 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-07-07 06:37:26 +0000 |
commit | 9a28a18d3376ec73b64f3bc5be9c137b8248f5ea (patch) | |
tree | efebfc0f0491603bc9dd305e436a16018e7d94ff /tests | |
parent | e2a827e48a8ecfda12b2fe3da18c0d4e41cfd753 (diff) | |
parent | 1cdf491a2e2536f1643cb7d36fa49148611e2f66 (diff) | |
download | zuul-9a28a18d3376ec73b64f3bc5be9c137b8248f5ea.tar.gz |
Merge "Handle non default loopvars in Ansible callback stream plugin"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/config/streamer/git/common-config/playbooks/python27.yaml | 12 | ||||
-rw-r--r-- | tests/unit/test_streaming.py | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/fixtures/config/streamer/git/common-config/playbooks/python27.yaml b/tests/fixtures/config/streamer/git/common-config/playbooks/python27.yaml index 8485b04ce..397439f61 100644 --- a/tests/fixtures/config/streamer/git/common-config/playbooks/python27.yaml +++ b/tests/fixtures/config/streamer/git/common-config/playbooks/python27.yaml @@ -11,6 +11,18 @@ Debug Test Token String Message + # Logging of loops is special so we do a simple one iteration + # loop and check that we log things properly + - name: Override ansible_loop_var + set_fact: + _testing_fact: "{{ other_loop_var }}" + with_random_choice: + - "one" + - "two" + - "three" + loop_control: + loop_var: "other_loop_var" + # Do not finish until test creates the flag file - wait_for: state: present diff --git a/tests/unit/test_streaming.py b/tests/unit/test_streaming.py index f323cd82a..ba3117f59 100644 --- a/tests/unit/test_streaming.py +++ b/tests/unit/test_streaming.py @@ -295,6 +295,11 @@ class TestStreaming(TestStreamingBase): match = r.search(self.streaming_data[None]) self.assertNotEqual(match, None) + # Check that we logged loop_var contents properly + pattern = r'ok: "(one|two|three)"' + m = re.search(pattern, self.streaming_data[None]) + self.assertNotEqual(m, None) + def runWSClient(self, port, build_uuid): client = WSClient(port, build_uuid) client.event.wait() |