Example error:
magnum.tests.unit.api.controllers.v1.test_container.TestContainerController.test_execute_command_by_name_StringException: Empty attachments:
stderr
stdout
Traceback (most recent call last):
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
return func(*args, **keywargs)
File "magnum/tests/unit/api/controllers/v1/test_container.py", line 393, in test_execute_command_by_name
response = self.app.put(url, cmd)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/webtest/app.py", line 387, in put
content_type=content_type,
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/webtest/app.py", line 735, in _gen_request
expect_errors=expect_errors)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/webtest/app.py", line 605, in do_request
res = req.get_response(app, catch_exc_info=True)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/webob/request.py", line 1313, in send
application, catch_exc_info=True)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/webob/request.py", line 1281, in call_application
app_iter = application(self.environ, start_response)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/webtest/lint.py", line 198, in lint_app
iterator = application(environ, start_response_wrapper)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/pecan/middleware/debug.py", line 282, in __call__
return self.app(environ, start_response)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/pecan/middleware/recursive.py", line 56, in __call__
return self.application(environ, start_response)
File "magnum/api/middleware/parsable_error.py", line 65, in __call__
app_iter = self.app(environ, replacement_start_response)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/pecan/core.py", line 810, in __call__
return super(Pecan, self).__call__(environ, start_response)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/pecan/core.py", line 659, in __call__
self.invoke_controller(controller, args, kwargs, state)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/pecan/core.py", line 587, in invoke_controller
result = self.render(template, result)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/pecan/core.py", line 410, in render
return renderer.render(template, namespace)
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/wsmeext/pecan.py", line 28, in render
namespace['datatype']
File "/home/jenkins/workspace/gate-magnum-python27/.tox/py27/local/lib/python2.7/site-packages/wsme/rest/json.py", line 273, in encode_result
return json.dumps(jsondata)
File "/usr/lib/python2.7/json/__init__.py", line 243, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <MagicMock name='container_exec()' id='139740649330832'> is not JSON serializable
Reviewed: https:/ /review. openstack. org/203106 /git.openstack. org/cgit/ openstack/ magnum/ commit/ ?id=6a73ffe66f2 e1f4c2644fc081c f7903aa3ce1f9a
Committed: https:/
Submitter: Jenkins
Branch: master
commit 6a73ffe66f2e1f4 c2644fc081cf790 3aa3ce1f9a
Author: Tom Cammann <email address hidden>
Date: Fri Jul 17 16:58:55 2015 +0100
Add return value to mocks to allow serialisation
In the container tests the mocks being passed in are being serialised
by pecan however they have no return value and therefore cannot be
serialised. Add return value to allow serialisation.
This fix should be refined, however this bug is currently blocking the
gate so fix it now and improve later.
Change-Id: I583e03b60f7c4b e0fa3d65f9dd4ee 4e643e4fbab
Closes-bug: #1475716