Skip to content

Commit

Permalink
Added nf-test for mcroni (#6499)
Browse files Browse the repository at this point in the history
Co-authored-by: Famke Bäuerle <[email protected]>
  • Loading branch information
GallVp and famosab authored Aug 30, 2024
1 parent 17b8bed commit 5110fcc
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 29 deletions.
13 changes: 13 additions & 0 deletions modules/nf-core/mcroni/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,17 @@ process MCRONI {
mcroni: $VERSION
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '1.0.4' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${prefix}.tsv
touch ${prefix}.fa
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mcroni: $VERSION
END_VERSIONS
"""
}
3 changes: 2 additions & 1 deletion modules/nf-core/mcroni/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ description: Analysis of mcr-1 gene (mobilized colistin resistance) for sequence
keywords:
- resistance
- fasta
- mcr-1
tools:
- "mcroni":
description: "Scripts for finding and processing promoter variants upstream of mcr-1"
homepage: "https://github.com/liampshaw/mcroni"
documentation: "https://github.com/liampshaw/mcroni"
tool_dev_url: "https://github.com/liampshaw/mcroni"
licence: "['MIT']"
licence: ["MIT"]
input:
- meta:
type: map
Expand Down
57 changes: 57 additions & 0 deletions modules/nf-core/mcroni/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "mcroni"

test("test-mcroni") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}

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

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

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}

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

}
96 changes: 96 additions & 0 deletions modules/nf-core/mcroni/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"test-mcroni-stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,0db3954c37fd7f15463e1ca4736a5910"
],
"fa": [
[
{
"id": "test",
"single_end": false
},
"test.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,0db3954c37fd7f15463e1ca4736a5910"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-30T21:49:02.89158"
},
"test-mcroni": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test_table.tsv:md5,64f8438dcc476e8b4d762fedc2e3f69e"
]
],
"1": [

],
"2": [
"versions.yml:md5,0db3954c37fd7f15463e1ca4736a5910"
],
"fa": [

],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test_table.tsv:md5,64f8438dcc476e8b4d762fedc2e3f69e"
]
],
"versions": [
"versions.yml:md5,0db3954c37fd7f15463e1ca4736a5910"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-30T21:48:58.741484"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,6 @@ mashtree:
maxquant/lfq:
- modules/nf-core/maxquant/lfq/**
- tests/modules/nf-core/maxquant/lfq/**
mcroni:
- modules/nf-core/mcroni/**
- tests/modules/nf-core/mcroni/**
megan/daa2info:
- modules/nf-core/megan/daa2info/**
- tests/modules/nf-core/megan/daa2info/**
Expand Down
13 changes: 0 additions & 13 deletions tests/modules/nf-core/mcroni/main.nf

This file was deleted.

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

This file was deleted.

7 changes: 0 additions & 7 deletions tests/modules/nf-core/mcroni/test.yml

This file was deleted.

0 comments on commit 5110fcc

Please sign in to comment.