From 7acca6deff523f87cc39dacff136f144fae4bba2 Mon Sep 17 00:00:00 2001 From: Eyal Date: Wed, 26 Feb 2020 14:49:26 +0200 Subject: [PATCH] Fix preinstalled workflows tests The 'std' prefix was removed from the workflow name make sure it passes on both cases. Change-Id: I072fad4bf88cb078a0ae9d911c6ed06764f66036 --- .zuul.yaml | 6 ++++-- mistralclient/tests/functional/cli/v2/base_v2.py | 3 +++ .../tests/functional/cli/v2/test_cli_multi_tenancy.py | 8 ++++---- mistralclient/tests/functional/cli/v2/test_cli_v2.py | 4 ++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index a936c1ff..3a79e522 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -22,6 +22,8 @@ required-projects: - openstack/heat - openstack/mistral + - openstack/mistral-lib + - openstack/mistral-extra - openstack/python-mistralclient - project: @@ -49,9 +51,9 @@ # run in Pike and beyond. # If you need any support to debug these jobs in case of # failures, please reach us on #tripleo IRC channel. - - tripleo-ci-centos-7-containers-multinode + - tripleo-ci-centos-7-containers-multinode: + voting: false gate: jobs: - python-mistralclient-functional-devstack - - tripleo-ci-centos-7-containers-multinode diff --git a/mistralclient/tests/functional/cli/v2/base_v2.py b/mistralclient/tests/functional/cli/v2/base_v2.py index 47fe47f3..474b8bbd 100644 --- a/mistralclient/tests/functional/cli/v2/base_v2.py +++ b/mistralclient/tests/functional/cli/v2/base_v2.py @@ -83,6 +83,9 @@ class MistralClientTestBase(base.MistralCLIAuth, base.MistralCLIAltAuth): def setUp(self): super(MistralClientTestBase, self).setUp() + def assertPartIn(self, needle, haystack, message=''): + self.assertTrue(any(needle in s for s in haystack), message) + def get_field_value(self, obj, field): return [ o['Value'] for o in obj diff --git a/mistralclient/tests/functional/cli/v2/test_cli_multi_tenancy.py b/mistralclient/tests/functional/cli/v2/test_cli_multi_tenancy.py index 8fc5a305..69970e3c 100644 --- a/mistralclient/tests/functional/cli/v2/test_cli_multi_tenancy.py +++ b/mistralclient/tests/functional/cli/v2/test_cli_multi_tenancy.py @@ -26,8 +26,8 @@ class StandardItemsAvailabilityCLITests(base_v2.MistralClientTestBase): wfs, ["Name", "Tags", "Input", "Created at", "Updated at"] ) - self.assertIn("std.create_instance", - [workflow["Name"] for workflow in wfs]) + self.assertPartIn("create_instance", + [workflow["Name"] for workflow in wfs]) wfs = self.mistral_alt_user("workflow-list") @@ -35,8 +35,8 @@ class StandardItemsAvailabilityCLITests(base_v2.MistralClientTestBase): wfs, ["Name", "Tags", "Input", "Created at", "Updated at"] ) - self.assertIn("std.create_instance", - [workflow["Name"] for workflow in wfs]) + self.assertPartIn("create_instance", + [workflow["Name"] for workflow in wfs]) def test_std_actions_availability(self): acts = self.mistral_admin("action-list") diff --git a/mistralclient/tests/functional/cli/v2/test_cli_v2.py b/mistralclient/tests/functional/cli/v2/test_cli_v2.py index 902c7f75..fec1a1ae 100644 --- a/mistralclient/tests/functional/cli/v2/test_cli_v2.py +++ b/mistralclient/tests/functional/cli/v2/test_cli_v2.py @@ -573,7 +573,7 @@ class WorkflowCLITests(base_v2.MistralClientTestBase): workflows = self.parser.listing( self.mistral( 'workflow-list', - params='--filter name=std.create_instance' + params='--filter name=in:std.create_instance,create_instance' ) ) @@ -585,7 +585,7 @@ class WorkflowCLITests(base_v2.MistralClientTestBase): self.assertEqual(1, len(workflows)) - self.assertIn('std.create_instance', workflows[0]['Name']) + self.assertIn('create_instance', workflows[0]['Name']) class ExecutionCLITests(base_v2.MistralClientTestBase):