From 84b228410e3ad99fb2fe1becc9f59b87a47d9ea0 Mon Sep 17 00:00:00 2001 From: Nejc Saje Date: Wed, 3 Sep 2014 05:20:44 -0400 Subject: [PATCH] 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 7ff220fc5cb4dad616b27ea6762653054df00139) Conflicts: .testr.conf Change-Id: I08036b54def3eb496772bcf183927b9f70bb7a86 Closes-bug: #1365613 --- .testr.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.testr.conf b/.testr.conf index 38e8927a57..55e702bc15 100644 --- a/.testr.conf +++ b/.testr.conf @@ -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