Fix tests with testtools>=0.9.39

NOTE: the RPC module that was causing problems in Icehouse no longer
exists in master, but the fix should be in the master as well to avoid
future problems.

'rpc_backend' config option in
ceilometer.openstack.common.rpc.__init__.py defaults to
'%s.impl_kombu' % __package__. Because the RPC module is imported
in some other files as ceilometer.openstack.common.rpc, rpc_backend
is set to 'ceilometer.openstack.common.rpc.impl_kombu'. But when
the test loader tries to import the RPC module as openstack.common.rpc
(since it is starting inside the ceilometer folder), registering the
option fails, because we try to register a different default value.

The issue surfaced because testtools==0.9.39 started checking __init__.py
files as well. It is fixed by passing a top-level directory parameter to
the test discovery process.

(cherry picked from commit 7ff220fc5c)

Conflicts:
	.testr.conf

Change-Id: I08036b54def3eb496772bcf183927b9f70bb7a86
Closes-bug: #1365613
This commit is contained in:
Nejc Saje 2014-09-03 05:20:44 -04:00
parent fcc6b0de4e
commit 84b228410e
1 changed files with 1 additions and 1 deletions

View File

@ -2,6 +2,6 @@
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-600} \
${PYTHON:-python} -m subunit.run discover ceilometer $LISTOPT $IDOPTION
${PYTHON:-python} -m subunit.run discover ceilometer -t . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list