Skip to content

Commit 00f0fcc

Browse files
authored
Merge pull request #30 from common-workflow-language/777-conformance-test-stage-array-to-dir
Add tests for staging file array to Directory
2 parents 4cd15d0 + cb3125e commit 00f0fcc

9 files changed

+189
-0
lines changed

conformance_tests.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,3 +3001,108 @@
30013001
class: "Directory"
30023002
listing: []
30033003
tags: [ required, command_line_tool ]
3004+
3005+
3006+
- doc: Test that array of input files can be staged to directory with entryname
3007+
label: stage_file_array
3008+
tool: tests/stage_file_array.cwl
3009+
job: tests/stage_file_array.job.json
3010+
output:
3011+
output:
3012+
[
3013+
{
3014+
"basename": "sfa-1.txt",
3015+
"checksum": "sha1$4c1cd0638ab3580310823fd1556d27ecb4816df6",
3016+
"class": "File",
3017+
"size": 49
3018+
},
3019+
{
3020+
"basename": "sfa-1.txt.sec",
3021+
"checksum": "sha1$40f4ee1bcd1a9466fcd2e48cf7fc3798025d2f9a",
3022+
"class": "File",
3023+
"size": 59
3024+
},
3025+
{
3026+
"basename": "sfa-2.txt",
3027+
"checksum": "sha1$4c1cd0638ab3580310823fd1556d27ecb4816df6",
3028+
"class": "File",
3029+
"size": 49
3030+
},
3031+
{
3032+
"basename": "sfa-2.txt.sec",
3033+
"checksum": "sha1$40f4ee1bcd1a9466fcd2e48cf7fc3798025d2f9a",
3034+
"class": "File",
3035+
"size": 59
3036+
}
3037+
]
3038+
tags: [ required, command_line_tool ]
3039+
3040+
3041+
- doc: Test that array of input files can be staged to directory with basename
3042+
label: stage_file_array
3043+
tool: tests/stage_file_array_basename.cwl
3044+
job: tests/stage_file_array.job.json
3045+
output:
3046+
output:
3047+
[
3048+
{
3049+
"basename": "sfa-1.txt",
3050+
"checksum": "sha1$4c1cd0638ab3580310823fd1556d27ecb4816df6",
3051+
"class": "File",
3052+
"size": 49
3053+
},
3054+
{
3055+
"basename": "sfa-1.txt.sec",
3056+
"checksum": "sha1$40f4ee1bcd1a9466fcd2e48cf7fc3798025d2f9a",
3057+
"class": "File",
3058+
"size": 59
3059+
},
3060+
{
3061+
"basename": "sfa-2.txt",
3062+
"checksum": "sha1$4c1cd0638ab3580310823fd1556d27ecb4816df6",
3063+
"class": "File",
3064+
"size": 49
3065+
},
3066+
{
3067+
"basename": "sfa-2.txt.sec",
3068+
"checksum": "sha1$40f4ee1bcd1a9466fcd2e48cf7fc3798025d2f9a",
3069+
"class": "File",
3070+
"size": 59
3071+
}
3072+
]
3073+
tags: [ required, command_line_tool ]
3074+
3075+
3076+
- doc: Test that if array of input files are staged to directory with basename and entryname, entryname overrides
3077+
label: stage_file_array
3078+
tool: tests/stage_file_array_basename_and_entryname.cwl
3079+
job: tests/stage_file_array.job.json
3080+
output:
3081+
output:
3082+
[
3083+
{
3084+
"basename": "sfa-1.txt",
3085+
"checksum": "sha1$4c1cd0638ab3580310823fd1556d27ecb4816df6",
3086+
"class": "File",
3087+
"size": 49
3088+
},
3089+
{
3090+
"basename": "sfa-1.txt.sec",
3091+
"checksum": "sha1$40f4ee1bcd1a9466fcd2e48cf7fc3798025d2f9a",
3092+
"class": "File",
3093+
"size": 59
3094+
},
3095+
{
3096+
"basename": "sfa-2.txt",
3097+
"checksum": "sha1$4c1cd0638ab3580310823fd1556d27ecb4816df6",
3098+
"class": "File",
3099+
"size": 49
3100+
},
3101+
{
3102+
"basename": "sfa-2.txt.sec",
3103+
"checksum": "sha1$40f4ee1bcd1a9466fcd2e48cf7fc3798025d2f9a",
3104+
"class": "File",
3105+
"size": 59
3106+
}
3107+
]
3108+
tags: [ required, command_line_tool ]

tests/sfa-1.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Test file for staging array of files to Directory

tests/sfa-1.txt.sec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Secondary test file for staging array of files to Directory

tests/sfa-2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Test file for staging array of files to Directory

tests/sfa-2.txt.sec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Secondary test file for staging array of files to Directory

tests/stage_file_array.cwl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env cwl-runner
2+
3+
class: CommandLineTool
4+
cwlVersion: v1.1.0-dev1
5+
id: stage_file_array
6+
label: Stage File Array
7+
arguments: [ls]
8+
inputs:
9+
- id: input_list
10+
type: 'File[]'
11+
secondaryFiles:
12+
- .sec
13+
outputs:
14+
- id: output
15+
type: File[]
16+
outputBinding:
17+
glob: input_dir/*
18+
requirements:
19+
- class: InlineJavascriptRequirement
20+
- class: InitialWorkDirRequirement
21+
listing:
22+
- entryname: input_dir
23+
entry: "${ return {class: 'Directory', listing: inputs.input_list} }"

tests/stage_file_array.job.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"input_list": [
3+
{
4+
"class": "File",
5+
"location": "sfa-1.txt"
6+
},
7+
{
8+
"class": "File",
9+
"location": "sfa-2.txt"
10+
}
11+
]
12+
}

tests/stage_file_array_basename.cwl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env cwl-runner
2+
3+
class: CommandLineTool
4+
cwlVersion: v1.1.0-dev1
5+
id: stage_file_array_basename
6+
label: Stage File Array (with Directory Basename)
7+
arguments: [ls]
8+
inputs:
9+
- id: input_list
10+
type: 'File[]'
11+
secondaryFiles:
12+
- .sec
13+
outputs:
14+
- id: output
15+
type: File[]
16+
outputBinding:
17+
glob: input_dir/*
18+
requirements:
19+
- class: InlineJavascriptRequirement
20+
- class: InitialWorkDirRequirement
21+
listing:
22+
- entry: "${ return {class: 'Directory', basename: 'input_dir', listing: inputs.input_list} }"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env cwl-runner
2+
3+
class: CommandLineTool
4+
cwlVersion: v1.1.0-dev1
5+
id: stage_file_array_basename_and_entryname
6+
label: Stage File Array (with Directory Basename AND entryname)
7+
arguments: [ls]
8+
inputs:
9+
- id: input_list
10+
type: 'File[]'
11+
secondaryFiles:
12+
- .sec
13+
outputs:
14+
- id: output
15+
type: File[]
16+
outputBinding:
17+
glob: input_dir/*
18+
requirements:
19+
- class: InlineJavascriptRequirement
20+
- class: InitialWorkDirRequirement
21+
listing:
22+
- entryname: input_dir
23+
entry: "${ return {class: 'Directory', basename: 'not_input_dir', listing: inputs.input_list} }"

0 commit comments

Comments
 (0)