Skip to content

Commit

Permalink
Merge pull request #1373 from nsoranzo/fix_test_run_gxtool_randomlines
Browse files Browse the repository at this point in the history
Fix ``test_run_gxtool_randomlines`` test on Galaxy dev branch
  • Loading branch information
mvdbeek committed Jun 21, 2023
2 parents 2abf1a2 + 6b2e31d commit c017ef6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions planemo/galaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@
</job_metrics>
"""

FILE_SOURCES_TEMPLATE = """
- type: posix
root: '${test_data_dir}'
id: test_data_dir
label: Test data directory
doc: Test data directory for the runnables being tested
"""

TOOL_SHEDS_CONF = """<tool_sheds>
<tool_shed name="Target Shed" url="${shed_target_url}" />
</tool_sheds>
Expand Down Expand Up @@ -362,6 +370,7 @@ def config_join(*args):
all_tool_paths = _all_tool_paths(runnables, galaxy_root=galaxy_root, extra_tools=kwds.get("extra_tools"))
_handle_job_config_file(config_directory, server_name, test_data_dir, all_tool_paths, kwds)
_handle_job_metrics(config_directory, kwds)
_handle_file_sources(config_directory, test_data_dir, kwds)
_handle_refgenie_config(config_directory, galaxy_root, kwds)
file_path = kwds.get("file_path") or config_join("files")
_ensure_directory(file_path)
Expand Down Expand Up @@ -1384,6 +1393,13 @@ def _handle_job_metrics(config_directory, kwds):
kwds["job_metrics_config_file"] = metrics_conf


def _handle_file_sources(config_directory, test_data_dir, kwds):
file_sources_conf = os.path.join(config_directory, "file_sources_conf.yml")
file_sources_conf_contents = _sub(FILE_SOURCES_TEMPLATE, {"test_data_dir": test_data_dir})
write_file(file_sources_conf, file_sources_conf_contents)
kwds["file_sources_config_file"] = file_sources_conf


def _handle_refgenie_config(config_directory, galaxy_root, kwds):
refgenie_dir = os.path.join(config_directory, "refgenie")
_ensure_directory(refgenie_dir)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def test_run_gxtool_randomlines(self):
"--no_dependency_resolution",
"--galaxy_branch",
target_galaxy_branch(),
"--test_data",
TEST_DATA_DIR,
tool_path,
job_path,
]
Expand Down

0 comments on commit c017ef6

Please sign in to comment.