diff --git a/modules/nf-core/krona/ktupdatetaxonomy/main.nf b/modules/nf-core/krona/ktupdatetaxonomy/main.nf index 4d5149220f4..2586f9ce59b 100644 --- a/modules/nf-core/krona/ktupdatetaxonomy/main.nf +++ b/modules/nf-core/krona/ktupdatetaxonomy/main.nf @@ -8,6 +8,8 @@ process KRONA_KTUPDATETAXONOMY { 'https://depot.galaxyproject.org/singularity/krona:2.7.1--pl526_5' : 'biocontainers/krona:2.7.1--pl526_5' }" + input: + output: path 'taxonomy/taxonomy.tab', emit: db path "versions.yml" , emit: versions @@ -27,4 +29,16 @@ process KRONA_KTUPDATETAXONOMY { krona: $VERSION END_VERSIONS """ + + stub: + """ + mkdir taxonomy + + touch taxonomy/taxonomy.tab + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + krona: $VERSION + END_VERSIONS + """ } diff --git a/modules/nf-core/krona/ktupdatetaxonomy/tests/main.nf.test b/modules/nf-core/krona/ktupdatetaxonomy/tests/main.nf.test new file mode 100644 index 00000000000..6fe91a96da5 --- /dev/null +++ b/modules/nf-core/krona/ktupdatetaxonomy/tests/main.nf.test @@ -0,0 +1,50 @@ + +nextflow_process { + + name "Test Process KRONA_KTUPDATETAXONOMY" + script "../main.nf" + process "KRONA_KTUPDATETAXONOMY" + + tag "modules" + tag "modules_nfcore" + tag "krona" + tag "krona/ktupdatetaxonomy" + + test("test-krona-ktupdatetaxonomy") { + + when { + process { + """ + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-krona-ktupdatetaxonomy-stub") { + options '-stub' + + when { + process { + """ + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/krona/ktupdatetaxonomy/tests/main.nf.test.snap b/modules/nf-core/krona/ktupdatetaxonomy/tests/main.nf.test.snap new file mode 100644 index 00000000000..a2079521168 --- /dev/null +++ b/modules/nf-core/krona/ktupdatetaxonomy/tests/main.nf.test.snap @@ -0,0 +1,48 @@ +{ + "test-krona-ktupdatetaxonomy": { + "content": [ + { + "0": [ + "taxonomy.tab:md5,6d8ea6b7ff721f735412a670805de501" + ], + "1": [ + "versions.yml:md5,a0e095fdd3ba80fcc62188c4c1f38ff7" + ], + "db": [ + "taxonomy.tab:md5,6d8ea6b7ff721f735412a670805de501" + ], + "versions": [ + "versions.yml:md5,a0e095fdd3ba80fcc62188c4c1f38ff7" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T20:28:34.176093" + }, + "test-krona-ktupdatetaxonomy-stub": { + "content": [ + { + "0": [ + "taxonomy.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "1": [ + "versions.yml:md5,a0e095fdd3ba80fcc62188c4c1f38ff7" + ], + "db": [ + "taxonomy.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "versions": [ + "versions.yml:md5,a0e095fdd3ba80fcc62188c4c1f38ff7" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T20:15:46.959212" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 3031d41c39d..63f10b608ab 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -392,9 +392,6 @@ krona/ktimporttaxonomy: krona/ktimporttext: - modules/nf-core/krona/ktimporttext/** - tests/modules/nf-core/krona/ktimporttext/** -krona/ktupdatetaxonomy: - - modules/nf-core/krona/ktupdatetaxonomy/** - - tests/modules/nf-core/krona/ktupdatetaxonomy/** leehom: - modules/nf-core/leehom/** - tests/modules/nf-core/leehom/** diff --git a/tests/modules/nf-core/krona/ktupdatetaxonomy/main.nf b/tests/modules/nf-core/krona/ktupdatetaxonomy/main.nf deleted file mode 100644 index 2323ba7d811..00000000000 --- a/tests/modules/nf-core/krona/ktupdatetaxonomy/main.nf +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { KRONA_KTUPDATETAXONOMY } from '../../../../../modules/nf-core/krona/ktupdatetaxonomy/main.nf' - -workflow test_krona_ktupdatetaxonomy { - KRONA_KTUPDATETAXONOMY ( ) -} diff --git a/tests/modules/nf-core/krona/ktupdatetaxonomy/nextflow.config b/tests/modules/nf-core/krona/ktupdatetaxonomy/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/krona/ktupdatetaxonomy/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} diff --git a/tests/modules/nf-core/krona/ktupdatetaxonomy/test.yml b/tests/modules/nf-core/krona/ktupdatetaxonomy/test.yml deleted file mode 100644 index ae94a2ad3ea..00000000000 --- a/tests/modules/nf-core/krona/ktupdatetaxonomy/test.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: krona ktupdatetaxonomy test_krona_ktupdatetaxonomy - command: nextflow run ./tests/modules/nf-core/krona/ktupdatetaxonomy -entry test_krona_ktupdatetaxonomy -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/krona/ktupdatetaxonomy/nextflow.config - tags: - - krona - - krona/ktupdatetaxonomy - files: - - path: output/krona/taxonomy/taxonomy.tab