Makes default test repo configurable via engine config. Sets config file default to 'cloudroast'
Change-Id: Ie14c26b35abe7405ee9b2bb318d1be96b08865cb
This commit is contained in:
parent
2f3202cf99
commit
b2f23857a7
|
@ -33,8 +33,20 @@ from cafe.drivers.unittest.fixtures import BaseTestFixture
|
||||||
from cafe.common.reporting.cclogging import log_results
|
from cafe.common.reporting.cclogging import log_results
|
||||||
from cafe.drivers.unittest.parsers import SummarizeResults
|
from cafe.drivers.unittest.parsers import SummarizeResults
|
||||||
|
|
||||||
"""@todo: This needs to be configurable/dealt with by the install """
|
from cafe.drivers.unittest.decorators import \
|
||||||
import test_repo
|
TAGS_DECORATOR_TAG_LIST_NAME, TAGS_DECORATOR_ATTR_DICT_NAME
|
||||||
|
from cafe.engine.config import EngineConfig
|
||||||
|
|
||||||
|
engine_config = EngineConfig()
|
||||||
|
test_repo = None
|
||||||
|
try:
|
||||||
|
test_repo = __import__(engine_config.default_test_repo)
|
||||||
|
except Exception as exception:
|
||||||
|
sys.stderr.write(
|
||||||
|
"Unable to find '{0}' test repo package. Is it installed?"
|
||||||
|
.format(engine_config.default_test_repo))
|
||||||
|
raise exception
|
||||||
|
|
||||||
|
|
||||||
# Default Config Options
|
# Default Config Options
|
||||||
if platform.system().lower() == "windows":
|
if platform.system().lower() == "windows":
|
||||||
|
|
|
@ -130,3 +130,9 @@ class EngineConfig(object):
|
||||||
@property
|
@property
|
||||||
def use_verbose_logging(self):
|
def use_verbose_logging(self):
|
||||||
return self.get_boolean("use_verbose_logging", False)
|
return self.get_boolean("use_verbose_logging", False)
|
||||||
|
|
||||||
|
#Used by the engine to facilitate using multiple test repositories.
|
||||||
|
@property
|
||||||
|
def default_test_repo(self):
|
||||||
|
return self.get_raw("default_test_repo")
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -80,6 +80,7 @@ data_dir = "{0}/data".format(root_dir)
|
||||||
temp_dir = "{0}/temp".format(root_dir)
|
temp_dir = "{0}/temp".format(root_dir)
|
||||||
config_dir = "{0}/configs".format(root_dir)
|
config_dir = "{0}/configs".format(root_dir)
|
||||||
use_verbose_logging = "False"
|
use_verbose_logging = "False"
|
||||||
|
default_test_repo = "cloudroast"
|
||||||
|
|
||||||
# Copy over the default configurations
|
# Copy over the default configurations
|
||||||
if(os.path.exists("~install")):
|
if(os.path.exists("~install")):
|
||||||
|
@ -143,6 +144,7 @@ else:
|
||||||
config.write("data_directory={0}\n".format(data_dir))
|
config.write("data_directory={0}\n".format(data_dir))
|
||||||
config.write("temp_directory={0}\n".format(temp_dir))
|
config.write("temp_directory={0}\n".format(temp_dir))
|
||||||
config.write("use_verbose_logging={0}\n".format(use_verbose_logging))
|
config.write("use_verbose_logging={0}\n".format(use_verbose_logging))
|
||||||
|
config.write("default_test_repo={0}\n".format(default_test_repo))
|
||||||
config.close()
|
config.close()
|
||||||
|
|
||||||
if platform.system().lower() != 'windows':
|
if platform.system().lower() != 'windows':
|
||||||
|
|
Loading…
Reference in New Issue