Permalink
Browse files

Add --extra_tools option to serve.

Once Galaxy will be able to "serve" workflows - this will be useful for specifying the location of extra tools.
  • Loading branch information...
jmchilton committed Apr 27, 2016
1 parent 0c67ad6 commit 02a08a0f0eee44ceb888f79768cbd8af961d7b5e
Showing with 33 additions and 1 deletion.
  1. +2 −1 planemo/galaxy/config.py
  2. +15 −0 planemo/options.py
  3. +16 −0 tests/test_cmd_serve.py
@@ -171,7 +171,8 @@ def config_join(*args):
_ensure_directory(tool_dependency_dir)

shed_tool_conf = kwds.get("shed_tool_conf") or config_join("shed_tools_conf.xml")
tool_definition = _tool_conf_entry_for(tool_paths)
all_tool_paths = list(tool_paths) + list(kwds.get("extra_tools", []))
tool_definition = _tool_conf_entry_for(all_tool_paths)
empty_tool_conf = config_join("empty_tool_conf.xml")

tool_conf = config_join("tool_conf.xml")
@@ -38,6 +38,20 @@ def test_data_option():
)


def extra_tools_option():
return planemo_option(
"--extra_tools",
type=click.Path(exists=True,
file_okay=True,
dir_okay=True,
resolve_path=True),
multiple=True,
help=("Extra tool sources to include in Galaxy's tool panel (file or "
"directory). These will not be linted/tested/etc... but they "
"will be available to workflows and for interactive use.")
)


def tool_data_table_option():
return planemo_option(
"--tool_data_table",
@@ -766,6 +780,7 @@ def galaxy_serve_options():
return _compose(
galaxy_run_options(),
galaxy_config_options(),
extra_tools_option(),
daemon_option(),
pid_file_option(),
)
@@ -11,6 +11,7 @@
CliTestCase,
skip_if_environ,
TEST_REPOS_DIR,
PROJECT_TEMPLATES_DIR,
)

TEST_HISTORY_NAME = "Cool History 42"
@@ -37,6 +38,21 @@ def test_serve_daemon(self):
assert len(user_gi.histories.get_histories(name=TEST_HISTORY_NAME)) == 0
user_gi.histories.create_history(TEST_HISTORY_NAME)

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_serve_extra_tools(self):
port = network_util.get_free_port()
pid_file = os.path.join(self._home, "test.pid")
random_lines = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "randomlines.xml")
extra_args = ["--daemon", "--pid_file", pid_file, "--extra_tools", random_lines]
serve = functools.partial(self._run, port, extra_args)
self._launch_thread_and_wait(serve, port)
admin_gi = api.gi(port)
user_api_key = api.user_api_key(admin_gi)
user_gi = api.gi(port, user_api_key)
assert len(user_gi.histories.get_histories(name=TEST_HISTORY_NAME)) == 0
user_gi.histories.create_history(TEST_HISTORY_NAME)
assert user_gi.tools.get_tools(tool_id="random_lines1")

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_serve_profile(self):
port = network_util.get_free_port()

0 comments on commit 02a08a0

Please sign in to comment.