##// END OF EJS Templates
Added option to swap the db connection uri based on ENV TEST_DB string
marcink -
r2560:380d6d86 beta
parent child Browse files
Show More
@@ -72,6 +72,10 b' def load_environment(global_conf, app_co'
72 config['pylons.strict_tmpl_context'] = True
72 config['pylons.strict_tmpl_context'] = True
73 test = os.path.split(config['__file__'])[-1] == 'test.ini'
73 test = os.path.split(config['__file__'])[-1] == 'test.ini'
74 if test:
74 if test:
75 if os.environ.get('TEST_DB'):
76 # swap config if we pass enviroment variable
77 config['sqlalchemy.db1.url'] = os.environ.get('TEST_DB')
78
75 from rhodecode.lib.utils import create_test_env, create_test_index
79 from rhodecode.lib.utils import create_test_env, create_test_index
76 from rhodecode.tests import TESTS_TMP_PATH
80 from rhodecode.tests import TESTS_TMP_PATH
77 create_test_env(TESTS_TMP_PATH, config)
81 create_test_env(TESTS_TMP_PATH, config)
@@ -80,7 +84,6 b' def load_environment(global_conf, app_co'
80 # MULTIPLE DB configs
84 # MULTIPLE DB configs
81 # Setup the SQLAlchemy database engine
85 # Setup the SQLAlchemy database engine
82 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
86 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
83
84 init_model(sa_engine_db1)
87 init_model(sa_engine_db1)
85
88
86 repos_path = make_ui('db').configitems('paths')[0][1]
89 repos_path = make_ui('db').configitems('paths')[0][1]
General Comments 0
You need to be logged in to leave comments. Login now