Reviewed: https://review.openstack.org/287543 Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=dcc838128e0812a760733f24a65f09bcd047a399 Submitter: Jenkins Branch: master
commit dcc838128e0812a760733f24a65f09bcd047a399 Author: David Lyle <[email protected]> Date: Wed Mar 2 18:11:09 2016 -0700 Fixing heatclient release compat issues The new release of python-heatclient broke tests that were using hardcoded sample templates. For the json based templates, the new line was escaped. For yaml templates, a comment section was added to the templates. My working theory is that the exception handling changed and we were missing an error before that is being exposed now. That is to say, our hardcoded templates were wrong before, we just weren't seeing it. Tested with latest version of python-heatclient 1.0.0 and last version 0.9.0. Closes-Bug: #1552400 Change-Id: Ibdf985654ebfa60205068b167a37600f7ed4c1f4 ** Changed in: horizon Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Dashboard (Horizon). https://bugs.launchpad.net/bugs/1552400 Title: heatclient release breaks tests Status in OpenStack Dashboard (Horizon): Fix Released Bug description: A new python-heatclient release has broken unit tests: ====================================================================== ERROR: test_edit_stack_template (openstack_dashboard.dashboards.project.stacks.tests.StackTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 112, in instance_stub_out return fn(self, *args, **kwargs) File "/home/david-lyle/horizon/openstack_dashboard/dashboards/project/stacks/tests.py", line 618, in test_edit_stack_template template=hc_format.parse(template.data)) \ File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/heatclient/common/template_format.py", line 51, in parse tpl = json.loads(tmpl_str) File "/usr/lib/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Invalid control character at: line 182 column 16 (char 3134) ====================================================================== ERROR: test_edit_stack_template (openstack_dashboard.dashboards.project.stacks.tests.StackTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 208, in tearDown super(TestCase, self).tearDown() File "/home/david-lyle/horizon/horizon/test/helpers.py", line 154, in tearDown self.mox.VerifyAll() File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/mox3/mox.py", line 289, in VerifyAll mock_obj._Verify() File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/mox3/mox.py", line 543, in _Verify raise ExpectedMethodCallsError(self._expected_calls_queue) ExpectedMethodCallsError: Verify: Expected methods never called: 0. function.__call__(mox.IsA(<class 'django.http.request.HttpRequest'>) , '05b4f39f-ea96-4d91-910c-e758c078a0890') -> <Stack {'description': 'No description', 'links': [{'href': 'http://192.168.1.70:8004/v1/051c727ee67040d6a7b7812708485a97/stacks/stack-test0/05b4f39f-ea96-4d91-910c-e758c078a0890', 'rel': 'self'}], 'stack_status_reason': 'Stack successfully created', 'stack_name': 'stack-test0', 'stack_status': 'CREATE_COMPLETE', 'parameters': {'DBUsername': '******', 'AWS::StackId': 'arn:openstack:heat::2ce287:stacks/teststack/88553ec', 'DBName': u'wordpress', 'DBPassword': '******', 'AWS::StackName': 'teststack0', 'AWS::Region': 'ap-southeast-1', 'InstanceType': 'm1.small', 'DBRootPassword': '******'}, 'creation_time': '2013-04-22T00:11:39Z', 'id': '05b4f39f-ea96-4d91-910c-e758c078a0890', 'updated_time': '2013-04-22T00:11:39Z'}> ====================================================================== ERROR: test_launch_stack (openstack_dashboard.dashboards.project.stacks.tests.StackTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 112, in instance_stub_out return fn(self, *args, **kwargs) File "/home/david-lyle/horizon/openstack_dashboard/dashboards/project/stacks/tests.py", line 235, in test_launch_stack template=hc_format.parse(template.data)) \ File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/heatclient/common/template_format.py", line 51, in parse tpl = json.loads(tmpl_str) File "/usr/lib/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Invalid control character at: line 182 column 16 (char 3134) ====================================================================== ERROR: test_launch_stack_with_environment (openstack_dashboard.dashboards.project.stacks.tests.StackTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 112, in instance_stub_out return fn(self, *args, **kwargs) File "/home/david-lyle/horizon/openstack_dashboard/dashboards/project/stacks/tests.py", line 294, in test_launch_stack_with_environment template=hc_format.parse(template.data), File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/heatclient/common/template_format.py", line 51, in parse tpl = json.loads(tmpl_str) File "/usr/lib/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Invalid control character at: line 182 column 16 (char 3134) ====================================================================== ERROR: test_preview_stack (openstack_dashboard.dashboards.project.stacks.tests.StackTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 112, in instance_stub_out return fn(self, *args, **kwargs) File "/home/david-lyle/horizon/openstack_dashboard/dashboards/project/stacks/tests.py", line 763, in test_preview_stack template=hc_format.parse(template.data)) \ File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/heatclient/common/template_format.py", line 51, in parse tpl = json.loads(tmpl_str) File "/usr/lib/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Invalid control character at: line 182 column 16 (char 3134) ====================================================================== ERROR: test_get_template_files (openstack_dashboard.test.api_tests.heat_tests.HeatApiTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/api_tests/heat_tests.py", line 278, in test_get_template_files files = api.heat.get_template_files(template_data=tmpl)[0] File "/home/david-lyle/horizon/openstack_dashboard/api/heat.py", line 117, in get_template_files template = template_format.parse(tpl) File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/heatclient/common/template_format.py", line 62, in parse raise ValueError(yea) ValueError: mapping values are not allowed here in "<unicode string>", line 2, column 14: resources: ^ ====================================================================== ERROR: test_get_template_files (openstack_dashboard.test.api_tests.heat_tests.HeatApiTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 413, in tearDown super(APITestCase, self).tearDown() File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 208, in tearDown super(TestCase, self).tearDown() File "/home/david-lyle/horizon/horizon/test/helpers.py", line 154, in tearDown self.mox.VerifyAll() File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/mox3/mox.py", line 289, in VerifyAll mock_obj._Verify() File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/mox3/mox.py", line 543, in _Verify raise ExpectedMethodCallsError(self._expected_calls_queue) ExpectedMethodCallsError: Verify: Expected methods never called: 0. function.__call__('http://test.example/example') -> <StringIO.StringIO instance at 0x7f4469d0fcf8> ====================================================================== ERROR: test_get_template_files_invalid (openstack_dashboard.test.api_tests.heat_tests.HeatApiTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/api_tests/heat_tests.py", line 321, in test_get_template_files_invalid api.heat.get_template_files(template_data=tmpl)[0] File "/home/david-lyle/horizon/openstack_dashboard/api/heat.py", line 117, in get_template_files template = template_format.parse(tpl) File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/heatclient/common/template_format.py", line 62, in parse raise ValueError(yea) ValueError: mapping values are not allowed here in "<unicode string>", line 2, column 14: resources: ^ ====================================================================== ERROR: test_get_template_files_with_template_data (openstack_dashboard.test.api_tests.heat_tests.HeatApiTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/api_tests/heat_tests.py", line 255, in test_get_template_files_with_template_data files = api.heat.get_template_files(template_data=tmpl)[0] File "/home/david-lyle/horizon/openstack_dashboard/api/heat.py", line 117, in get_template_files template = template_format.parse(tpl) File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/heatclient/common/template_format.py", line 62, in parse raise ValueError(yea) ValueError: mapping values are not allowed here in "<unicode string>", line 2, column 14: resources: ^ ====================================================================== ERROR: test_get_template_files_with_template_url (openstack_dashboard.test.api_tests.heat_tests.HeatApiTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/api_tests/heat_tests.py", line 304, in test_get_template_files_with_template_url files = api.heat.get_template_files(template_url=url)[0] File "/home/david-lyle/horizon/openstack_dashboard/api/heat.py", line 117, in get_template_files template = template_format.parse(tpl) File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/heatclient/common/template_format.py", line 62, in parse raise ValueError(yea) ValueError: mapping values are not allowed here in "<unicode string>", line 2, column 14: resources: ^ ====================================================================== ERROR: test_get_template_files_with_template_url (openstack_dashboard.test.api_tests.heat_tests.HeatApiTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 413, in tearDown super(APITestCase, self).tearDown() File "/home/david-lyle/horizon/openstack_dashboard/test/helpers.py", line 208, in tearDown super(TestCase, self).tearDown() File "/home/david-lyle/horizon/horizon/test/helpers.py", line 154, in tearDown self.mox.VerifyAll() File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/mox3/mox.py", line 289, in VerifyAll mock_obj._Verify() File "/home/david-lyle/horizon/.venv/local/lib/python2.7/site-packages/mox3/mox.py", line 543, in _Verify raise ExpectedMethodCallsError(self._expected_calls_queue) ExpectedMethodCallsError: Verify: Expected methods never called: 0. function.__call__('http://test.example/example') -> <StringIO.StringIO instance at 0x7f4469b847a0> ---------------------------------------------------------------------- To manage notifications about this bug go to: https://bugs.launchpad.net/horizon/+bug/1552400/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

