Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added nf-test for minia #6564

Merged
merged 1 commit into from
Sep 5, 2024
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
13 changes: 13 additions & 0 deletions modules/nf-core/minia/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,17 @@ process MINIA {
minia: \$(echo \$(minia --version 2>&1 | grep Minia) | sed 's/^.*Minia version //;')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.contigs.fa
touch ${prefix}.unitigs.fa
touch ${prefix}.h5

cat <<-END_VERSIONS > versions.yml
"${task.process}":
minia: \$(echo \$(minia --version 2>&1 | grep Minia) | sed 's/^.*Minia version //;')
END_VERSIONS
"""
}
4 changes: 3 additions & 1 deletion modules/nf-core/minia/meta.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: minia
description: Minia is a short-read assembler based on a de Bruijn graph
keywords:
- assembly
- assembler
- short-read
- de Bruijn
tools:
- minia:
description: |
Expand Down
71 changes: 71 additions & 0 deletions modules/nf-core/minia/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "minia"

test("test-minia") {

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]

"""
}
}

then {
assertAll(
{ assert process.success },
{ assert file(process.out.contigs[0][1]).text.contains('AAA') },
{ assert file(process.out.unitigs[0][1]).text.contains('CCC') },
{ assert snapshot(
file(process.out.contigs[0][1]).name,
file(process.out.unitigs[0][1]).name,
file(process.out.h5[0][1]).name,
process.out.versions,
).match()
}
)
}
}

test("test-minia-stub") {
options '-stub'

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]

"""
}
}

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

}
82 changes: 82 additions & 0 deletions modules/nf-core/minia/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"test-minia": {
"content": [
"test.contigs.fa",
"test.unitigs.fa",
"test.h5",
[
"versions.yml:md5,242f8593f9ee8955fb73580c78f30200"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T19:56:44.252673"
},
"test-minia-stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.contigs.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test.unitigs.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
{
"id": "test"
},
"test.h5:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
"versions.yml:md5,242f8593f9ee8955fb73580c78f30200"
],
"contigs": [
[
{
"id": "test"
},
"test.contigs.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"h5": [
[
{
"id": "test"
},
"test.h5:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"unitigs": [
[
{
"id": "test"
},
"test.unitigs.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,242f8593f9ee8955fb73580c78f30200"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T19:52:02.585904"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,6 @@ metaphlan3/metaphlan3:
midas/run:
- modules/nf-core/midas/run/**
- tests/modules/nf-core/midas/run/**
minia:
- modules/nf-core/minia/**
- tests/modules/nf-core/minia/**
mitohifi/findmitoreference:
- modules/nf-core/mitohifi/findmitoreference/**
- tests/modules/nf-core/mitohifi/findmitoreference/**
Expand Down
14 changes: 0 additions & 14 deletions tests/modules/nf-core/minia/main.nf

This file was deleted.

5 changes: 0 additions & 5 deletions tests/modules/nf-core/minia/nextflow.config

This file was deleted.

8 changes: 0 additions & 8 deletions tests/modules/nf-core/minia/test.yml

This file was deleted.

Loading