Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tests/loop/test-index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,31 @@
o1: 10
doc: "Test a loop case with two variables but one is optional"
tags: [ loop, inline_javascript, workflow ]

- tool: value-from-loop-2.cwl
id: loop_value_from-2
output: {
"result": [
"first,0-sha1$e445e7ebf0b1e19e5eb7f3e8e4d86f5424c4b103",
"first,1-sha1$c2ee1cb0abf988529ae1d67c5a6798a9db9e133a",
"first,2-sha1$7663c0076cdf1dbe14373237e8c2eea8735b04f2",
"first,3-sha1$83b77de68c3c6cce92a381adc9159d6e59332545",
"first,4-sha1$eb74efd51e4399144f465534f4077f515d996d57"
]
}
doc: "Test a loop case with a literal file generated by a valueFrom directive inside the loop."
tags: [ conditional, loop, inline_javascript, workflow ]

- tool: value-from-loop-3.cwl
id: loop_and_value_from
output: {
"result": [
"first,0-sha1$e445e7ebf0b1e19e5eb7f3e8e4d86f5424c4b103",
"first,0-sha1$e445e7ebf0b1e19e5eb7f3e8e4d86f5424c4b103",
"first,0-sha1$e445e7ebf0b1e19e5eb7f3e8e4d86f5424c4b103",
"first,0-sha1$e445e7ebf0b1e19e5eb7f3e8e4d86f5424c4b103",
"first,0-sha1$e445e7ebf0b1e19e5eb7f3e8e4d86f5424c4b103"
]
}
doc: "Test a loop case with a literal file generated by a valueFrom directive outside the loop."
tags: [ conditional, loop, inline_javascript, workflow ]
49 changes: 49 additions & 0 deletions tests/loop/value-from-loop-2.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.3.0-dev1
class: Workflow
requirements:
InlineJavascriptRequirement: {}
StepInputExpressionRequirement: {}
inputs:
limit:
type: int
default: 5

outputs:
- id: result
type: string[]
outputSource: step1/result

steps:
step1:
run:
class: CommandLineTool
inputs:
lfile:
type: File
inputBinding:
position: 1
stdout: "out.txt"
outputs:
result:
type: string
outputBinding:
glob: "out.txt"
loadContents: true
outputEval: $(self[0].contents)-$(self[0].checksum)
baseCommand: ["cat"]
in:
counter:
default: 0
limit: limit
lfile:
valueFrom: "${return {'class': 'File', 'basename': 'init-value-from.' + inputs.counter, 'contents': 'first,' + inputs.counter }}"
out:
- id: result
when: $(inputs.counter < inputs.limit)
loop:
counter:
valueFrom: $(inputs.counter + 1)
lfile:
valueFrom: "${return {'class': 'File', 'basename': 'iter-value-from.' + (inputs.counter + 1), 'contents': 'first,' + (inputs.counter + 1)}}"
outputMethod: all_iterations
47 changes: 47 additions & 0 deletions tests/loop/value-from-loop-3.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.3.0-dev1
class: Workflow
requirements:
InlineJavascriptRequirement: {}
StepInputExpressionRequirement: {}
inputs:
limit:
type: int
default: 5

outputs:
- id: result
type: string[]
outputSource: step1/result

steps:
step1:
run:
class: CommandLineTool
inputs:
lfile:
type: File
inputBinding:
position: 1
stdout: "out.txt"
outputs:
result:
type: string
outputBinding:
glob: "out.txt"
loadContents: true
outputEval: $(self[0].contents)-$(self[0].checksum)
baseCommand: ["cat"]
in:
counter:
default: 0
limit: limit
lfile:
valueFrom: "${return {'class': 'File', 'basename': 'init-value-from.' + inputs.counter, 'contents': 'first,' + inputs.counter }}"
out:
- id: result
when: $(inputs.counter < inputs.limit)
loop:
counter:
valueFrom: $(inputs.counter + 1)
outputMethod: all_iterations