Skip to content

Commit 01f2ee6

Browse files
committed
test for parameter references in CommandLineTool.arguments
Fixes: common-workflow-language/common-workflow-language#706
1 parent df6fd28 commit 01f2ee6

File tree

5 files changed

+156
-0
lines changed

5 files changed

+156
-0
lines changed

conformance_tests.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3481,3 +3481,47 @@
34813481
output:
34823482
their_name: "Foo Bar"
34833483
tags: [ require, command_line_tool ]
3484+
3485+
- id: paramref_arguments_runtime
3486+
job: tests/empty.json
3487+
tool: tests/paramref_arguments_runtime.cwl
3488+
doc: confirm that $runtime is available to parameter references in arguments
3489+
tags: [ required, command_line_tool ]
3490+
output:
3491+
runtime:
3492+
cores: Any
3493+
outdir: Any
3494+
outdirSize: Any
3495+
ram: Any
3496+
tmpdir: Any
3497+
tmpdirSize: Any
3498+
3499+
- id: paramref_arguments_self
3500+
tool: tests/paramref_arguments_self.cwl
3501+
job: tests/empty.json
3502+
doc: confirm that $self is available and set to null in arguments
3503+
tags: [ required, command_line_tool ]
3504+
output:
3505+
self: null
3506+
3507+
- id: paramref_arguments_inputs
3508+
job: tests/empty.json
3509+
tool: tests/paramref_arguments_inputs.cwl
3510+
doc: confirm that $inputs is available to parameter references in arguments
3511+
tags: [ required, command_line_tool ]
3512+
output:
3513+
result:
3514+
a_double: 1000000000000000000000000000000000000000000
3515+
a_float: 4.2
3516+
a_long: 4147483647
3517+
a_string: z
3518+
a_string_array: [ a, b, c ]
3519+
a_true: true
3520+
an_array_of_doubles: [ 1000000000000000000000000000000000000000000, -1000000000000000000000000000000000000000000 ]
3521+
an_array_of_falses: [ false, false, false ]
3522+
an_array_of_floats: [ 2.3, 4.2 ]
3523+
an_array_of_ints: [ 42, 23 ]
3524+
an_array_of_longs: [ 4147483647, -4147483647 ]
3525+
an_array_of_mixed_booleans: [ false, true, false ]
3526+
an_array_of_trues: [ true, true, true ]
3527+
an_int: 42

tests/paramref_arguments_inputs.cwl

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.2
3+
class: CommandLineTool
4+
5+
inputs:
6+
a_string:
7+
type: string
8+
default: z
9+
a_string_array:
10+
type: string[]
11+
default: [a, b, c]
12+
a_true:
13+
type: boolean
14+
default: true
15+
an_array_of_trues:
16+
type: boolean[]
17+
default: [true, true, true]
18+
an_array_of_falses:
19+
type: boolean[]
20+
default: [false, false, false]
21+
an_array_of_mixed_booleans:
22+
type: boolean[]
23+
default: [false, true, false]
24+
an_int:
25+
type: int
26+
default: 42
27+
an_array_of_ints:
28+
type: int[]
29+
default: [42, 23]
30+
a_long:
31+
type: long
32+
default: 4147483647
33+
an_array_of_longs:
34+
type: long[]
35+
default: [4147483647, -4147483647]
36+
a_float:
37+
type: float
38+
default: 4.2
39+
an_array_of_floats:
40+
type: float[]
41+
default: [2.3, 4.2]
42+
a_double:
43+
type: double
44+
default: 1000000000000000000000000000000000000000000
45+
an_array_of_doubles:
46+
type: double[]
47+
default:
48+
- 1000000000000000000000000000000000000000000
49+
- -1000000000000000000000000000000000000000000
50+
arguments:
51+
- '{"result":$(inputs)}'
52+
outputs:
53+
result:
54+
type:
55+
type: record
56+
fields:
57+
a_string: string
58+
a_string_array: string[]
59+
a_true: boolean
60+
an_array_of_trues: boolean[]
61+
an_array_of_falses: boolean[]
62+
an_array_of_mixed_booleans: boolean[]
63+
an_int: int
64+
an_array_of_ints: int[]
65+
a_long: long
66+
an_array_of_longs: long[]
67+
a_float: float
68+
an_array_of_floats: float[]
69+
a_double: double
70+
an_array_of_doubles: double[]
71+
baseCommand: echo
72+
stdout: cwl.output.json

tests/paramref_arguments_roundtrip.cwl

100644100755
File mode changed.

tests/paramref_arguments_runtime.cwl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.2
3+
class: CommandLineTool
4+
5+
baseCommand: echo
6+
7+
inputs: []
8+
9+
arguments:
10+
- '{"runtime":$(runtime)}'
11+
12+
stdout: cwl.output.json
13+
14+
outputs:
15+
runtime:
16+
type:
17+
type: record
18+
fields:
19+
cores: long
20+
outdir: string
21+
outdirSize: long
22+
ram: long
23+
tmpdir: string
24+
tmpdirSize: long

tests/paramref_arguments_self.cwl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.2
3+
4+
class: CommandLineTool
5+
6+
baseCommand: echo
7+
8+
inputs: []
9+
10+
arguments:
11+
- '{"self":$(self)}'
12+
13+
stdout: cwl.output.json
14+
15+
outputs:
16+
self: Any?

0 commit comments

Comments
 (0)