Skip to content

Commit 6228fa6

Browse files
authored
Additional tests on default value at the WorkflowStep level
1 parent 41c679d commit 6228fa6

File tree

5 files changed

+140
-0
lines changed

5 files changed

+140
-0
lines changed

conformance_tests.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,30 @@
18011801
doc: Test workflow scatter with single scatter parameter and two valueFrom using $inputs (first and current el)
18021802
tags: [ scatter, step_input, workflow ]
18031803

1804+
- job: tests/empty.json
1805+
output: {"result": [
1806+
{
1807+
"class": "File",
1808+
"checksum": "sha1$4bb9bb2748a4380f12c039a9c2268115b816a6de",
1809+
},
1810+
{
1811+
"class": "File",
1812+
"checksum": "sha1$cf42ecac010c90a72257a573a5ce7efb7d6f0e08",
1813+
}
1814+
]}
1815+
tool: tests/scatter-defaults.cwl
1816+
id: scatter_all_input_defaults
1817+
doc: Test workflow scatter with single scatter parameter and two default inputs
1818+
tags: [ scatter, workflow ]
1819+
1820+
- job: tests/bwa-mem-job.json
1821+
output:
1822+
out1: [ "foo 1", "foo 2", "foo 3", "foo 4"]
1823+
tool: tests/scatter-valuefrom-default.cwl
1824+
id: wf_scatter_valuefrom_default
1825+
doc: Test workflow scatter with single scatter parameter, a valueFrom in the WorkflowStep and a default value inside the step
1826+
tags: [ scatter, step_input, workflow ]
1827+
18041828
- job: tests/import_schema-def_job.yml
18051829
output:
18061830
output_bam:
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.3.0-dev1
3+
class: Workflow
4+
requirements:
5+
InlineJavascriptRequirement: {}
6+
ScatterFeatureRequirement: {}
7+
StepInputExpressionRequirement: {}
8+
SubworkflowFeatureRequirement: {}
9+
inputs: []
10+
outputs:
11+
o1:
12+
type: int[]
13+
outputSource: loop/o1
14+
pickValue: all_non_null
15+
steps:
16+
loop:
17+
when: $(inputs.i1 < 20)
18+
loop:
19+
i1:
20+
valueFrom: $(inputs.i1 + 5)
21+
outputMethod: all_iterations
22+
run:
23+
class: Workflow
24+
inputs:
25+
i1: int
26+
outputs:
27+
o1:
28+
type: int?
29+
outputSource: big_values/o1
30+
steps:
31+
big_values:
32+
when: $(inputs.i1 >= 5)
33+
run:
34+
class: ExpressionTool
35+
inputs:
36+
i1: int
37+
outputs:
38+
o1: int
39+
expression: >
40+
${return {'o1': inputs.i1 + 3};}
41+
in:
42+
i1: i1
43+
out: [ o1 ]
44+
in:
45+
i1:
46+
default: 5
47+
out: [ o1 ]

tests/loop/test-index.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,12 @@
107107
o1: [8, 11, 14, 17, 20]
108108
doc: "Test a loop whose source has a default value"
109109
tags: [ conditional, loop, inline_javascript, scatter, workflow ]
110+
111+
- job: single-var-loop-job.yml
112+
tool: default-stepinput-loop.cwl
113+
id: loop_default_stepinput
114+
output:
115+
o1: [8, 13, 18]
116+
doc: "Test a loop whose source has a default value updated by a valueFrom directive"
117+
tags: [ conditional, loop, inline_javascript, scatter, workflow ]
118+

tests/scatter-defaults.cwl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class: Workflow
2+
cwlVersion: v1.3.0-dev1
3+
4+
requirements:
5+
ScatterFeatureRequirement: {}
6+
SubworkflowFeatureRequirement: {}
7+
8+
inputs: []
9+
outputs:
10+
result:
11+
type: File[]
12+
outputSource: step1/result
13+
14+
steps:
15+
step1:
16+
run: floats_small_and_large_nojs.cwl
17+
in:
18+
annotation_prokka_evalue:
19+
default: [0.1, 0.2]
20+
out: [ result ]
21+
scatter: annotation_prokka_evalue
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
class: Workflow
2+
cwlVersion: v1.3.0-dev1
3+
4+
requirements:
5+
StepInputExpressionRequirement: {}
6+
SubworkflowFeatureRequirement: {}
7+
ScatterFeatureRequirement: {}
8+
InlineJavascriptRequirement: {}
9+
10+
inputs:
11+
min_std_max_min: int[]
12+
13+
outputs:
14+
out1:
15+
type: string[]
16+
outputSource: step1/out1
17+
18+
steps:
19+
step1:
20+
run:
21+
class: Workflow
22+
inputs:
23+
value: int
24+
outputs:
25+
out1:
26+
type: string
27+
outputSource: step2/out1
28+
steps:
29+
step2:
30+
run: conditionals/cond-wf-003_nojs.cwl
31+
in:
32+
val: value
33+
test:
34+
valueFrom: "$(true)"
35+
out: [ out1 ]
36+
scatter: value
37+
in:
38+
value: min_std_max_min
39+
out: [out1]

0 commit comments

Comments
 (0)