diff --git a/config/galaxy.yml.sample b/config/galaxy.yml.sample index fc32566c8fe..6112840f1d7 100644 --- a/config/galaxy.yml.sample +++ b/config/galaxy.yml.sample @@ -1167,6 +1167,15 @@ galaxy: # Set maximum size of ngrams #tool_ngram_maxsize: 4 + # Set tool test data directory. The test framework sets this value to + # 'test-data,https://github.com/galaxyproject/galaxy-test-data.git' + # which will cause Galaxy to clone down extra test data on the fly for + # certain tools distributed with Galaxy but this is likely not + # appropriate for production systems. Instead one can simply clone + # that repository directly and specify a path here instead of a Git + # HTTP repository. + #tool_test_data_directories: test-data + # Galaxy encodes various internal values when these values will be # output in some format (for example, in a URL or cookie). You should # set a key to be used by the algorithm that encodes and decodes these diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index efe3b610d7e..adb91a41fff 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -2439,6 +2439,22 @@ :Type: int +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``tool_test_data_directories`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:Description: + Set tool test data directory. The test framework sets this value + to 'test-data,https://github.com/galaxyproject/galaxy-test- + data.git' which will cause Galaxy to clone down extra test data on + the fly for certain tools distributed with Galaxy but this is + likely not appropriate for production systems. Instead one can + simply clone that repository directly and specify a path here + instead of a Git HTTP repository. +:Default: ``test-data`` +:Type: str + + ~~~~~~~~~~~~~ ``id_secret`` ~~~~~~~~~~~~~ diff --git a/lib/galaxy/app.py b/lib/galaxy/app.py index 08abfded843..9522aab6945 100644 --- a/lib/galaxy/app.py +++ b/lib/galaxy/app.py @@ -95,7 +95,7 @@ class UniverseApplication(config.ConfiguresGalaxyMixin): self.dataset_collections_service = DatasetCollectionManager(self) self.history_manager = HistoryManager(self) self.dependency_resolvers_view = DependencyResolversView(self) - self.test_data_resolver = test_data.TestDataResolver() + self.test_data_resolver = test_data.TestDataResolver(file_dirs=getattr(self.config, "tool_test_data_directories", None)) # Tool Data Tables self._configure_tool_data_tables(from_shed_config=False) diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index 0e3a1d74009..bd0ba551975 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -462,6 +462,8 @@ class Configuration(object): self.tool_enable_ngram_search = kwargs.get("tool_enable_ngram_search", False) self.tool_ngram_minsize = kwargs.get("tool_ngram_minsize", 3) self.tool_ngram_maxsize = kwargs.get("tool_ngram_maxsize", 4) + default_tool_test_data_directories = os.environ.get("GALAXY_TEST_FILE_DIR", resolve_path("test-data", self.root)) + self.tool_test_data_directories = kwargs.get("tool_test_data_directories", default_tool_test_data_directories) # Location for tool dependencies. use_tool_dependencies, tool_dependency_dir, use_cached_dependency_manager, tool_dependency_cache_dir, precache_dependencies = \ parse_dependency_options(kwargs, self.root, self.dependency_resolvers_config_file) diff --git a/lib/galaxy/tools/verify/test_data.py b/lib/galaxy/tools/verify/test_data.py index de6e9ceb8f2..13d0ba4b724 100644 --- a/lib/galaxy/tools/verify/test_data.py +++ b/lib/galaxy/tools/verify/test_data.py @@ -27,8 +27,9 @@ LIST_SEP = re.compile("\s*,\s*") class TestDataResolver(object): - def __init__(self, env_var='GALAXY_TEST_FILE_DIR', environ=os.environ): - file_dirs = environ.get(env_var, None) + def __init__(self, file_dirs=None, env_var='GALAXY_TEST_FILE_DIR', environ=os.environ): + if file_dirs is None: + file_dirs = environ.get(env_var, None) if file_dirs is None: file_dirs = "test-data,https://github.com/galaxyproject/galaxy-test-data.git" if file_dirs: diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml index e38430d682d..97819d70d2b 100644 --- a/lib/galaxy/webapps/galaxy/config_schema.yml +++ b/lib/galaxy/webapps/galaxy/config_schema.yml @@ -1817,6 +1817,18 @@ mapping: desc: | Set maximum size of ngrams + tool_test_data_directories: + type: str + default: 'test-data' + required: false + desc: | + Set tool test data directory. The test framework sets this value to + 'test-data,https://github.com/galaxyproject/galaxy-test-data.git' which will + cause Galaxy to clone down extra test data on the fly for certain tools + distributed with Galaxy but this is likely not appropriate for production systems. + Instead one can simply clone that repository directly and specify a path here + instead of a Git HTTP repository. + id_secret: type: str default: USING THE DEFAULT IS NOT SECURE!