From 2632e05024f2e0e2b3dbb58fcc448a9eb50dc9d2 Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Wed, 18 Apr 2012 16:20:17 -0400 Subject: [PATCH] Add a running_functional_tests config setting. --- lib/galaxy/config.py | 1 + lib/galaxy/tool_shed/migrate/check.py | 3 +-- lib/galaxy/webapps/community/config.py | 1 + scripts/functional_tests.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index a66d0d9593b..9835291ba09 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -212,6 +212,7 @@ class Configuration( object ): amqp_config = {} for k, v in amqp_config: self.amqp[k] = v + self.running_functional_tests = string_as_bool( kwargs.get( 'running_functional_tests', False ) ) def __read_tool_job_config( self, global_conf_parser, section, key ): try: tool_runners_config = global_conf_parser.items( section ) diff --git a/lib/galaxy/tool_shed/migrate/check.py b/lib/galaxy/tool_shed/migrate/check.py index ce26e848bb4..2f883570787 100644 --- a/lib/galaxy/tool_shed/migrate/check.py +++ b/lib/galaxy/tool_shed/migrate/check.py @@ -21,7 +21,6 @@ dialect_to_egg = { def verify_tools( app, url, galaxy_config_file, engine_options={} ): # Check the value in the migrate_tools.version database table column to verify that the number is in # sync with the number of version scripts in ~/lib/galaxy/tools/migrate/versions. - running_functional_tests = galaxy_config_file.endswith( '.sample' ) dialect = ( url.split( ':', 1 ) )[0] try: egg = dialect_to_egg[ dialect ] @@ -55,7 +54,7 @@ def verify_tools( app, url, galaxy_config_file, engine_options={} ): config_arg = '' if os.path.abspath( os.path.join( os.getcwd(), 'universe_wsgi.ini' ) ) != galaxy_config_file: config_arg = ' -c %s' % galaxy_config_file.replace( os.path.abspath( os.getcwd() ), '.' ) - if not running_functional_tests: + if not app.config.running_functional_tests: # Automatically update the value of the migrate_tools.version database table column. cmd = 'sh manage_tools.sh%s upgrade' % config_arg proc = subprocess.Popen( args=cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) diff --git a/lib/galaxy/webapps/community/config.py b/lib/galaxy/webapps/community/config.py index 7fa507ff6b5..bfa31b51fc1 100644 --- a/lib/galaxy/webapps/community/config.py +++ b/lib/galaxy/webapps/community/config.py @@ -98,6 +98,7 @@ class Configuration( object ): self.global_conf_parser = global_conf_parser if global_conf and "__file__" in global_conf: global_conf_parser.read(global_conf['__file__']) + self.running_functional_tests = string_as_bool( kwargs.get( 'running_functional_tests', False ) ) def get( self, key, default ): return self.config_dict.get( key, default ) def get_bool( self, key, default ): diff --git a/scripts/functional_tests.py b/scripts/functional_tests.py index ba7b1a50452..5dedaa76a4b 100644 --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -275,6 +275,7 @@ def main(): library_import_dir = library_import_dir, user_library_import_dir = user_library_import_dir, global_conf = global_conf, + running_functional_tests=True, **kwargs ) log.info( "Embedded Universe application started" ) # ---- Run webserver ------------------------------------------------------