Split and fix live db tests
With this commit, it's now possible to only run live tests (i.e. on real database) on certain backend. Typically, I don't have HBase installed, so now I can run the live tests against MongoDB and MySQL only very easily. Change-Id: I0e584b8243abc27ab9f027fdea17dc6c1192c62d Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
@@ -248,13 +248,8 @@ class Connection(base.Connection):
|
||||
LOG.info('connecting to MongoDB on %s:%s', opts['host'], opts['port'])
|
||||
|
||||
if opts['host'] == '__test__':
|
||||
live_tests = bool(int(os.environ.get('CEILOMETER_TEST_LIVE', 0)))
|
||||
if live_tests:
|
||||
url = os.environ.get('CEILOMETER_TEST_MONGO_URL')
|
||||
if not url:
|
||||
raise RuntimeError("CEILOMETER_TEST_LIVE is on, but "
|
||||
"CEILOMETER_TEST_MONGO_URL "
|
||||
"is not defined")
|
||||
url = os.environ.get('CEILOMETER_TEST_MONGODB_URL')
|
||||
if url:
|
||||
opts = self._parse_connection_url(url)
|
||||
self.conn = pymongo.Connection(opts['host'],
|
||||
opts['port'],
|
||||
|
Reference in New Issue
Block a user