Merge "Do not use system config file for test"
This commit is contained in:
commit
64e46b5840
@ -91,7 +91,7 @@ CLI_OPTS = [
|
||||
]
|
||||
|
||||
|
||||
def prepare_service(argv=None):
|
||||
def prepare_service(argv=None, config_files=None):
|
||||
conf = cfg.ConfigOpts()
|
||||
oslo_i18n.enable_lazy()
|
||||
log.register_options(conf)
|
||||
@ -106,7 +106,8 @@ def prepare_service(argv=None):
|
||||
conf.register_opts(list(options),
|
||||
group=None if group == "DEFAULT" else group)
|
||||
|
||||
conf(argv, project='aodh', validate_default_values=True)
|
||||
conf(argv, project='aodh', validate_default_values=True,
|
||||
default_config_files=config_files)
|
||||
log.setup(conf, 'aodh')
|
||||
messaging.setup()
|
||||
return conf
|
||||
|
@ -35,7 +35,7 @@ class FunctionalTest(db_test_base.TestBase):
|
||||
|
||||
def setUp(self):
|
||||
super(FunctionalTest, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
self.setup_messaging(self.CONF)
|
||||
|
||||
|
@ -28,7 +28,7 @@ class TestApp(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestApp, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
|
||||
def test_api_paste_file_not_exist(self):
|
||||
|
@ -145,7 +145,7 @@ class TestBase(testscenarios.testcase.WithScenarios, test_base.BaseTestCase):
|
||||
raise testcase.TestSkipped(
|
||||
'Test is not applicable for %s' % engine)
|
||||
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
self.CONF.set_override('connection', self.db_url, group="database")
|
||||
|
||||
|
@ -52,7 +52,7 @@ class ConfigFixture(fixture.GabbiFixture):
|
||||
if db_url is None:
|
||||
raise case.SkipTest('No database connection configured')
|
||||
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
# NOTE(jd): prepare_service() is called twice: first by load_app() for
|
||||
# Pecan, then Pecan calls pastedeploy, which starts the app, which has
|
||||
# no way to pass the conf object so that Paste apps calls again
|
||||
|
@ -30,7 +30,7 @@ import six
|
||||
class EngineTest(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(EngineTest, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
|
||||
def test_get_connection(self):
|
||||
@ -52,7 +52,7 @@ class EngineTest(base.BaseTestCase):
|
||||
class ConnectionRetryTest(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(ConnectionRetryTest, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
|
||||
def test_retries(self):
|
||||
@ -81,7 +81,7 @@ class ConnectionRetryTest(base.BaseTestCase):
|
||||
class ConnectionConfigTest(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(ConnectionConfigTest, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
|
||||
def test_only_default_url(self):
|
||||
|
@ -24,7 +24,7 @@ from aodh import service
|
||||
class TestEvaluatorBase(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestEvaluatorBase, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.conf = self.useFixture(fixture.Config(conf)).conf
|
||||
self.api_client = mock.Mock()
|
||||
self.useFixture(mockpatch.Patch('ceilometerclient.client.get_client',
|
||||
|
@ -109,7 +109,7 @@ class TestPartitioning(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPartitioning, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
self.shared_storage = {}
|
||||
|
||||
|
@ -26,7 +26,7 @@ from aodh.tests import base as tests_base
|
||||
class TestAlarmEvaluationService(tests_base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestAlarmEvaluationService, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
self.setup_messaging(self.CONF)
|
||||
|
||||
|
@ -28,7 +28,7 @@ class TestEventAlarmEvaluationService(tests_base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestEventAlarmEvaluationService, self).setUp()
|
||||
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
self.storage_conn = mock.MagicMock()
|
||||
self.setup_messaging(self.CONF)
|
||||
|
@ -45,7 +45,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestAlarmNotifier, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
self.setup_messaging(self.CONF)
|
||||
self.service = notifier.AlarmNotifierService(self.CONF)
|
||||
|
@ -47,7 +47,7 @@ class FakeNotifier(object):
|
||||
class TestRPCAlarmNotifier(tests_base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestRPCAlarmNotifier, self).setUp()
|
||||
conf = service.prepare_service([])
|
||||
conf = service.prepare_service(argv=[], config_files=[])
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
self.setup_messaging(self.CONF)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user