Skip to content

Commit 2e41e0a

Browse files
committed
Implement --no_cleanup option for test & serve commands.
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.
1 parent 81f903d commit 2e41e0a

File tree

8 files changed

+19
-1
lines changed

8 files changed

+19
-1
lines changed

docs/commands/serve.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ instances.
3636
execute command with.
3737
--install_galaxy Download and configure a disposable copy of
3838
Galaxy from github.
39+
--no_cleanup Do not cleanup temp files created for and by
40+
Galaxy.
3941
--test_data DIRECTORY test-data directory to for specified
4042
tool(s).
4143
--dependency_resolvers_config_file PATH

docs/commands/test.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ please careful and do not try this against production Galaxy instances.
6161
execute command with.
6262
--install_galaxy Download and configure a disposable copy of
6363
Galaxy from github.
64+
--no_cleanup Do not cleanup temp files created for and by
65+
Galaxy.
6466
--test_data DIRECTORY test-data directory to for specified
6567
tool(s).
6668
--tool_data_table PATH tool_data_table_conf.xml file to for

docs/commands/tool_factory.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ http://www.ncbi.nlm.nih.gov/pubmed/23024011.
2626
execute command with.
2727
--install_galaxy Download and configure a disposable copy of
2828
Galaxy from github.
29+
--no_cleanup Do not cleanup temp files created for and by
30+
Galaxy.
2931
--test_data DIRECTORY test-data directory to for specified
3032
tool(s).
3133
--dependency_resolvers_config_file PATH

planemo/commands/cmd_serve.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@options.optional_tools_arg()
1010
@options.galaxy_root_option()
1111
@options.install_galaxy_option()
12+
@options.no_cleanup_option()
1213
@options.test_data_option()
1314
@options.dependency_resolvers_option()
1415
@options.job_config_option()

planemo/commands/cmd_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
)
8585
@options.galaxy_root_option()
8686
@options.install_galaxy_option()
87+
@options.no_cleanup_option()
8788
@options.test_data_option()
8889
@options.tool_data_table_option()
8990
@options.dependency_resolvers_option()

planemo/commands/cmd_tool_factory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@click.command('tool_factory')
1010
@options.galaxy_root_option()
1111
@options.install_galaxy_option()
12+
@options.no_cleanup_option()
1213
@options.test_data_option()
1314
@options.dependency_resolvers_option()
1415
@options.job_config_option()

planemo/galaxy_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ def config_join(*args):
200200

201201
yield GalaxyConfig(galaxy_root, config_directory, env, test_data_dir)
202202
finally:
203-
if created_config_directory:
203+
cleanup = not kwds.get("no_cleanup", False)
204+
if created_config_directory and cleanup:
204205
shutil.rmtree(config_directory)
205206

206207

planemo/options.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ def optional_project_arg(exists=True):
149149
)
150150

151151

152+
def no_cleanup_option():
153+
return click.option(
154+
"--no_cleanup",
155+
is_flag=True,
156+
help=("Do not cleanup temp files created for and by Galaxy.")
157+
)
158+
159+
152160
def docker_cmd_option():
153161
return click.option(
154162
'--docker_cmd',

0 commit comments

Comments
 (0)