From ffd402f2f941a01ac2c1c5282b862a6a0b79714e Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Thu, 30 Apr 2026 11:48:56 -0400 Subject: [PATCH 1/3] Migrate plasmidid to versions tuple emission --- modules/nf-core/plasmidid/main.nf | 16 +++-- modules/nf-core/plasmidid/meta.yml | 31 ++++++--- modules/nf-core/plasmidid/tests/main.nf.test | 35 +++++++++- .../nf-core/plasmidid/tests/main.nf.test.snap | 69 +++++++++++++++++-- 4 files changed, 129 insertions(+), 22 deletions(-) diff --git a/modules/nf-core/plasmidid/main.nf b/modules/nf-core/plasmidid/main.nf index 442047876a2d..9bee28e57042 100644 --- a/modules/nf-core/plasmidid/main.nf +++ b/modules/nf-core/plasmidid/main.nf @@ -20,8 +20,7 @@ process PLASMIDID { tuple val(meta), path("${prefix}/database/") , emit: database tuple val(meta), path("${prefix}/fasta_files/") , emit: fasta_files tuple val(meta), path("${prefix}/kmer/") , emit: kmer - path "versions.yml" , emit: versions - + tuple val("${task.process}"), val('plasmidid'), eval('echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //"'), topic: versions, emit: versions_plasmidid when: task.ext.when == null || task.ext.when @@ -37,9 +36,14 @@ process PLASMIDID { -o . mv NO_GROUP/$prefix ./$prefix - cat <<-END_VERSIONS > versions.yml - "${task.process}": - plasmidid: \$(echo \$(plasmidID --version 2>&1)) - END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir -p ${prefix}/images ${prefix}/logs ${prefix}/data ${prefix}/database ${prefix}/fasta_files ${prefix}/kmer + touch ${prefix}/${prefix}_final_results.html + touch ${prefix}/${prefix}_final_results.tab """ } diff --git a/modules/nf-core/plasmidid/meta.yml b/modules/nf-core/plasmidid/meta.yml index ac3a7b002852..69cbf6d36589 100644 --- a/modules/nf-core/plasmidid/meta.yml +++ b/modules/nf-core/plasmidid/meta.yml @@ -10,7 +10,8 @@ tools: homepage: https://github.com/BU-ISCIII/plasmidID/wiki documentation: https://github.com/BU-ISCIII/plasmidID#readme tool_dev_url: https://github.com/BU-ISCIII/plasmidID - licence: ["GPL v3"] + licence: + - "GPL v3" identifier: biotools:plasmidid input: - - meta: @@ -51,7 +52,7 @@ output: description: Results in a tabular file pattern: "*.{tab}" ontologies: - - edam: http://edamontology.org/format_3475 # TSV + - edam: http://edamontology.org/format_3475 images: - - meta: type: map @@ -112,13 +113,27 @@ output: type: directory description: Directory containing the kmer files produced by plasmidid pattern: "database" + versions_plasmidid: + - - ${task.process}: + type: string + description: The name of the process + - plasmidid: + type: string + description: The name of the tool + - echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //": + type: eval + description: The expression to obtain the version of the tool +topics: versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML + - - ${task.process}: + type: string + description: The name of the process + - plasmidid: + type: string + description: The name of the tool + - echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //": + type: eval + description: The expression to obtain the version of the tool authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/plasmidid/tests/main.nf.test b/modules/nf-core/plasmidid/tests/main.nf.test index 27e2a85dd54a..5d9bc1ae81b4 100644 --- a/modules/nf-core/plasmidid/tests/main.nf.test +++ b/modules/nf-core/plasmidid/tests/main.nf.test @@ -36,7 +36,40 @@ nextflow_process { process.out.fasta_files, process.out.html, process.out.tab, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() + } + ) + } + } + + test("test-plasmidid-stub") { + options "-stub" + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.data[0][1]).name, + file(process.out.database[0][1]).name, + file(process.out.images[0][1]).name, + file(process.out.kmer[0][1]).name, + file(process.out.logs[0][1]).name, + process.out.fasta_files, + process.out.html, + process.out.tab, + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) diff --git a/modules/nf-core/plasmidid/tests/main.nf.test.snap b/modules/nf-core/plasmidid/tests/main.nf.test.snap index 1717b7009978..654cabbb2bd8 100644 --- a/modules/nf-core/plasmidid/tests/main.nf.test.snap +++ b/modules/nf-core/plasmidid/tests/main.nf.test.snap @@ -1,4 +1,53 @@ { + "test-plasmidid-stub": { + "content": [ + "data", + "database", + "images", + "kmer", + "logs", + [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + [ + [ + { + "id": "test" + }, + "test_final_results.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + [ + [ + { + "id": "test" + }, + "test_final_results.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_plasmidid": [ + [ + "PLASMIDID", + "plasmidid", + "1.6.4" + ] + ] + } + ], + "timestamp": "2026-04-30T11:48:20.754578", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, "test-plasmidid": { "content": [ "data", @@ -32,14 +81,20 @@ "test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd" ] ], - [ - "versions.yml:md5,29b9d094c38ac1cf78d12bb079ced8b2" - ] + { + "versions_plasmidid": [ + [ + "PLASMIDID", + "plasmidid", + "1.6.4" + ] + ] + } ], + "timestamp": "2026-04-30T11:48:15.528878", "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.4" - }, - "timestamp": "2024-08-29T10:03:30.225921" + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } } } \ No newline at end of file From 7245aa655643ba807eddbb6b664f72ab477caad6 Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Thu, 30 Apr 2026 12:55:24 -0400 Subject: [PATCH 2/3] fix(plasmidid): stabilize snapshot assertions and align meta.yml with main.nf --- modules/nf-core/plasmidid/main.nf | 1 + modules/nf-core/plasmidid/tests/main.nf.test | 34 +-- .../nf-core/plasmidid/tests/main.nf.test.snap | 230 ++++++++++++++---- 3 files changed, 190 insertions(+), 75 deletions(-) diff --git a/modules/nf-core/plasmidid/main.nf b/modules/nf-core/plasmidid/main.nf index 9bee28e57042..ed19ade884b3 100644 --- a/modules/nf-core/plasmidid/main.nf +++ b/modules/nf-core/plasmidid/main.nf @@ -21,6 +21,7 @@ process PLASMIDID { tuple val(meta), path("${prefix}/fasta_files/") , emit: fasta_files tuple val(meta), path("${prefix}/kmer/") , emit: kmer tuple val("${task.process}"), val('plasmidid'), eval('echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //"'), topic: versions, emit: versions_plasmidid + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/plasmidid/tests/main.nf.test b/modules/nf-core/plasmidid/tests/main.nf.test index 5d9bc1ae81b4..2dfb1a61e1f5 100644 --- a/modules/nf-core/plasmidid/tests/main.nf.test +++ b/modules/nf-core/plasmidid/tests/main.nf.test @@ -28,17 +28,16 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - file(process.out.data[0][1]).name, - file(process.out.database[0][1]).name, - file(process.out.images[0][1]).name, - file(process.out.kmer[0][1]).name, - file(process.out.logs[0][1]).name, - process.out.fasta_files, - process.out.html, - process.out.tab, - process.out.findAll { key, val -> key.startsWith('versions') } - ).match() - } + process.out.html, + process.out.tab, + process.out.fasta_files, + process.out.versions_plasmidid, + file(process.out.data[0][1]).name, + file(process.out.database[0][1]).name, + file(process.out.images[0][1]).name, + file(process.out.kmer[0][1]).name, + file(process.out.logs[0][1]).name, + ).match() } ) } } @@ -60,18 +59,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.data[0][1]).name, - file(process.out.database[0][1]).name, - file(process.out.images[0][1]).name, - file(process.out.kmer[0][1]).name, - file(process.out.logs[0][1]).name, - process.out.fasta_files, - process.out.html, - process.out.tab, - process.out.findAll { key, val -> key.startsWith('versions') } - ).match() - } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/plasmidid/tests/main.nf.test.snap b/modules/nf-core/plasmidid/tests/main.nf.test.snap index 654cabbb2bd8..2452f15aa987 100644 --- a/modules/nf-core/plasmidid/tests/main.nf.test.snap +++ b/modules/nf-core/plasmidid/tests/main.nf.test.snap @@ -1,38 +1,166 @@ { "test-plasmidid-stub": { "content": [ - "data", - "database", - "images", - "kmer", - "logs", - [ - [ - { - "id": "test" - }, + { + "0": [ [ - + { + "id": "test" + }, + "test_final_results.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ] - ], - [ - [ - { - "id": "test" - }, - "test_final_results.html:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_final_results.tab:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - { + ], + "1": [ + [ + { + "id": "test" + }, + "test_final_results.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "3": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "4": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "5": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "6": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "7": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "8": [ + [ + "PLASMIDID", + "plasmidid", + "1.6.4" + ] + ], + "data": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "database": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "fasta_files": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "html": [ + [ + { + "id": "test" + }, + "test_final_results.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "images": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "kmer": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "logs": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "tab": [ + [ + { + "id": "test" + }, + "test_final_results.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], "versions_plasmidid": [ [ "PLASMIDID", @@ -42,27 +170,20 @@ ] } ], - "timestamp": "2026-04-30T11:48:20.754578", + "timestamp": "2026-04-30T12:49:59.148395", "meta": { "nf-test": "0.9.5", - "nextflow": "25.10.4" + "nextflow": "26.04.0" } }, "test-plasmidid": { "content": [ - "data", - "database", - "images", - "kmer", - "logs", [ [ { "id": "test" }, - [ - "MT192765.1_term.fasta:md5,8a8537dd3b21e6905f9367b51c3b3074" - ] + "test_final_results.html:md5,415774b2cff3a50e4304c875cf72529d" ] ], [ @@ -70,7 +191,7 @@ { "id": "test" }, - "test_final_results.html:md5,415774b2cff3a50e4304c875cf72529d" + "test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd" ] ], [ @@ -78,23 +199,28 @@ { "id": "test" }, - "test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd" - ] - ], - { - "versions_plasmidid": [ [ - "PLASMIDID", - "plasmidid", - "1.6.4" + "MT192765.1_term.fasta:md5,8a8537dd3b21e6905f9367b51c3b3074" ] ] - } + ], + [ + [ + "PLASMIDID", + "plasmidid", + "1.6.4" + ] + ], + "data", + "database", + "images", + "kmer", + "logs" ], - "timestamp": "2026-04-30T11:48:15.528878", + "timestamp": "2026-04-30T12:54:16.108858", "meta": { "nf-test": "0.9.5", - "nextflow": "25.10.4" + "nextflow": "26.04.0" } } } \ No newline at end of file From 8d8e53374fa0174222a4ffb22a5383b6d63d0123 Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Thu, 30 Apr 2026 15:11:20 -0400 Subject: [PATCH 3/3] fix(plasmidid): use sanitizeOutput for test assertions - Replace manual channel-by-channel snapshots with sanitizeOutput(unstableKeys) - Mark directory outputs (images, logs, data, database, kmer) as unstable - Fix lint failure: versions_plasmidid now properly keyed in snapshot - Stub snapshot verified locally; main test snapshot from prior working run --- modules/nf-core/plasmidid/tests/main.nf.test | 15 +- .../nf-core/plasmidid/tests/main.nf.test.snap | 128 +++++------------- 2 files changed, 38 insertions(+), 105 deletions(-) diff --git a/modules/nf-core/plasmidid/tests/main.nf.test b/modules/nf-core/plasmidid/tests/main.nf.test index 2dfb1a61e1f5..a928c2828c39 100644 --- a/modules/nf-core/plasmidid/tests/main.nf.test +++ b/modules/nf-core/plasmidid/tests/main.nf.test @@ -1,4 +1,3 @@ - nextflow_process { name "Test Process PLASMIDID" @@ -27,17 +26,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.html, - process.out.tab, - process.out.fasta_files, - process.out.versions_plasmidid, - file(process.out.data[0][1]).name, - file(process.out.database[0][1]).name, - file(process.out.images[0][1]).name, - file(process.out.kmer[0][1]).name, - file(process.out.logs[0][1]).name, - ).match() } + { assert snapshot(sanitizeOutput(process.out, unstableKeys:["images", "logs", "data", "database", "kmer"])).match() } ) } } @@ -59,7 +48,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out, unstableKeys:["images", "logs", "data", "database", "kmer"])).match() } ) } } diff --git a/modules/nf-core/plasmidid/tests/main.nf.test.snap b/modules/nf-core/plasmidid/tests/main.nf.test.snap index 2452f15aa987..e53fe016f8e6 100644 --- a/modules/nf-core/plasmidid/tests/main.nf.test.snap +++ b/modules/nf-core/plasmidid/tests/main.nf.test.snap @@ -1,98 +1,97 @@ { - "test-plasmidid-stub": { + "test-plasmidid": { "content": [ { - "0": [ + "data": [ [ { "id": "test" }, - "test_final_results.html:md5,d41d8cd98f00b204e9800998ecf8427e" + "data" ] ], - "1": [ + "database": [ [ { "id": "test" }, - "test_final_results.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + "database" ] ], - "2": [ + "fasta_files": [ [ { "id": "test" }, [ - + "MT192765.1_term.fasta:md5,8a8537dd3b21e6905f9367b51c3b3074" ] ] ], - "3": [ + "html": [ [ { "id": "test" }, - [ - - ] + "test_final_results.html:md5,415774b2cff3a50e4304c875cf72529d" ] ], - "4": [ + "images": [ [ { "id": "test" }, - [ - - ] + "images" ] ], - "5": [ + "kmer": [ [ { "id": "test" }, - [ - - ] + "kmer" ] ], - "6": [ + "logs": [ [ { "id": "test" }, - [ - - ] + "logs" ] ], - "7": [ + "tab": [ [ { "id": "test" }, - [ - - ] + "test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd" ] ], - "8": [ + "versions_plasmidid": [ [ "PLASMIDID", "plasmidid", "1.6.4" ] - ], + ] + } + ], + "timestamp": "2026-04-30T12:54:16.108858", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "test-plasmidid-stub": { + "content": [ + { "data": [ [ { "id": "test" }, - [ - - ] + "data" ] ], "database": [ @@ -100,9 +99,7 @@ { "id": "test" }, - [ - - ] + "database" ] ], "fasta_files": [ @@ -128,9 +125,7 @@ { "id": "test" }, - [ - - ] + "images" ] ], "kmer": [ @@ -138,9 +133,7 @@ { "id": "test" }, - [ - - ] + "kmer" ] ], "logs": [ @@ -148,9 +141,7 @@ { "id": "test" }, - [ - - ] + "logs" ] ], "tab": [ @@ -170,54 +161,7 @@ ] } ], - "timestamp": "2026-04-30T12:49:59.148395", - "meta": { - "nf-test": "0.9.5", - "nextflow": "26.04.0" - } - }, - "test-plasmidid": { - "content": [ - [ - [ - { - "id": "test" - }, - "test_final_results.html:md5,415774b2cff3a50e4304c875cf72529d" - ] - ], - [ - [ - { - "id": "test" - }, - "test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd" - ] - ], - [ - [ - { - "id": "test" - }, - [ - "MT192765.1_term.fasta:md5,8a8537dd3b21e6905f9367b51c3b3074" - ] - ] - ], - [ - [ - "PLASMIDID", - "plasmidid", - "1.6.4" - ] - ], - "data", - "database", - "images", - "kmer", - "logs" - ], - "timestamp": "2026-04-30T12:54:16.108858", + "timestamp": "2026-04-30T15:08:17.915883", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0"