Activity log for bug #1783765

Date Who What changed Old value New value Message
2018-07-26 12:47:34 Pedro Guimarães bug added bug
2018-07-26 12:48:19 Pedro Guimarães bug task added charm-designate-bind
2018-07-26 12:49:20 Pedro Guimarães description Running tox -e py36 fails to execute unit tests for Designate and Designate-Bind Log of the error is: --- import errors --- Failed to import test module: unit_tests.test_designate_bind_handlers Traceback (most recent call last): File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 456, in _find_test_path module = self._get_module_from_name(name) File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 395, in _get_module_from_name __import__(name) File "/home/ubuntu/charm-designate-bind/unit_tests/test_designate_bind_handlers.py", line 23, in <module> import reactive.designate_bind_handlers as handlers File "src/reactive/designate_bind_handlers.py", line 21, in <module> @reactive.when_not(\'installed\') File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/decorators.py", line 95, in _when_decorator handler = Handler.get(action, endpoint_name) File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 90, in get cls._HANDLERS[action_id] = cls(action, suffix) File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 114, in __init__ self._action_id = _short_action_id(action, suffix) File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 59, in _short_action_id filepath = os.path.relpath(action.__code__.co_filename, hookenv.charm_dir()) File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/posixpath.py", line 465, in relpath start = os.fspath(start) TypeError: expected str, bytes or os.PathLike object, not MagicMock It seems that hookenv has been mocked without any return_value set for charm_dir() and os.path.relpath ends up failing because it receives a MagicMock instance instead of a actual path. One can reproduce this bug by cloning charm-designate from repo and running tox -e py36 directly on it. Running tox -e py36 fails to execute unit tests for Designate and Designate-Bind Log of the error is: --- import errors --- Failed to import test module: unit_tests.test_designate_bind_handlers Traceback (most recent call last):   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 456, in _find_test_path     module = self._get_module_from_name(name)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 395, in _get_module_from_name     __import__(name)   File "/home/ubuntu/charm-designate-bind/unit_tests/test_designate_bind_handlers.py", line 23, in <module>     import reactive.designate_bind_handlers as handlers   File "src/reactive/designate_bind_handlers.py", line 21, in <module>     @reactive.when_not(\'installed\')   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/decorators.py", line 95, in _when_decorator     handler = Handler.get(action, endpoint_name)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 90, in get     cls._HANDLERS[action_id] = cls(action, suffix)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 114, in __init__     self._action_id = _short_action_id(action, suffix)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 59, in _short_action_id     filepath = os.path.relpath(action.__code__.co_filename, hookenv.charm_dir())   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/posixpath.py", line 465, in relpath     start = os.fspath(start) TypeError: expected str, bytes or os.PathLike object, not MagicMock It seems that hookenv has been mocked without any return_value set for charm_dir() and because of that, os.path.relpath ends up failing because it receives a MagicMock instance instead of a actual path. One can reproduce this bug by cloning charm-designate from repo and running tox -e py36 directly on it.
2018-07-26 12:49:34 Pedro Guimarães charm-designate: assignee Pedro Guimarães (pguimaraes)
2018-07-26 12:49:37 Pedro Guimarães charm-designate-bind: assignee Pedro Guimarães (pguimaraes)
2018-07-26 12:59:38 OpenStack Infra charm-designate: status New In Progress
2018-07-26 13:00:34 OpenStack Infra charm-designate-bind: status New In Progress
2018-07-28 05:41:13 Pedro Guimarães bug task added charms.openstack
2018-07-28 05:41:29 Pedro Guimarães charms.openstack: status New Fix Released
2018-07-28 05:41:33 Pedro Guimarães charms.openstack: status Fix Released New
2018-07-28 05:41:37 Pedro Guimarães charms.openstack: assignee Pedro Guimarães (pguimaraes)
2018-07-28 05:41:42 Pedro Guimarães charms.openstack: status New Fix Released
2018-07-29 07:44:29 Pedro Guimarães description Running tox -e py36 fails to execute unit tests for Designate and Designate-Bind Log of the error is: --- import errors --- Failed to import test module: unit_tests.test_designate_bind_handlers Traceback (most recent call last):   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 456, in _find_test_path     module = self._get_module_from_name(name)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 395, in _get_module_from_name     __import__(name)   File "/home/ubuntu/charm-designate-bind/unit_tests/test_designate_bind_handlers.py", line 23, in <module>     import reactive.designate_bind_handlers as handlers   File "src/reactive/designate_bind_handlers.py", line 21, in <module>     @reactive.when_not(\'installed\')   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/decorators.py", line 95, in _when_decorator     handler = Handler.get(action, endpoint_name)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 90, in get     cls._HANDLERS[action_id] = cls(action, suffix)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 114, in __init__     self._action_id = _short_action_id(action, suffix)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 59, in _short_action_id     filepath = os.path.relpath(action.__code__.co_filename, hookenv.charm_dir())   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/posixpath.py", line 465, in relpath     start = os.fspath(start) TypeError: expected str, bytes or os.PathLike object, not MagicMock It seems that hookenv has been mocked without any return_value set for charm_dir() and because of that, os.path.relpath ends up failing because it receives a MagicMock instance instead of a actual path. One can reproduce this bug by cloning charm-designate from repo and running tox -e py36 directly on it. Running tox -e py36 fails to execute unit tests for Designate and Designate-Bind Log of the error is: --- import errors --- Failed to import test module: unit_tests.test_designate_bind_handlers Traceback (most recent call last):   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 456, in _find_test_path     module = self._get_module_from_name(name)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 395, in _get_module_from_name     __import__(name)   File "/home/ubuntu/charm-designate-bind/unit_tests/test_designate_bind_handlers.py", line 23, in <module>     import reactive.designate_bind_handlers as handlers   File "src/reactive/designate_bind_handlers.py", line 21, in <module>     @reactive.when_not(\'installed\')   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/decorators.py", line 95, in _when_decorator     handler = Handler.get(action, endpoint_name)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 90, in get     cls._HANDLERS[action_id] = cls(action, suffix)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 114, in __init__     self._action_id = _short_action_id(action, suffix)   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/site-packages/charms/reactive/bus.py", line 59, in _short_action_id     filepath = os.path.relpath(action.__code__.co_filename, hookenv.charm_dir())   File "/home/ubuntu/charm-designate-bind/.tox/py36/lib/python3.6/posixpath.py", line 465, in relpath     start = os.fspath(start) TypeError: expected str, bytes or os.PathLike object, not MagicMock It seems that hookenv has been mocked without any return_value set for charm_dir() and because of that, os.path.relpath ends up failing as it receives a MagicMock instance instead of an actual path. One can reproduce this bug by cloning charm-designate from repo and running tox -e py36.
2018-07-30 08:19:43 James Page charm-designate: status In Progress Invalid
2018-07-30 08:19:45 James Page charm-designate-bind: status In Progress Invalid