fix server_env saved output dir name; clean up prev. debugging statements

This commit is contained in:
Carl Eberhard
2013-03-01 12:49:08 -05:00
parent ee10eed481
commit 2337695990
3 changed files with 17 additions and 14 deletions
-2
View File
@@ -45,8 +45,6 @@ class UniverseApplication( object ):
self.tool_shed_registry = tool_shed.tool_shed_registry.Registry( self.config.root, self.config.tool_sheds_config )
else:
self.tool_shed_registry = None
log.debug( 'self.config.tool_sheds_config: %s, self.tool_shed_registry: %s',
self.config.tool_sheds_config, self.tool_shed_registry )
# Initialize database / check for appropriate schema version. # If this
# is a new installation, we'll restrict the tool migration messaging.
from galaxy.model.migrate.check import create_or_verify_database
-2
View File
@@ -42,7 +42,6 @@ import nose.config
import nose.loader
import nose.plugins.manager
import pprint
log = logging.getLogger( "functional_tests.py" )
default_galaxy_test_host = "localhost"
@@ -227,7 +226,6 @@ def main():
kwargs[ 'object_store' ] = 'distributed'
kwargs[ 'distributed_object_store_config_file' ] = 'distributed_object_store_conf.xml.sample'
# Build the Universe Application
print 'app.kwargs:\n%s' %( pprint.pformat( kwargs ) )
app = UniverseApplication( job_queue_workers = 5,
id_secret = 'changethisinproductiontoo',
template_path = "templates",
+17 -10
View File
@@ -29,6 +29,9 @@ class TestEnvironment( object ):
@classmethod
def instance( cls, config=None ):
"""Returns the singleton of TestEnvironment, instantiating it first if it
does not yet exist.
"""
# singleton pattern
if( ( not cls._instance )
or ( config ) ):
@@ -36,25 +39,26 @@ class TestEnvironment( object ):
cls._instance = cls( config )
return cls._instance
@classmethod
def get_server_url( cls ):
return cls.instance().url
def __init__( self, env_config_dict=None ):
self.config = env_config_dict or {}
self.protocol = self._get_setting_from_config_or_env( 'protocol', self.ENV_PROTOCOL, self.DEFAULT_PROTOCOL )
self.host = self._get_setting_from_config_or_env( 'host', self.ENV_HOST, self.DEFAULT_HOST )
self.port = self._get_setting_from_config_or_env( 'port', self.ENV_PORT, self.DEFAULT_PORT )
self.protocol = self._get_setting_from_config_or_env(
'protocol', self.ENV_PROTOCOL, self.DEFAULT_PROTOCOL )
self.host = self._get_setting_from_config_or_env(
'host', self.ENV_HOST, self.DEFAULT_HOST )
self.port = self._get_setting_from_config_or_env(
'port', self.ENV_PORT, self.DEFAULT_PORT )
self.history_id = self._get_setting_from_config_or_env( 'history_id', self.ENV_HISTORY_ID, default=None )
self.file_dir = self._get_setting_from_config_or_env( 'file_dir', self.ENV_FILE_DIR, default=None )
self.history_id = self._get_setting_from_config_or_env(
'history_id', self.ENV_HISTORY_ID, default=None )
self.file_dir = self._get_setting_from_config_or_env(
'file_dir', self.ENV_FILE_DIR, default=None )
self.tool_shed_test_file = self._get_setting_from_config_or_env(
'tool_shed_test_file', self.ENV_TOOL_SHED_TEST_FILE, default=None )
self.shed_tools_dict = self._get_shed_tools_dict()
self.keepOutdir = self._get_setting_from_config_or_env(
self.saved_output_dir = self._get_setting_from_config_or_env(
'saved_output_dir', self.ENV_SAVED_FILES_DIR, default=None )
self._init_saved_files_dir()
@@ -62,6 +66,7 @@ class TestEnvironment( object ):
"""Try to get a setting from (in order):
TestEnvironment.config, the os env, or some default (if not False).
"""
#TODO: if falsy value needed, use None - not ideal
config = self.config.get( config_name, None )
env = os.environ.get( env_name, None )
if( ( not ( config or env ) )
@@ -94,6 +99,8 @@ class TestEnvironment( object ):
@property
def url( self ):
"""Builds and returns the url of the test server.
"""
url = '%s://%s' %( self.protocol, self.host )
if self.port and self.port != 80:
url += ':%s' %( str( self.port ) )