tests: read config file if GABBI_LIVE is set
When making the tests not read the default configuration files, we actually broke the gating on Gabbi live tests. These tests need to read the configuration file that is set up by devstack in the gate, since it contains the configuration for the storage and indexer. Change-Id: I81e6c19c26b0eb07e34ed5ad9400b115b140709d
This commit is contained in:
parent
66b6fb6c2e
commit
3326fab10e
|
@ -76,12 +76,15 @@ class ConfigFixture(fixture.GabbiFixture):
|
|||
|
||||
data_tmp_dir = tempfile.mkdtemp(prefix='gnocchi')
|
||||
|
||||
if os.getenv("GABBI_LIVE"):
|
||||
dcf = None
|
||||
else:
|
||||
dcf = []
|
||||
default_opts = [('url',
|
||||
os.environ.get("GNOCCHI_TEST_INDEXER_URL", "null://"),
|
||||
'indexer')]
|
||||
|
||||
conf = service.prepare_service([], default_opts,
|
||||
default_config_files=[])
|
||||
default_config_files=dcf)
|
||||
|
||||
CONF = self.conf = conf
|
||||
self.tmp_dir = data_tmp_dir
|
||||
|
|
|
@ -44,5 +44,5 @@ def load_tests(loader, tests, pattern):
|
|||
host=parsed_url.hostname,
|
||||
port=port,
|
||||
prefix=prefix)
|
||||
elif os.getenv("GABBI_LIVE_FAIL_IF_NO_TEST"):
|
||||
elif os.getenv("GABBI_LIVE"):
|
||||
raise RuntimeError('"GNOCCHI_SERVICE_URL" is not set')
|
||||
|
|
Loading…
Reference in New Issue