diff --git a/modules/nf-core/mcroni/main.nf b/modules/nf-core/mcroni/main.nf index 0a1f87ed301..2bfac7c8084 100644 --- a/modules/nf-core/mcroni/main.nf +++ b/modules/nf-core/mcroni/main.nf @@ -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 + """ } diff --git a/modules/nf-core/mcroni/meta.yml b/modules/nf-core/mcroni/meta.yml index 895e8fc3cc5..570a9cca160 100644 --- a/modules/nf-core/mcroni/meta.yml +++ b/modules/nf-core/mcroni/meta.yml @@ -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 diff --git a/modules/nf-core/mcroni/tests/main.nf.test b/modules/nf-core/mcroni/tests/main.nf.test new file mode 100644 index 00000000000..10c0f89445f --- /dev/null +++ b/modules/nf-core/mcroni/tests/main.nf.test @@ -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() } + ) + } + } + +} diff --git a/modules/nf-core/mcroni/tests/main.nf.test.snap b/modules/nf-core/mcroni/tests/main.nf.test.snap new file mode 100644 index 00000000000..74bff8d0b7a --- /dev/null +++ b/modules/nf-core/mcroni/tests/main.nf.test.snap @@ -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" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 26e783a1d93..95bb39c8ae4 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -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/** diff --git a/tests/modules/nf-core/mcroni/main.nf b/tests/modules/nf-core/mcroni/main.nf deleted file mode 100644 index c1eeeb5fa30..00000000000 --- a/tests/modules/nf-core/mcroni/main.nf +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { MCRONI } from '../../../../modules/nf-core/mcroni/main.nf' - -workflow test_mcroni { - - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] - - MCRONI ( input ) -} diff --git a/tests/modules/nf-core/mcroni/nextflow.config b/tests/modules/nf-core/mcroni/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/mcroni/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file diff --git a/tests/modules/nf-core/mcroni/test.yml b/tests/modules/nf-core/mcroni/test.yml deleted file mode 100644 index 83656baa466..00000000000 --- a/tests/modules/nf-core/mcroni/test.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: mcroni test_mcroni - command: nextflow run ./tests/modules/nf-core/mcroni -entry test_mcroni -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/mcroni/nextflow.config - tags: - - mcroni - files: - - path: output/mcroni/test_table.tsv - md5sum: 64f8438dcc476e8b4d762fedc2e3f69e