From fd46a1f987fe6c9fa95b62e9b21bc00273c36fe9 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sat, 26 Mar 2016 08:05:52 -0400 Subject: [PATCH] Move tool_conf logic for drivers into driver_util. - Don't generate a tool_conf for upload in tool shed tests - just use the fixed one setup for framework tools. - Move every mention of that directory and files into constants in driver_util. --- scripts/functional_tests.py | 9 ++++----- test/base/driver_util.py | 10 +++++++++- test/tool_shed/functional_tests.py | 12 +----------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/scripts/functional_tests.py b/scripts/functional_tests.py index 161bbc21746..d172c0c883e 100644 --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -95,25 +95,24 @@ def main(): testing_installed_tools = __check_arg( '-installed' ) datatypes_conf_override = None - framework_tool_dir = os.path.join('test', 'functional', 'tools') if testing_migrated_tools or testing_installed_tools: # Store a jsonified dictionary of tool_id : GALAXY_TEST_FILE_DIR pairs. galaxy_tool_shed_test_file = 'shed_tools_dict' # We need the upload tool for functional tests, so we'll create a temporary tool panel config that defines it. - tool_config_file = os.path.join( framework_tool_dir, 'upload_tool_conf.xml' ) + tool_config_file = driver_util.FRAMEWORK_UPLOAD_TOOL_CONF galaxy_test_file_dir = None library_import_dir = None user_library_import_dir = None else: framework_test = __check_arg( '-framework' ) # Run through suite of tests testing framework. if framework_test: - tool_conf = os.path.join( framework_tool_dir, 'samples_tool_conf.xml' ) - datatypes_conf_override = os.path.join( framework_tool_dir, 'sample_datatypes_conf.xml' ) + tool_conf = driver_util.FRAMEWORK_SAMPLE_TOOLS_CONF + datatypes_conf_override = driver_util.FRAMEWORK_DATATYPES_CONF else: # Use tool_conf.xml toolbox. tool_conf = None if __check_arg( '-with_framework_test_tools' ): - tool_conf = "%s,%s" % ( 'config/tool_conf.xml.sample', os.path.join( framework_tool_dir, 'samples_tool_conf.xml' ) ) + tool_conf = "%s,%s" % ( 'config/tool_conf.xml.sample', driver_util.FRAMEWORK_SAMPLE_TOOLS_CONF ) test_dir = default_galaxy_test_file_dir tool_config_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', tool_conf ) galaxy_test_file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR', test_dir ) diff --git a/test/base/driver_util.py b/test/base/driver_util.py index a6fcb73e5f0..b26f96cab42 100644 --- a/test/base/driver_util.py +++ b/test/base/driver_util.py @@ -24,7 +24,12 @@ from .nose_util import run from .instrument import StructuredTestDataPlugin galaxy_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)) -TOOL_SHED_TEST_DATA = os.path.join(galaxy_root, "test", "tool_shed", "test_data") +GALAXY_TEST_DIRECTORY = os.path.join(galaxy_root, "test") +TOOL_SHED_TEST_DATA = os.path.join(GALAXY_TEST_DIRECTORY, "tool_shed", "test_data") +FRAMEWORK_TOOLS_DIR = os.path.join(GALAXY_TEST_DIRECTORY, "functional", "tools") +FRAMEWORK_UPLOAD_TOOL_CONF = os.path.join(FRAMEWORK_TOOLS_DIR, "upload_tool_conf.xml") +FRAMEWORK_SAMPLE_TOOLS_CONF = os.path.join(FRAMEWORK_TOOLS_DIR, "samples_tool_conf.xml") +FRAMEWORK_DATATYPES_CONF = os.path.join(FRAMEWORK_TOOLS_DIR, "sample_datatypes_conf.xml") DEFAULT_LOCALES = "en" @@ -219,6 +224,9 @@ __all__ = [ "configure_environment", "copy_database_template", "build_logger", + "FRAMEWORK_UPLOAD_TOOL_CONF", + "FRAMEWORK_SAMPLE_TOOLS_CONF", + "FRAMEWORK_DATATYPES_CONF", "galaxy_database_conf", "get_webapp_global_conf", "nose_config_and_run", diff --git a/test/tool_shed/functional_tests.py b/test/tool_shed/functional_tests.py index 1f4d6cd44d3..7eb95d487f9 100644 --- a/test/tool_shed/functional_tests.py +++ b/test/tool_shed/functional_tests.py @@ -47,14 +47,6 @@ shed_tool_conf_xml_template = ''' ''' -tool_conf_xml = ''' - -
- -
-
-''' - tool_data_table_conf_xml_template = ''' @@ -84,7 +76,7 @@ def main(): shed_tool_data_table_conf_file = os.environ.get( 'TOOL_SHED_TEST_TOOL_DATA_TABLE_CONF', os.path.join( tool_shed_test_tmp_dir, 'shed_tool_data_table_conf.xml' ) ) galaxy_shed_data_manager_conf_file = os.environ.get( 'GALAXY_SHED_DATA_MANAGER_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_shed_data_manager_conf.xml' ) ) galaxy_tool_data_table_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_DATA_TABLE_CONF', os.path.join( tool_shed_test_tmp_dir, 'tool_data_table_conf.xml' ) ) - galaxy_tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_tool_conf.xml' ) ) + galaxy_tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', driver_util.FRAMEWORK_UPLOAD_TOOL_CONF ) galaxy_shed_tool_conf_file = os.environ.get( 'GALAXY_TEST_SHED_TOOL_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_shed_tool_conf.xml' ) ) galaxy_migrated_tool_conf_file = os.environ.get( 'GALAXY_TEST_MIGRATED_TOOL_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_migrated_tool_conf.xml' ) ) galaxy_tool_sheds_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_SHEDS_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_sheds_conf.xml' ) ) @@ -191,8 +183,6 @@ def main(): # ---- Optionally start up a Galaxy instance ------------------------------------------------------ if 'TOOL_SHED_TEST_OMIT_GALAXY' not in os.environ: - # Generate the tool_conf.xml file. - file( galaxy_tool_conf_file, 'w' ).write( tool_conf_xml ) # Generate the shed_tool_conf.xml file. tool_sheds_conf_template_parser = string.Template( tool_sheds_conf_xml_template ) tool_sheds_conf_xml = tool_sheds_conf_template_parser.safe_substitute( shed_url=tool_shed_test_host, shed_port=tool_shed_test_port )