Skip to content

Commit

Permalink
Update nf-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrtalbot committed Oct 4, 2023
1 parent 3886fdd commit 7185d96
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 58 deletions.
14 changes: 7 additions & 7 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nextflow_pipeline {

when {
params {
remoteFile = "tests/testfile.txt"
remoteFile = "${baseDir}/tests/testfile.txt"
}
}

Expand All @@ -17,7 +17,7 @@ nextflow_pipeline {
assert workflow.trace.tasks().size() == 13
assert workflow.trace.succeeded().size() == 12
assert workflow.trace.failed().size() == 1
assert snapshot(workflow.out, path("work/outputs").list()).match()
assert snapshot(path("work/outputs").list()).match()
}

}
Expand All @@ -27,7 +27,7 @@ nextflow_pipeline {
when {
params {
skip = "test_success"
remoteFile = "tests/testfile.txt"
remoteFile = "${baseDir}/tests/testfile.txt"
}
}

Expand All @@ -36,7 +36,7 @@ nextflow_pipeline {
assert workflow.trace.tasks().size() == 12
assert workflow.trace.succeeded().size() == 11
assert workflow.trace.failed().size() == 1
assert snapshot(workflow.out, path("work/outputs").list()).match()
assert snapshot(path("work/outputs").list()).match()
}

}
Expand All @@ -47,7 +47,7 @@ nextflow_pipeline {
when {
params {
run = "test_success"
remoteFile = "tests/testfile.txt"
remoteFile = "$baseDir/tests/testfile.txt"
}
}

Expand All @@ -56,7 +56,7 @@ nextflow_pipeline {
assert workflow.trace.tasks().size() == 1
assert workflow.trace.succeeded().size() == 1
assert workflow.trace.failed().size() == 0
assert snapshot(workflow.out, path("work/outputs").list()).match()
assert snapshot(path("work/outputs").list()).match()
}

}
Expand All @@ -74,7 +74,7 @@ nextflow_pipeline {
assert workflow.trace.tasks().size() == 12
assert workflow.trace.succeeded().size() == 11
assert workflow.trace.failed().size() == 1
assert snapshot(workflow.out, path(params.outdir).list()).match()
assert snapshot(path(params.outdir).list()).match()
}

}
Expand Down
70 changes: 21 additions & 49 deletions tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,70 +1,42 @@
{
"Should skip TEST_SUCCESS": {
"content": [
{

}
],
"timestamp": "2023-08-18T11:05:34+0000"
},
"Should skip a process": {
"content": [
{

},
[
[
"test1.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"test2.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
"test1.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"test2.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"timestamp": "2023-08-18T11:05:34+0000"
"timestamp": "2023-10-04T11:44:43.844549"
},
"Should publish to alternative directory": {
"content": [
{

},
[
[
"test1.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"test2.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
"test1.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"test2.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"timestamp": "2023-08-18T11:05:34+0000"
"timestamp": "2023-10-04T11:44:48.06743"
},
"Should only run one process": {
"content": [
{

},
[
[
"test1.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"test2.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
"test1.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"test2.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"timestamp": "2023-08-18T11:05:34+0000"
"timestamp": "2023-10-04T11:44:45.712702"
},
"Should run without failures": {
"content": [
{

},
[
[
"test1.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"test2.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
"test1.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"test2.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"timestamp": "2023-08-18T11:05:34+0000"
"timestamp": "2023-10-04T11:44:41.565486"
}
}
}
2 changes: 1 addition & 1 deletion tests/main.test_stage_remote.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nextflow_process {
when {

params {
remoteFile = "tests/testfile.txt"
remoteFile = "${baseDir}/tests/testfile.txt"
}

process {
Expand Down
3 changes: 2 additions & 1 deletion tests/main.test_success.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ nextflow_process {

then {
assert process.success
assert snapshot(process.out).match()
assert process.exitStatus == 0
assert process.trace.tasks().size() == 1
}

}
Expand Down

0 comments on commit 7185d96

Please sign in to comment.