-
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.
Add support of relative paths for script definition (#103)
* Add support of relative paths for script definition * Add relative paths to documentation
- Loading branch information
Showing
15 changed files
with
214 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ output | |
test_mock.nf | ||
/.nf-test/ | ||
site | ||
tests | ||
/tests |
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
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
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
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,40 @@ | ||
nextflow_process { | ||
|
||
name "Test process xy" | ||
|
||
script "./test_process.nf" | ||
process "TEST_PROCESS" | ||
|
||
test("Should create 5 files") { | ||
|
||
when { | ||
params { | ||
outdir = "$outputDir/seb7" | ||
} | ||
process { | ||
""" | ||
input[0] = Channel.of(1..5) | ||
input[1] = "test" | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert process.success | ||
assert process.out.my_output_numbers == [1,2,3,4,5] | ||
|
||
assert process.out.my_output_files | ||
assert process.out.my_output_files.size() == 5 | ||
def file1 = path process.out.my_output_files.get(0) | ||
assert file1.fileName.toString() == "1_test.txt" | ||
assert file1.fileName.toString().endsWith("test.txt") | ||
assert file1.readLines() == ['lukas forer'] | ||
|
||
assert process.out.my_output_tuple | ||
assert process.out.my_output_tuple.size() == 5 | ||
assert process.out.my_output_tuple.get(0).size() == 3 | ||
} | ||
|
||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
test-data/process/default/tests/test_process_relative.nf.test
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,40 @@ | ||
nextflow_process { | ||
|
||
name "Test process xy" | ||
|
||
script "../test_process.nf" | ||
process "TEST_PROCESS" | ||
|
||
test("Should create 5 files") { | ||
|
||
when { | ||
params { | ||
outdir = "$outputDir/seb7" | ||
} | ||
process { | ||
""" | ||
input[0] = Channel.of(1..5) | ||
input[1] = "test" | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert process.success | ||
assert process.out.my_output_numbers == [1,2,3,4,5] | ||
|
||
assert process.out.my_output_files | ||
assert process.out.my_output_files.size() == 5 | ||
def file1 = path process.out.my_output_files.get(0) | ||
assert file1.fileName.toString() == "1_test.txt" | ||
assert file1.fileName.toString().endsWith("test.txt") | ||
assert file1.readLines() == ['lukas forer'] | ||
|
||
assert process.out.my_output_tuple | ||
assert process.out.my_output_tuple.size() == 5 | ||
assert process.out.my_output_tuple.get(0).size() == 3 | ||
} | ||
|
||
} | ||
|
||
} |
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,26 @@ | ||
nextflow_workflow { | ||
|
||
name "Test workflow" | ||
script "../trial.nf" | ||
workflow "trial" | ||
|
||
test("Should run without failures") { | ||
when { | ||
params { | ||
outdir = "tests/results" | ||
} | ||
workflow { | ||
""" | ||
input[0] = Channel.of('a','b') | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
//check if test case succeeded | ||
assert workflow.success | ||
assert workflow.out.lukas.size() == 2 | ||
assert workflow.out.sebastian.size() == 2 | ||
} | ||
} | ||
} |