-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with outputDir and make reamining variables read only
- Loading branch information
Showing
4 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
process exampleProc { | ||
|
||
storeDir "${outputDir}/exampleProc" | ||
input: | ||
tuple( | ||
val(outputDir), | ||
val(localOutputDir), | ||
) | ||
|
||
output: | ||
tuple( | ||
val(outputDir), | ||
path("example_output/example*.txt") | ||
) | ||
|
||
shell: | ||
""" | ||
mkdir -p !{localOutputDir} | ||
touch "!{localOutputDir}/example1.txt" | ||
touch "!{localOutputDir}/example2.txt" | ||
""" | ||
} | ||
|
||
|
||
workflow PipeWf { | ||
take: | ||
inputCh | ||
|
||
main: | ||
inputCh | ||
| exampleProc | ||
| set { outputCh } | ||
|
||
emit: | ||
outputCh | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
nextflow_workflow { | ||
|
||
name "Test workflow" | ||
script "./example_wf.nf" | ||
workflow "PipeWf" | ||
|
||
// This example worked correctly in 0.7.3 but fails in 0.8.0 | ||
test("Output will not exist in default outputDir") { | ||
|
||
when { | ||
|
||
params { | ||
outputDir = "$outputDir" | ||
localOutputDir = "example_output" | ||
} | ||
workflow { | ||
""" | ||
input[0] = Channel.of([params.outputDir,params.localOutputDir]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert path("${outputDir}/exampleProc/example_output").exists() | ||
} | ||
} | ||
|
||
test("Output will exist in default outputDir") { | ||
|
||
when { | ||
|
||
params { | ||
outDir = "$outputDir" | ||
localOutputDir = "example_output" | ||
} | ||
workflow { | ||
""" | ||
input[0] = Channel.of([params.outDir,params.localOutputDir]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert path("${outputDir}/exampleProc/example_output").exists() | ||
} | ||
} | ||
} |