diff --git a/modules/nf-core/hmmer/hmmfetch/tests/main.nf.test b/modules/nf-core/hmmer/hmmfetch/tests/main.nf.test new file mode 100644 index 00000000000..46c7b58fcc2 --- /dev/null +++ b/modules/nf-core/hmmer/hmmfetch/tests/main.nf.test @@ -0,0 +1,115 @@ + +nextflow_process { + + name "Test Process HMMER_HMMFETCH" + script "../main.nf" + process "HMMER_HMMFETCH" + + tag "modules" + tag "modules_nfcore" + tag "hmmer" + tag "hmmer/hmmfetch" + + test("test-hmmer-hmmfetch-key") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file('https://raw.githubusercontent.com/tseemann/barrnap/master/db/arc.hmm') + ] + input[1] = '16S_rRNA' + input[2] = [] + input[3] = [] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-hmmer-hmmfetch-keyfile") { + + when { + process { + """ + keyfile = Channel.of('16S_rRNA', '23S_rRNA').collectFile(name: 'keys.txt', newLine: true) + + input[0] = [ + [ id:'test', single_end:false ], + file('https://raw.githubusercontent.com/tseemann/barrnap/master/db/arc.hmm') + ] + input[1] = [] + input[2] = keyfile + input[3] = [] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-hmmer-hmmfetch-index") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file('https://raw.githubusercontent.com/tseemann/barrnap/master/db/arc.hmm') + ] + input[1] = [] + input[2] = [] + input[3] = [] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-hmmer-hmmfetch-index-stub") { + options '-stub' + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file('https://raw.githubusercontent.com/tseemann/barrnap/master/db/arc.hmm') + ] + input[1] = [] + input[2] = [] + input[3] = [] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/hmmer/hmmfetch/tests/main.nf.test.snap b/modules/nf-core/hmmer/hmmfetch/tests/main.nf.test.snap new file mode 100644 index 00000000000..d934b779abe --- /dev/null +++ b/modules/nf-core/hmmer/hmmfetch/tests/main.nf.test.snap @@ -0,0 +1,166 @@ +{ + "test-hmmer-hmmfetch-index": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "arc.hmm.ssi:md5,17a7bb35662baabb5b1474660d072fb6" + ] + ], + "2": [ + "versions.yml:md5,ca18131840322abff960ba5c09f91a5a" + ], + "hmm": [ + + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "arc.hmm.ssi:md5,17a7bb35662baabb5b1474660d072fb6" + ] + ], + "versions": [ + "versions.yml:md5,ca18131840322abff960ba5c09f91a5a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T21:24:45.824243" + }, + "test-hmmer-hmmfetch-index-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hmm:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,ca18131840322abff960ba5c09f91a5a" + ], + "hmm": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hmm:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "index": [ + + ], + "versions": [ + "versions.yml:md5,ca18131840322abff960ba5c09f91a5a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T21:24:50.535566" + }, + "test-hmmer-hmmfetch-keyfile": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hmm:md5,0e5c7e77342ec91bc6fac2a7a0228d08" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,ca18131840322abff960ba5c09f91a5a" + ], + "hmm": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hmm:md5,0e5c7e77342ec91bc6fac2a7a0228d08" + ] + ], + "index": [ + + ], + "versions": [ + "versions.yml:md5,ca18131840322abff960ba5c09f91a5a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T21:29:44.506723" + }, + "test-hmmer-hmmfetch-key": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hmm:md5,0328406a7469af6f24e2157b0367705f" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,ca18131840322abff960ba5c09f91a5a" + ], + "hmm": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hmm:md5,0328406a7469af6f24e2157b0367705f" + ] + ], + "index": [ + + ], + "versions": [ + "versions.yml:md5,ca18131840322abff960ba5c09f91a5a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T21:24:38.347449" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 2335353adda..e69c1af15c9 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -359,9 +359,6 @@ hmmer/hmmalign: hmmer/hmmbuild: - modules/nf-core/hmmer/hmmbuild/** - tests/modules/nf-core/hmmer/hmmbuild/** -hmmer/hmmfetch: - - modules/nf-core/hmmer/hmmfetch/** - - tests/modules/nf-core/hmmer/hmmfetch/** hmtnote/annotate: - modules/nf-core/hmtnote/annotate/** - tests/modules/nf-core/hmtnote/annotate/** diff --git a/tests/modules/nf-core/hmmer/hmmfetch/main.nf b/tests/modules/nf-core/hmmer/hmmfetch/main.nf deleted file mode 100644 index db24e553a4e..00000000000 --- a/tests/modules/nf-core/hmmer/hmmfetch/main.nf +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { HMMER_HMMFETCH } from '../../../../../modules/nf-core/hmmer/hmmfetch/main.nf' - -workflow test_hmmer_hmmfetch_key { - - input = [ - [ id:'test', single_end:false ], - file('https://raw.githubusercontent.com/tseemann/barrnap/master/db/arc.hmm') - ] - - HMMER_HMMFETCH ( input, '16S_rRNA', [], [] ) -} - -workflow test_hmmer_hmmfetch_keyfile { - - input = [ - [ id:'test', single_end:false ], - file('https://raw.githubusercontent.com/tseemann/barrnap/master/db/arc.hmm') - ] - - Channel - .of('16S_rRNA', '23S_rRNA') - .collectFile(name: 'keys.txt', newLine: true) - .set { keyfile } - - HMMER_HMMFETCH ( input, [], keyfile, [] ) -} - -workflow test_hmmer_hmmfetch_index { - - input = [ - [ id:'test', single_end:false ], - file('https://raw.githubusercontent.com/tseemann/barrnap/master/db/arc.hmm') - ] - - HMMER_HMMFETCH ( input, [], [], [] ) -} diff --git a/tests/modules/nf-core/hmmer/hmmfetch/nextflow.config b/tests/modules/nf-core/hmmer/hmmfetch/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/hmmer/hmmfetch/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/hmmer/hmmfetch/test.yml b/tests/modules/nf-core/hmmer/hmmfetch/test.yml deleted file mode 100644 index f602892a586..00000000000 --- a/tests/modules/nf-core/hmmer/hmmfetch/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -- name: hmmer hmmfetch test_hmmer_hmmfetch_key - command: nextflow run ./tests/modules/nf-core/hmmer/hmmfetch -entry test_hmmer_hmmfetch_key -c ./tests/config/nextflow.config - tags: - - hmmer/hmmfetch - - hmmer - files: - - path: output/hmmer/test.hmm - md5sum: 0328406a7469af6f24e2157b0367705f - - path: output/hmmer/versions.yml - -- name: hmmer hmmfetch test_hmmer_hmmfetch_keyfile - command: nextflow run ./tests/modules/nf-core/hmmer/hmmfetch -entry test_hmmer_hmmfetch_keyfile -c ./tests/config/nextflow.config - tags: - - hmmer/hmmfetch - - hmmer - files: - - path: output/hmmer/test.hmm - md5sum: 0e5c7e77342ec91bc6fac2a7a0228d08 - - path: output/hmmer/versions.yml - -- name: hmmer hmmfetch test_hmmer_hmmfetch_index - command: nextflow run ./tests/modules/nf-core/hmmer/hmmfetch -entry test_hmmer_hmmfetch_index -c ./tests/config/nextflow.config - tags: - - hmmer/hmmfetch - - hmmer - files: - - path: output/hmmer/arc.hmm.ssi - md5sum: 17a7bb35662baabb5b1474660d072fb6 - - path: output/hmmer/versions.yml