Skip to content

Commit 9ab4a0d

Browse files
committed
Remove CWL conformance test code.
The conformance tests no longer need to be flagged in a special way and cwltool no longer implements this either.
1 parent 04238d3 commit 9ab4a0d

File tree

6 files changed

+12
-83
lines changed

6 files changed

+12
-83
lines changed

planemo/commands/cmd_run.py

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from planemo import options
99
from planemo.cli import command_function
1010
from planemo.engine import engine_context
11-
from planemo.io import conditionally_captured_io, warn
11+
from planemo.io import warn
1212
from planemo.tools import uri_to_path
1313

1414

@@ -18,7 +18,6 @@
1818
@options.galaxy_run_options()
1919
@options.galaxy_config_options()
2020
@options.galaxy_cwl_root_option()
21-
@options.cwl_conformance_test()
2221
@options.run_output_directory_option()
2322
@options.run_output_json_option()
2423
@options.engine_options()
@@ -29,32 +28,21 @@ def cli(ctx, uri, job_path, **kwds):
2928
\b
3029
% planemo run cat1-tool.cwl cat-job.json
3130
"""
32-
path = DEFAULT_TOOL_LOCATION_FETCHER.to_tool_path(uri)
31+
path = uri_to_path(ctx, uri)
3332
kwds["cwl"] = path.endswith(".cwl")
34-
conformance_test = kwds.get("conformance_test", False)
3533

36-
with conditionally_captured_io(conformance_test):
37-
with engine_context(ctx, **kwds) as engine:
38-
run_result = engine.run(path, job_path)
34+
with engine_context(ctx, **kwds) as engine:
35+
run_result = engine.run(path, job_path)
3936

4037
if not run_result.was_successful:
4138
warn("Run failed [%s]" % str(run_result))
4239
ctx.exit(1)
4340

44-
if conformance_test:
45-
if hasattr(run_result, "cwl_command_state"):
46-
command_state = run_result.cwl_command_state
47-
dumped_json = json.dumps(command_state)
48-
if hasattr(run_result, "galaxy_paths"):
49-
for (local_path, galaxy_path) in run_result.galaxy_paths:
50-
dumped_json = dumped_json.replace(galaxy_path, local_path)
51-
print(dumped_json)
52-
else:
53-
outputs_dict = run_result.outputs_dict
54-
print(outputs_dict)
55-
output_json = kwds.get("output_json", None)
56-
if output_json:
57-
with open(output_json, "w") as f:
58-
json.dump(outputs_dict, f)
41+
outputs_dict = run_result.outputs_dict
42+
print(outputs_dict)
43+
output_json = kwds.get("output_json", None)
44+
if output_json:
45+
with open(output_json, "w") as f:
46+
json.dump(outputs_dict, f)
5947

6048
return 0

planemo/cwl/run.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
class CwlToolRunResponse(SuccessfulRunResponse):
2626
"""Describe the resut of a cwltool invocation."""
2727

28-
def __init__(self, log, cwl_command_state=None, outputs=None):
28+
def __init__(self, log, outputs=None):
2929
self._log = log
30-
self._cwl_command_state = cwl_command_state
3130
self._outputs = outputs
3231

3332
@property
@@ -38,19 +37,8 @@ def log(self):
3837
def job_info(self):
3938
return None
4039

41-
@property
42-
def cwl_command_state(self):
43-
if self._cwl_command_state is None:
44-
message = "Can only call cwl_command_state if running conformance_test."
45-
raise NotImplementedError(message)
46-
47-
return self._cwl_command_state
48-
4940
@property
5041
def outputs_dict(self):
51-
if self._outputs is None:
52-
message = "Can not call outputs if running conformance_test."
53-
raise NotImplementedError(message)
5442
return self._outputs
5543

5644

@@ -59,9 +47,6 @@ def run_cwltool(ctx, path, job_path, **kwds):
5947
ensure_cwltool_available()
6048

6149
args = []
62-
conformance_test = kwds.get("conformance_test", False)
63-
if conformance_test:
64-
args.append("--conformance-test")
6550
if ctx.verbose:
6651
args.append("--verbose")
6752
output_directory = kwds.get("output_directory", None)
@@ -105,15 +90,9 @@ def run_cwltool(ctx, path, job_path, **kwds):
10590

10691
if ret_code != 0:
10792
return ErrorRunResponse("Error running cwltool", log=log)
108-
if conformance_test:
109-
cwl_command_state = result
110-
outputs = None
111-
else:
112-
cwl_command_state = None
113-
outputs = result
93+
outputs = result
11494
return CwlToolRunResponse(
11595
log,
116-
cwl_command_state=cwl_command_state,
11796
outputs=outputs,
11897
)
11998

planemo/galaxy/activity.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,6 @@ def job_info(self):
215215
)
216216
return None
217217

218-
@property
219-
def cwl_command_state(self):
220-
cwl_command_state = None
221-
if self._job_info is not None:
222-
cwl_command_state = self._job_info["cwl_command_state"]
223-
return cwl_command_state
224-
225218
@property
226219
def outputs_dict(self):
227220
return self._outputs_dict

planemo/options.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,6 @@ def run_output_json_option():
234234
)
235235

236236

237-
def cwl_conformance_test():
238-
return planemo_option(
239-
"--conformance_test",
240-
"--conformance-test",
241-
is_flag=True,
242-
help=("Generate CWL conformance test object describing job. "
243-
"Required by CWL conformance test suite and implemented "
244-
"by cwltool reference implementation."),
245-
)
246-
247-
248237
def no_dependency_resolution():
249238
return planemo_option(
250239
"--no_dependency_resolution",

planemo/runnable.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,6 @@ def was_successful(self):
385385
"""Return `True` to indicate this run was successful."""
386386
return True
387387

388-
@abc.abstractproperty
389-
def cwl_command_state(self):
390-
"""JSON result of command state for an execution."""
391-
392388
@abc.abstractproperty
393389
def outputs_dict(self):
394390
"""Return a dict of output descriptions."""

tests/test_run.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def test_run_cat_cwltool_more_options(self):
4545
"run",
4646
"--engine", "cwltool",
4747
"--no_container",
48-
"--conformance-test",
4948
tool_path,
5049
job_path,
5150
]
@@ -78,21 +77,6 @@ def test_run_cat(self):
7877
]
7978
self._check_exit_code(test_cmd)
8079

81-
# Conformance test option is deprecated in CWL land and obsecures errors.
82-
# @skip_unless_python_2_7()
83-
# @skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
84-
# def test_run_cat_conformance(self):
85-
# with self._isolate():
86-
# tool_path = _cwl_file("cat1-tool.cwl")
87-
# job_path = _cwl_file("cat-job.json")
88-
# test_cmd = [
89-
# "run",
90-
# "--conformance-test",
91-
# tool_path,
92-
# job_path,
93-
# ]
94-
# self._check_exit_code(test_cmd)
95-
9680
@skip_unless_python_2_7()
9781
@skip_if_environ("PLANEMO_SKIP_CWLTOOL_TESTS")
9882
@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")

0 commit comments

Comments
 (0)