From 176c11c82a322a6882d3c3529d3791e823b6976d Mon Sep 17 00:00:00 2001 From: Felix Lenner <52530259+fellen31@users.noreply.github.com> Date: Tue, 19 Mar 2024 13:00:18 +0100 Subject: [PATCH] Add nf-test to minimap2 index (#5189) * Add nf-test to minimap2 index * correct tags * remove pytest * remove quotation marks --- .../nf-core/minimap2/index/tests/main.nf.test | 32 +++++++++ .../minimap2/index/tests/main.nf.test.snap | 68 +++++++++++++++++++ modules/nf-core/minimap2/index/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/minimap2/index/main.nf | 12 ---- .../nf-core/minimap2/index/nextflow.config | 5 -- tests/modules/nf-core/minimap2/index/test.yml | 8 --- 7 files changed, 102 insertions(+), 28 deletions(-) create mode 100644 modules/nf-core/minimap2/index/tests/main.nf.test create mode 100644 modules/nf-core/minimap2/index/tests/main.nf.test.snap create mode 100644 modules/nf-core/minimap2/index/tests/tags.yml delete mode 100644 tests/modules/nf-core/minimap2/index/main.nf delete mode 100644 tests/modules/nf-core/minimap2/index/nextflow.config delete mode 100644 tests/modules/nf-core/minimap2/index/test.yml diff --git a/modules/nf-core/minimap2/index/tests/main.nf.test b/modules/nf-core/minimap2/index/tests/main.nf.test new file mode 100644 index 00000000000..97840ff75d0 --- /dev/null +++ b/modules/nf-core/minimap2/index/tests/main.nf.test @@ -0,0 +1,32 @@ +nextflow_process { + + name "Test Process MINIMAP2_INDEX" + script "../main.nf" + process "MINIMAP2_INDEX" + + tag "modules" + tag "modules_nfcore" + tag "minimap2" + tag "minimap2/index" + + test("minimap2 index") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/minimap2/index/tests/main.nf.test.snap b/modules/nf-core/minimap2/index/tests/main.nf.test.snap new file mode 100644 index 00000000000..454c834f216 --- /dev/null +++ b/modules/nf-core/minimap2/index/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "Should run without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test_ref" + }, + "genome.mmi:md5,72e450f12dc691e763c697463bdb1571" + ] + ], + "1": [ + "versions.yml:md5,0fced0ee8015e7f50b82566e3db8f7b0" + ], + "index": [ + [ + { + "id": "test_ref" + }, + "genome.mmi:md5,72e450f12dc691e763c697463bdb1571" + ] + ], + "versions": [ + "versions.yml:md5,0fced0ee8015e7f50b82566e3db8f7b0" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T11:46:30.000058092" + }, + "minimap2 index": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.mmi:md5,72e450f12dc691e763c697463bdb1571" + ] + ], + "1": [ + "versions.yml:md5,0fced0ee8015e7f50b82566e3db8f7b0" + ], + "index": [ + [ + { + "id": "test" + }, + "genome.mmi:md5,72e450f12dc691e763c697463bdb1571" + ] + ], + "versions": [ + "versions.yml:md5,0fced0ee8015e7f50b82566e3db8f7b0" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T13:41:53.865122291" + } +} \ No newline at end of file diff --git a/modules/nf-core/minimap2/index/tests/tags.yml b/modules/nf-core/minimap2/index/tests/tags.yml new file mode 100644 index 00000000000..e5ef8e19f3f --- /dev/null +++ b/modules/nf-core/minimap2/index/tests/tags.yml @@ -0,0 +1,2 @@ +minimap2/index: + - modules/nf-core/minimap2/index/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 85ec8d8253d..fa95fc6f07e 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1361,9 +1361,6 @@ minia: miniasm: - modules/nf-core/miniasm/** - tests/modules/nf-core/miniasm/** -minimap2/index: - - modules/nf-core/minimap2/index/** - - tests/modules/nf-core/minimap2/index/** miniprot/align: - modules/miniprot/align/** - tests/modules/miniprot/align/** diff --git a/tests/modules/nf-core/minimap2/index/main.nf b/tests/modules/nf-core/minimap2/index/main.nf deleted file mode 100644 index 212bb64e0ee..00000000000 --- a/tests/modules/nf-core/minimap2/index/main.nf +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { MINIMAP2_INDEX } from '../../../../../modules/nf-core/minimap2/index/main.nf' - -workflow test_minimap2_index { - - fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - - MINIMAP2_INDEX ( [ [id:'test'], fasta ] ) -} diff --git a/tests/modules/nf-core/minimap2/index/nextflow.config b/tests/modules/nf-core/minimap2/index/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/minimap2/index/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/minimap2/index/test.yml b/tests/modules/nf-core/minimap2/index/test.yml deleted file mode 100644 index a2e0199b8f0..00000000000 --- a/tests/modules/nf-core/minimap2/index/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: minimap2 index - command: nextflow run ./tests/modules/nf-core/minimap2/index -entry test_minimap2_index -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/minimap2/index/nextflow.config - tags: - - minimap2 - - minimap2/index - files: - - path: ./output/minimap2/genome.mmi - md5sum: 72e450f12dc691e763c697463bdb1571