If you run devstacks on the same machine where you do your gnocchi development the fact that the unit tests are not isolated from /etc/ceilometer/ceilometer.conf is very annoying.
The failure is pasted below. This only happens if a [gnocchi_dispatcher] section in ceilometer.conf has:
filter_service_activity = False
:the paste:
==============================
Failed 1 tests - output below:
==============================
gnocchi.tests.test_ceilometer_dispatcher.DispatcherTest.test_activity_filter_match_project_id
---------------------------------------------------------------------------------------------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "gnocchi/tests/test_ceilometer_dispatcher.py", line 135, in test_activity_filter_match_project_id
self._do_test_activity_filter([self.samples[1]])
File "/home/cdent/src/gnocchi/.tox/py27/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
File "gnocchi/tests/test_ceilometer_dispatcher.py", line 109, in _do_test_activity_filter
expected_samples, True,
File "/home/cdent/src/gnocchi/.tox/py27/lib/python2.7/site-packages/mock.py", line 835, in assert_called_with
raise AssertionError(msg)
AssertionError: Expected call: _process_samples(<ANY>, 'd2249765-4c37-4e90-bbac-f12050d6e11d', 'disk.root.size', [{'source': 'openstack', 'project_id': 'test_project', 'counter_name': 'disk.root.size', 'resource_id': 'd2249765-4c37-4e90-bbac-f12050d6e11d', 'counter_volume': '2', 'timestamp': '2014-05-08 20:23:48.028195', 'resource_metadata': {'instance_flavor_id': '1234', 'host': 'foo', 'display_name': 'myinstance', 'image_ref_url': 'imageref!'}, 'user_id': 'test_user', 'counter_type': 'gauge'}], True)
Actual call: _process_samples(<stevedore.extension.Extension object at 0x7f0da670a910>, 'd2249765-4c37-4e90-bbac-f12050d6e11d', 'disk.root.size', [{'source': 'openstack', 'project_id': 'a2d42c23-d518-46b6-96ab-3fba2e146859', 'counter_name': 'disk.root.size', 'resource_id': 'd2249765-4c37-4e90-bbac-f12050d6e11d', 'counter_volume': '2', 'timestamp': '2012-05-08 20:23:48.028195', 'resource_metadata': {'instance_flavor_id': '1234', 'host': 'foo', 'display_name': 'myinstance', 'image_ref_url': 'imageref!'}, 'user_id': 'test_user', 'counter_type': 'gauge'}, {'source': 'openstack', 'project_id': 'test_project', 'counter_name': 'disk.root.size', 'resource_id': 'd2249765-4c37-4e90-bbac-f12050d6e11d', 'counter_volume': '2', 'timestamp': '2014-05-08 20:23:48.028195', 'resource_metadata': {'instance_flavor_id': '1234', 'host': 'foo', 'display_name': 'myinstance', 'image_ref_url': 'imageref!'}, 'user_id': 'test_user', 'counter_type': 'gauge'}], True)
Fix proposed to branch: master /review. openstack. org/190262
Review: https:/