diff --git a/scripts/functional_tests.py b/scripts/functional_tests.py index 240f5c74e24..52d7bad0780 100644 --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -62,6 +62,7 @@ default_galaxy_test_port_min = 8000 default_galaxy_test_port_max = 9999 default_galaxy_locales = 'en' default_galaxy_test_file_dir = "test-data" +default_galaxy_master_key = "TEST123" migrated_tool_panel_config = 'migrated_tools_conf.xml' installed_tool_panel_configs = [ 'shed_tool_conf.xml' ] @@ -296,6 +297,7 @@ def main(): pass # ---- Build Application -------------------------------------------------- + master_api_key = os.environ.get( "GALAXY_TEST_MASTER_API_KEY", default_galaxy_master_key ) app = None if start_server: kwargs = dict( admin_users='test@bx.psu.edu', @@ -322,7 +324,9 @@ def main(): tool_parse_help=False, update_integrated_tool_panel=False, use_heartbeat=False, - user_library_import_dir=user_library_import_dir ) + user_library_import_dir=user_library_import_dir, + master_api_key=master_api_key, + ) if psu_production: kwargs[ 'global_conf' ] = None if not database_connection.startswith( 'sqlite://' ): @@ -418,7 +422,10 @@ def main(): def _run_functional_test( testing_shed_tools=None ): functional.test_toolbox.toolbox = app.toolbox - functional.test_toolbox.build_tests( testing_shed_tools=testing_shed_tools ) + functional.test_toolbox.build_tests( + testing_shed_tools=testing_shed_tools, + master_api_key=master_api_key, + ) test_config = nose.config.Config( env=os.environ, ignoreFiles=ignore_files, plugins=nose.plugins.manager.DefaultPluginManager() ) test_config.configure( sys.argv ) result = run_tests( test_config ) diff --git a/test/functional/test_toolbox.py b/test/functional/test_toolbox.py index f6e1be0e4fd..ba252e71619 100644 --- a/test/functional/test_toolbox.py +++ b/test/functional/test_toolbox.py @@ -191,7 +191,7 @@ class GalaxyInteractorTwill( object ): return expanded_inputs -def build_tests( testing_shed_tools=False ): +def build_tests( testing_shed_tools=False, master_api_key=None ): """ If the module level variable `toolbox` is set, generate `ToolTestCase` classes for all of its tests and put them into this modules globals() so @@ -226,6 +226,7 @@ def build_tests( testing_shed_tools=False ): test_method.__doc__ = "%s ( %s ) > %s" % ( tool.name, tool.id, testdef.name ) namespace[ 'test_tool_%06d' % j ] = test_method namespace[ 'shed_tool_id' ] = shed_tool_id + namespace[ 'master_api_key' ] = master_api_key # The new.classobj function returns a new class object, with name name, derived # from baseclasses (which should be a tuple of classes) and with namespace dict. new_class_obj = new.classobj( name, baseclasses, namespace )