With the latest openstacksdk version 0.7.3, mistral.tests.unit.actions.openstack.test_generator.GeneratorTest.test_generator failed with the following error:
Traceback (most recent call last):
File "mistral/actions/openstack/action_generator/base.py", line 143, in create_actions
client_method = class_.get_fake_client_method()
File "mistral/actions/openstack/base.py", line 75, in get_fake_client_method
return cls._get_client_method(cls._get_fake_client())
File "mistral/actions/openstack/actions.py", line 827, in _get_fake_client
return cls._get_client_class()(authenticator=sess.auth)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/senlinclient/v1/client.py", line 28, in __init__
self.service = self.conn.cluster
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/openstack/service_description.py", line 95, in __get__
allow_version_hack=True,
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/openstack/config/cloud_region.py", line 470, in get_session_client
info = client.get_endpoint_data()
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 268, in get_endpoint_data
return self.session.get_endpoint_data(auth or self.auth, **kwargs)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 1130, in get_endpoint_data
return auth.get_endpoint_data(self, **kwargs)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 271, in get_endpoint_data
service_catalog = self.get_access(session).service_catalog
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 134, in get_access
self.auth_ref = self.get_auth_ref(session)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 206, in get_auth_ref
self._plugin = self._do_create_plugin(session)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 138, in _do_create_plugin
authenticated=False)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 601, in get_discovery
authenticated=authenticated)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/discover.py", line 1399, in get_discovery
disc = Discover(session, url, authenticated=authenticated)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/discover.py", line 498, in __init__
authenticated=authenticated)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/discover.py", line 101, in get_version_data
resp = session.get(url, headers=headers, authenticated=authenticated)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 1011, in get
return self.request(url, 'GET', **kwargs)
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 699, in request
if not urllib.parse.urlparse(url).netloc:
File "/usr/lib/python2.7/urlparse.py", line 143, in urlparse
tuple = urlsplit(url, scheme, allow_fragments)
File "/usr/lib/python2.7/urlparse.py", line 182, in urlsplit
i = url.find(':')
AttributeError: 'NoneType' object has no attribute 'find'
{0} mistral.tests.unit.actions.openstack.test_generator.GeneratorTest.test_generator [0.638071s] ... FAILED
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "mistral/tests/unit/actions/openstack/test_generator.py", line 103, in test_generator
name=action_name
File "mistral/tests/unit/base.py", line 141, in _assert_single_item
return self._assert_multiple_items(items, 1, **props)[0]
File "mistral/tests/unit/base.py", line 164, in _assert_multiple_items
"expected=%s, found=%s]" % (props, count, found))
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 690, in fail
raise self.failureException(msg)
AssertionError: Wrong number of items found [props={'name': 'senlin.get_profile'}, expected=1, found=0]
==============================
Failed 1 tests - output below:
==============================
mistral.tests.unit.actions.openstack.test_generator.GeneratorTest.test_generator
--------------------------------------------------------------------------------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "mistral/tests/unit/actions/openstack/test_generator.py", line 103, in test_generator
name=action_name
File "mistral/tests/unit/base.py", line 141, in _assert_single_item
return self._assert_multiple_items(items, 1, **props)[0]
File "mistral/tests/unit/base.py", line 164, in _assert_multiple_items
"expected=%s, found=%s]" % (props, count, found))
File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 690, in fail
raise self.failureException(msg)
AssertionError: Wrong number of items found [props={'name': 'senlin.get_profile'}, expected=1, found=0]
The problem seem to have caused by this patch
https://review.opendev.org/#/c/587437/
When 'clustering_default_microversion' is set, it will trigger the Keystone version discovery logic. But in the Mistral unit tests, we are using a fake client so there's no need to exercise the actual HTTP requests.
We'll need to either disable version discovery or mock out the HTTP requests.
Fix proposed to branch: stable/rocky /review. opendev. org/672185
Review: https:/