Skip to content

Commit 892da7e

Browse files
committed
Added other tests on default value
1 parent 6ff1ef2 commit 892da7e

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

conformance_tests.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,20 @@
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: {"o": [
1806+
{
1807+
"checksum": "sha1$4bb9bb2748a4380f12c039a9c2268115b816a6de",
1808+
},
1809+
{
1810+
"checksum": "sha1$cf42ecac010c90a72257a573a5ce7efb7d6f0e08",
1811+
}
1812+
]}
1813+
tool: tests/scatter-defaults.cwl
1814+
id: scatter_all_input_defaults
1815+
doc: Test workflow scatter with single scatter parameter and two default inputs
1816+
tags: [ scatter, workflow ]
1817+
18041818
- job: tests/bwa-mem-job.json
18051819
output:
18061820
out1: [ "foo 1", "foo 2", "foo 3", "foo 4"]

tests/loop/default-stepinput-loop.cwl

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

0 commit comments

Comments
 (0)