Skip to content

Commit 71efb7b

Browse files
author
Peter Amstutz
committed
Merge branch 'recursive_directory' of https://github.com/gijzelaerr/common-workflow-language
2 parents c50c150 + d736a0e commit 71efb7b

File tree

6 files changed

+183
-1
lines changed

6 files changed

+183
-1
lines changed

v1.0/conformance_test_v1.0.yaml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,4 +995,58 @@
995995
args: [-A,'2',-B,baz,-C,'10','9','8','7','6','5','4','3','2','1']
996996
job: v1.0/empty.json
997997
tool: v1.0/inline-js.cwl
998-
doc: Test InlineJavascriptRequirement with multiple expressions in the same tool
998+
doc: Test InlineJavascriptRequirement with multiple expressions in the same tool
999+
1000+
- job: v1.0/recursive-input-directory.yml
1001+
output:
1002+
output_dir: {
1003+
"basename": "work_dir",
1004+
"class": "Directory",
1005+
"listing": [
1006+
{
1007+
"basename": "a",
1008+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1009+
"class": "File",
1010+
"location": "work_dir/a",
1011+
"size": 0
1012+
},
1013+
{
1014+
"basename": "b",
1015+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1016+
"class": "File",
1017+
"location": "work_dir/b",
1018+
"size": 0
1019+
},
1020+
{
1021+
"basename": "c",
1022+
"class": "Directory",
1023+
"listing": [
1024+
{
1025+
"basename": "d",
1026+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1027+
"class": "File",
1028+
"location": "work_dir/c/d",
1029+
"size": 0
1030+
}
1031+
],
1032+
"location": "work_dir/c",
1033+
},
1034+
{
1035+
"basename": "e",
1036+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1037+
"class": "File",
1038+
"location": "work_dir/e",
1039+
"size": 0
1040+
},
1041+
],
1042+
"location": "work_dir",
1043+
}
1044+
test_result: {
1045+
"basename": "output.txt",
1046+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1047+
"class": "File",
1048+
"location": "output.txt",
1049+
"size": 0
1050+
}
1051+
tool: v1.0/recursive-input-directory.cwl
1052+
doc: Test if a writable input directory is recursivly copied and writable
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
cwlVersion: v1.0
2+
class: CommandLineTool
3+
requirements:
4+
- class: InlineJavascriptRequirement
5+
- class: InitialWorkDirRequirement
6+
listing:
7+
- entry: $(inputs.input_dir)
8+
entryname: work_dir
9+
writable: true
10+
- class: ShellCommandRequirement
11+
stdout: output.txt
12+
arguments:
13+
- shellQuote: false
14+
valueFrom: |
15+
touch work_dir/e;
16+
if [ ! -w work_dir ]; then echo work_dir not writable; fi;
17+
if [ -L work_dir ]; then echo work_dir is a symlink; fi;
18+
if [ ! -w work_dir/a ]; then echo work_dir/a not writable; fi;
19+
if [ -L work_dir/a ]; then echo work_dir/a is a symlink; fi;
20+
if [ ! -w work_dir/c ]; then echo work_dir/c not writable; fi;
21+
if [ -L work_dir/c ]; then echo work_dir/c is a symlink; fi;
22+
if [ ! -w work_dir/c/d ]; then echo work_dir/c/d not writable; fi;
23+
if [ -L work_dir/c/d ]; then echo work_dir/c/d is a symlink; fi;
24+
if [ ! -w work_dir/e ]; then echo work_dir/e not writable; fi;
25+
if [ -L work_dir/e ]; then echo work_dir/e is a symlink ; fi;
26+
inputs:
27+
input_dir: Directory
28+
outputs:
29+
output_dir:
30+
type: Directory
31+
outputBinding:
32+
glob: work_dir
33+
test_result:
34+
type: stdout
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
input_dir:
2+
class: Directory
3+
location: testdir

v1.1.0-dev1/conformance_test_v1.1.0-dev1.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,3 +1001,57 @@
10011001
job: v1.1.0-dev1/default_path_job.yml
10021002
tool: v1.1.0-dev1/default_path.cwl
10031003
doc: Test warning instead of error when default path is not found
1004+
1005+
- job: v1.1.0-dev1/recursive-input-directory.yml
1006+
output:
1007+
output_dir: {
1008+
"basename": "work_dir",
1009+
"class": "Directory",
1010+
"listing": [
1011+
{
1012+
"basename": "a",
1013+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1014+
"class": "File",
1015+
"location": "work_dir/a",
1016+
"size": 0
1017+
},
1018+
{
1019+
"basename": "b",
1020+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1021+
"class": "File",
1022+
"location": "work_dir/b",
1023+
"size": 0
1024+
},
1025+
{
1026+
"basename": "c",
1027+
"class": "Directory",
1028+
"listing": [
1029+
{
1030+
"basename": "d",
1031+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1032+
"class": "File",
1033+
"location": "work_dir/c/d",
1034+
"size": 0
1035+
}
1036+
],
1037+
"location": "work_dir/c",
1038+
},
1039+
{
1040+
"basename": "e",
1041+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1042+
"class": "File",
1043+
"location": "work_dir/e",
1044+
"size": 0
1045+
},
1046+
],
1047+
"location": "work_dir",
1048+
}
1049+
test_result: {
1050+
"basename": "output.txt",
1051+
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
1052+
"class": "File",
1053+
"location": "output.txt",
1054+
"size": 0
1055+
}
1056+
tool: v1.1.0-dev1/recursive-input-directory.cwl
1057+
doc: Test if a writable input directory is recursivly copied and writable
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
cwlVersion: v1.1.0-dev1
2+
class: CommandLineTool
3+
requirements:
4+
- class: InlineJavascriptRequirement
5+
- class: InitialWorkDirRequirement
6+
listing:
7+
- entry: $(inputs.input_dir)
8+
entryname: work_dir
9+
writable: true
10+
- class: ShellCommandRequirement
11+
stdout: output.txt
12+
arguments:
13+
- shellQuote: false
14+
valueFrom: |
15+
touch work_dir/e;
16+
if [ ! -w work_dir ]; then echo work_dir not writable; fi;
17+
if [ -L work_dir ]; then echo work_dir is a symlink; fi;
18+
if [ ! -w work_dir/a ]; then echo work_dir/a not writable; fi;
19+
if [ -L work_dir/a ]; then echo work_dir/a is a symlink; fi;
20+
if [ ! -w work_dir/c ]; then echo work_dir/c not writable; fi;
21+
if [ -L work_dir/c ]; then echo work_dir/c is a symlink; fi;
22+
if [ ! -w work_dir/c/d ]; then echo work_dir/c/d not writable; fi;
23+
if [ -L work_dir/c/d ]; then echo work_dir/c/d is a symlink; fi;
24+
if [ ! -w work_dir/e ]; then echo work_dir/e not writable; fi;
25+
if [ -L work_dir/e ]; then echo work_dir/e is a symlink ; fi;
26+
inputs:
27+
input_dir: Directory
28+
outputs:
29+
output_dir:
30+
type: Directory
31+
outputBinding:
32+
glob: work_dir
33+
test_result:
34+
type: stdout
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
input_dir:
2+
class: Directory
3+
location: testdir

0 commit comments

Comments
 (0)