Skip to content

Commit 63ebb82

Browse files
committed
tests: audit & reduce usage of ShellCommandRequirement
1 parent af91e1e commit 63ebb82

35 files changed

+151
-178
lines changed

CommandLineTool.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ $graph:
5757
define if undeclared outputs in "cwl.output.json" should be present
5858
in the output object.
5959
60+
### Updated Conformance Tests for v1.3.0
61+
62+
* Reduced the usage of `ShellCommandRequirement` in the conformance tests,
63+
making several more of the `required`.
64+
6065
See also the [CWL Workflow Description, v1.3.0-dev1 changelog](Workflow.html#Changelog).
6166
For other changes since CWL v1.0, see the
6267
[CWL Command Line Tool Description, v1.1 changelog](https://www.commonwl.org/v1.1/CommandLineTool.html#Changelog)

conformance_tests.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
checksum: sha1$f1d2d2f924e986ac86fdf7b36c94bcdf32beec15
110110
size: 4
111111
location: error.txt
112-
tags: [ shell_command, command_line_tool ]
112+
tags: [ required, command_line_tool ]
113113

114114
- job: tests/empty.json
115115
tool: tests/stderr-shortcut.cwl
@@ -121,7 +121,7 @@
121121
checksum: sha1$f1d2d2f924e986ac86fdf7b36c94bcdf32beec15
122122
size: 4
123123
location: Any
124-
tags: [ shell_command, command_line_tool ]
124+
tags: [ required, command_line_tool ]
125125

126126
- output:
127127
output_file:
@@ -133,7 +133,7 @@
133133
tool: tests/stderr-mediumcut.cwl
134134
id: stderr_redirect_mediumcut
135135
doc: Test command line with stderr redirection, named brief syntax
136-
tags: [ shell_command, command_line_tool ]
136+
tags: [ required, command_line_tool ]
137137

138138
- job: tests/cat-job.json
139139
output:
@@ -951,7 +951,7 @@
951951
doc: >-
952952
Test support for reading cwl.output.json when running in a Docker container
953953
and just 'path' is provided.
954-
tags: [ shell_command, command_line_tool ]
954+
tags: [ required, command_line_tool ]
955955

956956
- job: tests/empty.json
957957
output: {
@@ -1110,7 +1110,7 @@
11101110
tool: tests/dir.cwl
11111111
id: directory_input_param_ref
11121112
doc: Test directory input with parameter reference
1113-
tags: [ shell_command, command_line_tool ]
1113+
tags: [ required, command_line_tool ]
11141114

11151115
- job: tests/dir-job.yml
11161116
output:
@@ -1123,7 +1123,7 @@
11231123
tool: tests/dir2.cwl
11241124
id: directory_input_docker
11251125
doc: Test directory input in Docker
1126-
tags: [ command_line_tool, shell_command ]
1126+
tags: [ required, command_line_tool ]
11271127

11281128
- job: tests/dir3-job.yml
11291129
output:
@@ -1161,7 +1161,7 @@
11611161
tool: tests/dir4.cwl
11621162
id: directory_secondaryfiles
11631163
doc: Test directories in secondaryFiles
1164-
tags: [ shell_command, command_line_tool ]
1164+
tags: [ required, command_line_tool ]
11651165

11661166
- job: tests/dir-job.yml
11671167
output: {
@@ -1175,7 +1175,7 @@
11751175
tool: tests/dir5.cwl
11761176
id: dynamic_initial_workdir
11771177
doc: Test dynamic initial work dir
1178-
tags: [ shell_command, initial_work_dir, command_line_tool ]
1178+
tags: [ initial_work_dir, command_line_tool ]
11791179

11801180
- job: tests/stagefile-job.yml
11811181
output: {
@@ -1257,14 +1257,14 @@
12571257
tool: tests/envvar.cwl
12581258
id: env_home_tmpdir
12591259
doc: Test $HOME and $TMPDIR are set correctly
1260-
tags: [ shell_command, command_line_tool ]
1260+
tags: [ required, command_line_tool ]
12611261

12621262
- job: tests/empty.json
12631263
output: {}
12641264
tool: tests/envvar2.cwl
12651265
id: env_home_tmpdir_docker
12661266
doc: Test $HOME and $TMPDIR are set correctly in Docker
1267-
tags: [ shell_command, command_line_tool ]
1267+
tags: [ required, command_line_tool ]
12681268

12691269
- job: tests/empty.json
12701270
output:
@@ -1316,14 +1316,14 @@
13161316
tool: tests/docker-array-secondaryfiles.cwl
13171317
id: filesarray_secondaryfiles
13181318
doc: Test required, optional and null secondaryFiles on array of files.
1319-
tags: [ docker, inline_javascript, shell_command, command_line_tool ]
1319+
tags: [ docker, inline_javascript, command_line_tool ]
13201320

13211321
- job: tests/docker-array-secondaryfiles-job2.json
13221322
should_fail: true
13231323
tool: tests/docker-array-secondaryfiles.cwl
13241324
id: filesarray_secondaryfiles2
13251325
doc: Test required, optional and null secondaryFiles on array of files.
1326-
tags: [ docker, inline_javascript, shell_command, command_line_tool ]
1326+
tags: [ docker, inline_javascript, command_line_tool ]
13271327

13281328
- job: tests/dir7.yml
13291329
output: {
@@ -1477,7 +1477,7 @@
14771477
tool: tests/recursive-input-directory.cwl
14781478
id: input_dir_recurs_copy_writable
14791479
doc: Test if a writable input directory is recursively copied and writable
1480-
tags: [ initial_work_dir, shell_command, command_line_tool ]
1480+
tags: [ initial_work_dir, command_line_tool ]
14811481

14821482
- output:
14831483
out: "t\n"
@@ -1819,7 +1819,7 @@
18191819
tool: tests/envvar3.cwl
18201820
id: env_home_tmpdir_docker_no_return_code
18211821
doc: Test $HOME and $TMPDIR are set correctly in Docker without using return code
1822-
tags: [ shell_command, command_line_tool ]
1822+
tags: [ required, command_line_tool ]
18231823

18241824
- job: tests/scatter-valuefrom-job1.json
18251825
output:
@@ -1877,7 +1877,7 @@
18771877
tool: tests/dir4.cwl
18781878
id: job_input_secondary_subdirs
18791879
doc: Test specifying secondaryFiles in subdirectories of the job input document.
1880-
tags: [ shell_command, command_line_tool ]
1880+
tags: [ required, command_line_tool ]
18811881

18821882
- job: tests/dir4-subdir-2-job.yml
18831883
output: {
@@ -1891,7 +1891,7 @@
18911891
tool: tests/dir4.cwl
18921892
id: job_input_subdir_primary_and_secondary_subdirs
18931893
doc: Test specifying secondaryFiles in same subdirectory of the job input as the primary input file.
1894-
tags: [ shell_command, command_line_tool ]
1894+
tags: [ required, command_line_tool ]
18951895

18961896
- job: tests/count-lines3-job.json
18971897
output:
@@ -2773,7 +2773,7 @@
27732773
"location": "lsout",
27742774
"size": 32
27752775
}
2776-
tags: [ resource, command_line_tool, initial_work_dir ]
2776+
tags: [ command_line_tool, initial_work_dir ]
27772777
id: initial_work_dir_for_null_and_arrays
27782778

27792779
- job: tests/stage-array-dirs-job.yml
@@ -2869,7 +2869,7 @@
28692869
"baesname": "symlink.txt"
28702870
"checksum": "sha1$cd28ec34f3f9425aca544b6332453708e8aaa82a"
28712871
should_fail: true
2872-
tags: [ command_line_tool ]
2872+
tags: [ required, command_line_tool ]
28732873
id: illegal_symlink
28742874

28752875
- job: tests/empty.json
@@ -2881,7 +2881,7 @@
28812881
"size": 27
28822882
"basename": "symlink.txt"
28832883
"checksum": "sha1$cd28ec34f3f9425aca544b6332453708e8aaa82a"
2884-
tags: [ command_line_tool ]
2884+
tags: [ required, command_line_tool ]
28852885
id: legal_symlink
28862886

28872887
- job: tests/empty.json
@@ -3399,7 +3399,7 @@
33993399
}
34003400
tool: tests/stdout_chained_commands.cwl
34013401
doc: |
3402-
Test that chaining two echo calls causes the workflow tool to emit the output to stdout.
3402+
Test that chaining two echo calls causes the tool to emit the output to stdout.
34033403
This is to confirm that the workflow tool will **not** create an expression such as
34043404
`echo a && echo b > out.txt`, but instead will produce the correct `echo a && echo b`,
34053405
and capture the output correctly.

tests/dir.cwl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
class: CommandLineTool
22
cwlVersion: v1.3.0-dev1
3-
requirements:
4-
- class: ShellCommandRequirement
53
inputs:
64
indir: Directory
75
outputs:
86
outlist:
97
type: File
108
outputBinding:
119
glob: output.txt
12-
arguments: ["cd", "$(inputs.indir.path)",
13-
{shellQuote: false, valueFrom: "&&"},
14-
"find", ".",
15-
{shellQuote: false, valueFrom: "|"},
16-
"sort"]
17-
stdout: output.txt
10+
arguments:
11+
- sh
12+
- -c
13+
- |
14+
cd $(inputs.indir.path) && find . | sort
15+
stdout: output.txt

tests/dir2.cwl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
class: CommandLineTool
22
cwlVersion: v1.3.0-dev1
3-
requirements:
4-
ShellCommandRequirement: {}
53
hints:
64
DockerRequirement:
75
dockerPull: docker.io/debian:stable-slim
@@ -12,9 +10,9 @@ outputs:
1210
type: File
1311
outputBinding:
1412
glob: output.txt
15-
arguments: ["cd", "$(inputs.indir.path)",
16-
{shellQuote: false, valueFrom: "&&"},
17-
"find", ".",
18-
{shellQuote: false, valueFrom: "|"},
19-
"sort"]
13+
arguments:
14+
- sh
15+
- -c
16+
- |
17+
cd $(inputs.indir.path) && find . | sort
2018
stdout: output.txt

tests/dir4.cwl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
class: CommandLineTool
22
cwlVersion: v1.3.0-dev1
3-
requirements:
4-
- class: ShellCommandRequirement
53
inputs:
64
inf: File
75
outputs:
86
outlist:
97
type: File
108
outputBinding:
119
glob: output.txt
12-
arguments: ["cd", "$(inputs.inf.dirname)/xtestdir",
13-
{shellQuote: false, valueFrom: "&&"},
14-
"find", ".",
15-
{shellQuote: false, valueFrom: "|"},
16-
"sort"]
10+
arguments:
11+
- sh
12+
- -c
13+
- |
14+
cd $(inputs.inf.dirname)/xtestdir && find . | sort
1715
stdout: output.txt

tests/dir5.cwl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
class: CommandLineTool
22
cwlVersion: v1.3.0-dev1
33
requirements:
4-
- class: ShellCommandRequirement
54
- class: InitialWorkDirRequirement
65
listing: $(inputs.indir.listing)
76
inputs:
@@ -13,7 +12,9 @@ outputs:
1312
type: File
1413
outputBinding:
1514
glob: output.txt
16-
arguments: ["find", "-L", ".", "!", "-path", "*.txt",
17-
{shellQuote: false, valueFrom: "|"},
18-
"sort"]
15+
arguments:
16+
- sh
17+
- -c
18+
- |
19+
find -L . ! -path *.txt | sort
1920
stdout: output.txt

tests/dir6.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ arguments: [
1818
"find", ".",
1919
{shellQuote: false, valueFrom: "|"},
2020
"sort"]
21-
stdout: output.txt
21+
stdout: output.txt

tests/docker-array-secondaryfiles.cwl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ requirements:
66
- class: DockerRequirement
77
dockerPull: docker.io/debian:stable-slim
88
- class: InlineJavascriptRequirement
9-
- class: ShellCommandRequirement
109

1110
class: CommandLineTool
1211

@@ -37,14 +36,15 @@ outputs:
3736
- pattern: "${ return null }"
3837

3938
arguments:
40-
- valueFrom: ${
39+
- sh
40+
- -c
41+
- |
42+
${
4143
var fai_list = "";
4244
for (var i = 0; i < inputs.fasta_path.length; i ++) {
4345
fai_list += " cat " + inputs.fasta_path[i].path +".fai" + " >> fai.list && "
4446
}
4547
return fai_list.slice(0,-3)
46-
}
47-
position: 1
48-
shellQuote: false
48+
}
4949

5050
baseCommand: []

tests/envvar.cwl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ class: CommandLineTool
22
cwlVersion: v1.3.0-dev1
33
inputs: []
44
outputs: []
5-
requirements:
6-
ShellCommandRequirement: {}
7-
arguments: [
8-
echo, {valueFrom: '"HOME=$HOME"', shellQuote: false}, {valueFrom: '"TMPDIR=$TMPDIR"', shellQuote: false},
9-
{valueFrom: '&&', shellQuote: false},
10-
test, {valueFrom: '"$HOME"', shellQuote: false}, "=", $(runtime.outdir),
11-
"-a", {valueFrom: '"$TMPDIR"', shellQuote: false}, "=", $(runtime.tmpdir)]
5+
arguments:
6+
- sh
7+
- -c
8+
- |
9+
echo "HOME=$HOME" "TMPDIR=$TMPDIR" && test "$HOME"=$(runtime.outdir) -a "$TMPDIR"=$(runtime.tmpdir)

tests/envvar2.cwl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ class: CommandLineTool
22
cwlVersion: v1.3.0-dev1
33
inputs: []
44
outputs: []
5-
requirements:
6-
ShellCommandRequirement: {}
75
hints:
86
DockerRequirement:
97
dockerPull: docker.io/debian:stable-slim
10-
arguments: [
11-
echo, {valueFrom: '"HOME=$HOME"', shellQuote: false}, {valueFrom: '"TMPDIR=$TMPDIR"', shellQuote: false},
12-
{valueFrom: '&&', shellQuote: false},
13-
test, {valueFrom: '"$HOME"', shellQuote: false}, "=", $(runtime.outdir),
14-
"-a", {valueFrom: '"$TMPDIR"', shellQuote: false}, "=", $(runtime.tmpdir)]
8+
arguments:
9+
- sh
10+
- -c
11+
- |
12+
echo "HOME=$HOME" "TMPDIR=$TMPDIR" && test "$HOME"=$(runtime.outdir) -a "$TMPDIR"=$(runtime.tmpdir)

0 commit comments

Comments
 (0)