Skip to content

Commit

Permalink
Implement --no_cleanup option for test & serve commands.
Browse files Browse the repository at this point in the history
Prevents deletion of temporary files created for/by Galaxy. Might be useful for debugging stuff (#80 (comment)) - probably would be a whole lot more useful for debugging if we also dropped a little shell script in that directory that allowed resuming Galaxy from that state.
  • Loading branch information
jmchilton committed Feb 22, 2015
1 parent 81f903d commit 2e41e0a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/commands/serve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ instances.
execute command with.
--install_galaxy Download and configure a disposable copy of
Galaxy from github.
--no_cleanup Do not cleanup temp files created for and by
Galaxy.
--test_data DIRECTORY test-data directory to for specified
tool(s).
--dependency_resolvers_config_file PATH
Expand Down
2 changes: 2 additions & 0 deletions docs/commands/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ please careful and do not try this against production Galaxy instances.
execute command with.
--install_galaxy Download and configure a disposable copy of
Galaxy from github.
--no_cleanup Do not cleanup temp files created for and by
Galaxy.
--test_data DIRECTORY test-data directory to for specified
tool(s).
--tool_data_table PATH tool_data_table_conf.xml file to for
Expand Down
2 changes: 2 additions & 0 deletions docs/commands/tool_factory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ http://www.ncbi.nlm.nih.gov/pubmed/23024011.
execute command with.
--install_galaxy Download and configure a disposable copy of
Galaxy from github.
--no_cleanup Do not cleanup temp files created for and by
Galaxy.
--test_data DIRECTORY test-data directory to for specified
tool(s).
--dependency_resolvers_config_file PATH
Expand Down
1 change: 1 addition & 0 deletions planemo/commands/cmd_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@options.optional_tools_arg()
@options.galaxy_root_option()
@options.install_galaxy_option()
@options.no_cleanup_option()
@options.test_data_option()
@options.dependency_resolvers_option()
@options.job_config_option()
Expand Down
1 change: 1 addition & 0 deletions planemo/commands/cmd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
)
@options.galaxy_root_option()
@options.install_galaxy_option()
@options.no_cleanup_option()
@options.test_data_option()
@options.tool_data_table_option()
@options.dependency_resolvers_option()
Expand Down
1 change: 1 addition & 0 deletions planemo/commands/cmd_tool_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@click.command('tool_factory')
@options.galaxy_root_option()
@options.install_galaxy_option()
@options.no_cleanup_option()
@options.test_data_option()
@options.dependency_resolvers_option()
@options.job_config_option()
Expand Down
3 changes: 2 additions & 1 deletion planemo/galaxy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ def config_join(*args):

yield GalaxyConfig(galaxy_root, config_directory, env, test_data_dir)
finally:
if created_config_directory:
cleanup = not kwds.get("no_cleanup", False)
if created_config_directory and cleanup:
shutil.rmtree(config_directory)


Expand Down
8 changes: 8 additions & 0 deletions planemo/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ def optional_project_arg(exists=True):
)


def no_cleanup_option():
return click.option(
"--no_cleanup",
is_flag=True,
help=("Do not cleanup temp files created for and by Galaxy.")
)


def docker_cmd_option():
return click.option(
'--docker_cmd',
Expand Down

0 comments on commit 2e41e0a

Please sign in to comment.