1
1
"""Module describing the planemo ``test`` command."""
2
2
import click
3
-
3
+ from contextlib import ExitStack
4
4
from planemo import options
5
5
from planemo .cli import command_function
6
6
from planemo .engine .test import (
@@ -66,10 +66,13 @@ def cli(ctx, uris, **kwds):
66
66
against that same Galaxy root - but this may not be bullet proof yet so
67
67
please careful and do not try this against production Galaxy instances.
68
68
"""
69
- with temp_directory (dir = ctx .planemo_directory ) as temp_path :
69
+ with ExitStack () as stack :
70
+ if not kwds ["serve" ]:
71
+ temp_path = stack .enter_context (temp_directory (dir = ctx .planemo_directory ))
72
+ else :
73
+ temp_path = None
70
74
# Create temp dir(s) outside of temp, docker can't mount $TEMPDIR on OSX
71
75
runnables = for_runnable_identifiers (ctx , uris , kwds , temp_path = temp_path )
72
-
73
76
# pick a default engine type if needed
74
77
is_cwl = all (r .type in {RunnableType .cwl_tool , RunnableType .cwl_workflow } for r in runnables )
75
78
if kwds .get ("engine" , None ) is None :
@@ -79,7 +82,6 @@ def cli(ctx, uris, **kwds):
79
82
kwds ["engine" ] = "external_galaxy"
80
83
else :
81
84
kwds ["engine" ] = "galaxy"
82
-
83
85
return_value = test_runnables (ctx , runnables , original_paths = uris , ** kwds )
84
86
85
87
ctx .exit (return_value )
0 commit comments