Skip to content

Commit a4e9f99

Browse files
rupertnashmr-c
andauthored
test for nested directories and initial workdir requirement (#126)
Co-authored-by: Michael R. Crusoe <[email protected]>
1 parent 9426e5d commit a4e9f99

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

conformance_tests.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3399,3 +3399,20 @@
33993399
- $import: tests/mixed-versions/test-index.yaml
34003400
- $import: tests/loadContents/test-index.yaml
34013401
- $import: tests/iwd/test-index.yaml
3402+
3403+
- doc: Nested directories, InitialWorkDirRequirement, and containers work together
3404+
label: nested_dirs_iwdr_container
3405+
tool: tests/nested-dirs-iwdr/test.cwl
3406+
job: tests/empty.json
3407+
output:
3408+
final_output:
3409+
class: Directory
3410+
basename: my_dir
3411+
location: Any
3412+
listing:
3413+
- class: File
3414+
basename: my_file
3415+
location: Any
3416+
size: 0
3417+
checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
3418+
tags: [ workflow, initial_work_dir, subworkflow ]
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+
cwlVersion: v1.2
3+
class: CommandLineTool
4+
5+
requirements:
6+
- class: InitialWorkDirRequirement
7+
listing:
8+
- entry: $(inputs.my_input)
9+
writable: False
10+
11+
baseCommand: 'true'
12+
13+
inputs:
14+
my_input:
15+
type: Directory
16+
inputBinding:
17+
position: 1
18+
19+
outputs:
20+
my_output:
21+
type: Directory
22+
outputBinding:
23+
glob: $(inputs.my_input.basename)

tests/nested-dirs-iwdr/mkdir.cwl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.2
3+
class: CommandLineTool
4+
5+
baseCommand: [bash, '-c', 'mkdir "$1" && touch "$1/my_file"', '-']
6+
7+
inputs:
8+
my_input:
9+
type: string
10+
default: my_dir
11+
inputBinding:
12+
position: 1
13+
14+
outputs:
15+
my_output:
16+
type: Directory
17+
outputBinding:
18+
glob: $(inputs.my_input)

tests/nested-dirs-iwdr/test.cwl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.2
3+
class: Workflow
4+
5+
# Test that nested directories, InitialWorkDirRequirement, containers
6+
# work correctly together. This is based on a reported problem, see
7+
# https://github.com/common-workflow-language/common-workflow-language/issues/749
8+
hints:
9+
DockerRequirement:
10+
dockerPull: docker.io/bash:4.4
11+
12+
requirements:
13+
- class: SubworkflowFeatureRequirement
14+
15+
inputs: []
16+
17+
steps:
18+
directory_output_step:
19+
run: mkdir.cwl
20+
in: []
21+
out: [my_output]
22+
23+
initial_work_dir_step:
24+
run: initial_work_dir.cwl
25+
in:
26+
my_input: directory_output_step/my_output
27+
out: [my_output]
28+
29+
outputs:
30+
final_output:
31+
type: Directory
32+
outputSource: initial_work_dir_step/my_output

0 commit comments

Comments
 (0)