diff --git a/modules/nf-core/authentict/deam2cont/environment.yml b/modules/nf-core/authentict/deam2cont/environment.yml index a6bbfba4b39e..e6554d484189 100644 --- a/modules/nf-core/authentict/deam2cont/environment.yml +++ b/modules/nf-core/authentict/deam2cont/environment.yml @@ -5,3 +5,4 @@ channels: - bioconda dependencies: - bioconda::authentict=1.0.1 + - bioconda::samtools=1.16.1 diff --git a/modules/nf-core/authentict/deam2cont/main.nf b/modules/nf-core/authentict/deam2cont/main.nf index b7b71f6ddbfd..1f55684b02d5 100644 --- a/modules/nf-core/authentict/deam2cont/main.nf +++ b/modules/nf-core/authentict/deam2cont/main.nf @@ -41,4 +41,16 @@ process AUTHENTICT_DEAM2CONT { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub : + prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${prefix}.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + authentict: \$(echo \$(AuthentiCT --version 2>&1) ) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/authentict/deam2cont/tests/main.nf.test b/modules/nf-core/authentict/deam2cont/tests/main.nf.test new file mode 100644 index 000000000000..191ff97dc6ec --- /dev/null +++ b/modules/nf-core/authentict/deam2cont/tests/main.nf.test @@ -0,0 +1,75 @@ +nextflow_process { + + name "Test Process AUTHENTICT_DEAM2CONT" + + script "../main.nf" + process "AUTHENTICT_DEAM2CONT" + + tag "modules" + tag "modules_nfcore" + tag "authentict" + tag "authentict/deam2cont" + tag "samtools" + tag "samtools/calmd" + + setup { + run("SAMTOOLS_CALMD") { + script "../../../samtools/calmd/main.nf" + + process { + """ + input[0] = [ + [id:'test',single_end:false],// meta map + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam",checkIfExists:true) + ] + input[1] = [ + [id : "genome"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta",checkIfExists:true) + ] + """ + } + } + } + + test("test_authentict_deam2cont") { + when { + process { + """ + input[0] = SAMTOOLS_CALMD.out.bam + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_authentict_deam2cont - stub") { + + options '-stub' + + when { + process { + """ + input[0] = SAMTOOLS_CALMD.out.bam + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out, + process.out.versions.collect{path(it).yaml} + ).match() } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/authentict/deam2cont/tests/main.nf.test.snap b/modules/nf-core/authentict/deam2cont/tests/main.nf.test.snap new file mode 100644 index 000000000000..af7a48a1138a --- /dev/null +++ b/modules/nf-core/authentict/deam2cont/tests/main.nf.test.snap @@ -0,0 +1,80 @@ +{ + "test_authentict_deam2cont - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,961ace1ec9622bad5cf075b76410bdd2" + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,961ace1ec9622bad5cf075b76410bdd2" + ] + }, + [ + { + "AUTHENTICT_DEAM2CONT": { + "authentict": "1.0.1", + "samtools": "1.16.1" + } + } + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-24T11:23:39.766851518" + }, + "test_authentict_deam2cont": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,ab81cf4fbb7eedea260798c5bcad6a5d" + ] + ], + "1": [ + "versions.yml:md5,961ace1ec9622bad5cf075b76410bdd2" + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,ab81cf4fbb7eedea260798c5bcad6a5d" + ] + ], + "versions": [ + "versions.yml:md5,961ace1ec9622bad5cf075b76410bdd2" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-24T11:23:30.499727901" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 4bafcd29c484..0f88dcac49fb 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1,6 +1,3 @@ -authentict/deam2cont: - - modules/nf-core/authentict/deam2cont/** - - tests/modules/nf-core/authentict/deam2cont/** bamtools/convert: - modules/nf-core/bamtools/convert/** - tests/modules/nf-core/bamtools/convert/** diff --git a/tests/modules/nf-core/authentict/deam2cont/main.nf b/tests/modules/nf-core/authentict/deam2cont/main.nf deleted file mode 100644 index 99a48700deef..000000000000 --- a/tests/modules/nf-core/authentict/deam2cont/main.nf +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { AUTHENTICT_DEAM2CONT } from '../../../../../modules/nf-core/authentict/deam2cont/main.nf' -include { SAMTOOLS_CALMD } from '../../../../../modules/nf-core/samtools/calmd/main.nf' - -workflow test_authentict_deam2cont { - - input1 = [ - [ id:'test', single_end:false ], // meta map - file("https://github.com/nf-core/test-datasets/raw/modules/data/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam", checkIfExists: true) - ] - - input2 = file("https://github.com/nf-core/test-datasets/raw/modules/data/genomics/homo_sapiens/genome/genome.fasta", checkIfExists: true) - SAMTOOLS_CALMD ( input1, input2 ) - - AUTHENTICT_DEAM2CONT ( SAMTOOLS_CALMD.out.bam, [[], []], [[], []] ) -} diff --git a/tests/modules/nf-core/authentict/deam2cont/nextflow.config b/tests/modules/nf-core/authentict/deam2cont/nextflow.config deleted file mode 100644 index 50f50a7a3579..000000000000 --- a/tests/modules/nf-core/authentict/deam2cont/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/authentict/deam2cont/test.yml b/tests/modules/nf-core/authentict/deam2cont/test.yml deleted file mode 100644 index 7d22ab548422..000000000000 --- a/tests/modules/nf-core/authentict/deam2cont/test.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: authentict deam2cont test_authentict_deam2cont - command: nextflow run ./tests/modules/nf-core/authentict/deam2cont -entry test_authentict_deam2cont -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/authentict/deam2cont/nextflow.config - tags: - - authentict - - authentict/deam2cont - files: - - path: output/authentict/test.txt - md5sum: ab81cf4fbb7eedea260798c5bcad6a5d - - path: output/authentict/versions.yml - - path: output/samtools/test.bam - md5sum: 2ba8c7adecca133d6c3f0654e3abd541 - - path: output/samtools/versions.yml