Skip to content

Commit c26a788

Browse files
huzechmr-c
andauthored
--single-step can not get default value in step (#1598)
Co-authored-by: Michael R. Crusoe <[email protected]>
1 parent 95fa69d commit c26a788

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

cwltool/subgraph.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ def get_step(
216216

217217
for inport in cast(List[CWLObjectType], step["in"]):
218218
name = "#" + cast(str, inport["id"]).split("#")[-1].split("/")[-1]
219-
extracted["inputs"].append(CommentedMap({"id": name, "type": "Any"}))
219+
inp: CWLObjectType = {"id": name, "type": "Any"}
220+
if "default" in inport:
221+
inp["default"] = inport["default"]
222+
extracted["inputs"].append(CommentedMap(inp))
220223
inport["source"] = name
221224
if "linkMerge" in inport:
222225
del inport["linkMerge"]

tests/test_subgraph.py

+13
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,19 @@ def test_single_step_packed_subwf_step() -> None:
275275
)
276276

277277

278+
def test_single_with_step_level_default_value() -> None:
279+
"""Inherit step-level defaults with --single-step."""
280+
err_code, stdout, stderr = get_main_output(
281+
[
282+
"--single-step",
283+
"task2",
284+
get_data("tests/wf/cache_test_workflow.cwl"),
285+
]
286+
)
287+
assert err_code == 0
288+
assert "two" in stderr
289+
290+
278291
def test_print_targets_embedded_step() -> None:
279292
"""Confirm that --print-targets works when a Workflow has embedded Processes."""
280293
err_code, stdout, stderr = get_main_output(

0 commit comments

Comments
 (0)