Skip to content

Commit

Permalink
Added nf-test for quast (#6554)
Browse files Browse the repository at this point in the history
* Added nf-test for quast

* Update modules/nf-core/quast/tests/main.nf.test

Co-authored-by: Famke Bäuerle <[email protected]>

* Update modules/nf-core/quast/tests/main.nf.test

Co-authored-by: Famke Bäuerle <[email protected]>

* Tests for each optional input and removed pytest

* Removed "ref, nogff" test

---------

Co-authored-by: Famke Bäuerle <[email protected]>
  • Loading branch information
FernandoDuarteF and famosab authored Sep 6, 2024
1 parent 4985203 commit 8afa912
Show file tree
Hide file tree
Showing 7 changed files with 438 additions and 281 deletions.
105 changes: 105 additions & 0 deletions modules/nf-core/quast/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
nextflow_process {

name "Test Process QUAST"
script "../main.nf"
process "QUAST"

tag "modules"
tag "modules_nfcore"
tag "quast"

test("sarscov2 - ref") {

when {
process {
"""
input[0] = [
[ id: 'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)
]
input[1] = [
[ id: 'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)
]
input[2] = [
[ id: 'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert file(process.out.results[0][1]).list().size() == 15 },
{ assert snapshot(
process.out.tsv,
process.out.misassemblies,
process.out.unaligned,
process.out.versions,
).match() }
)
}
}

test("sarscov2 - noref") {

when {
process {
"""
input[0] = [
[ id: 'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)
]
input[1] = [[:],[]]
input[2] = [[:],[]]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert file(process.out.results[0][1]).list().size() == 12 },
{ assert snapshot(
process.out.tsv,
process.out.versions,
).match() }
)
}
}


test("sarscov2 - all - stub") {

options '-stub'

when {
process {
"""
input[0] = [
[ id: 'test1' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)
]
input[1] = [
[ id: 'test1' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)
]
input[2] = [
[ id: 'test1' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
Loading

0 comments on commit 8afa912

Please sign in to comment.