From 641c44e502af7ed1fda4fd71189de562b88766de Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Mon, 26 Aug 2024 14:17:10 +1200 Subject: [PATCH] Added nf-test for bcftools/split --- .../nf-core/bcftools/split/tests/main.nf.test | 40 +++++++++++++++++++ .../bcftools/split/tests/main.nf.test.snap | 15 +++++++ tests/config/pytest_modules.yml | 3 -- tests/modules/nf-core/bcftools/split/main.nf | 16 -------- .../nf-core/bcftools/split/nextflow.config | 5 --- tests/modules/nf-core/bcftools/split/test.yml | 8 ---- 6 files changed, 55 insertions(+), 32 deletions(-) create mode 100644 modules/nf-core/bcftools/split/tests/main.nf.test create mode 100644 modules/nf-core/bcftools/split/tests/main.nf.test.snap delete mode 100644 tests/modules/nf-core/bcftools/split/main.nf delete mode 100644 tests/modules/nf-core/bcftools/split/nextflow.config delete mode 100644 tests/modules/nf-core/bcftools/split/test.yml diff --git a/modules/nf-core/bcftools/split/tests/main.nf.test b/modules/nf-core/bcftools/split/tests/main.nf.test new file mode 100644 index 00000000000..00328b2004c --- /dev/null +++ b/modules/nf-core/bcftools/split/tests/main.nf.test @@ -0,0 +1,40 @@ + +nextflow_process { + + name "Test Process BCFTOOLS_SPLIT" + script "../main.nf" + process "BCFTOOLS_SPLIT" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/split" + + test("test-bcftools-split") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.split_vcf[0][1]).vcf.variantsMD5, + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/bcftools/split/tests/main.nf.test.snap b/modules/nf-core/bcftools/split/tests/main.nf.test.snap new file mode 100644 index 00000000000..c1a3c98578c --- /dev/null +++ b/modules/nf-core/bcftools/split/tests/main.nf.test.snap @@ -0,0 +1,15 @@ +{ + "test-bcftools-split": { + "content": [ + "ecf3973f634b7baa1c13e60bfb77a174", + [ + "versions.yml:md5,a1c58d82f1e5c0fed394bfb865f57fd9" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T14:16:45.077115" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 4aea9c2af1e..e7870279f1c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -88,9 +88,6 @@ bcftools/merge: bcftools/roh: - modules/nf-core/bcftools/roh/** - tests/modules/nf-core/bcftools/roh/** -bcftools/split: - - modules/nf-core/bcftools/split/** - - tests/modules/nf-core/bcftools/split/** beagle5/beagle: - modules/nf-core/beagle5/beagle/** - tests/modules/nf-core/beagle5/beagle/** diff --git a/tests/modules/nf-core/bcftools/split/main.nf b/tests/modules/nf-core/bcftools/split/main.nf deleted file mode 100644 index 6304841ca82..00000000000 --- a/tests/modules/nf-core/bcftools/split/main.nf +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BCFTOOLS_SPLIT } from '../../../../../modules/nf-core/bcftools/split/main.nf' - -workflow test_bcftools_split { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true) - ] - - BCFTOOLS_SPLIT ( input ) -} diff --git a/tests/modules/nf-core/bcftools/split/nextflow.config b/tests/modules/nf-core/bcftools/split/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/bcftools/split/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/bcftools/split/test.yml b/tests/modules/nf-core/bcftools/split/test.yml deleted file mode 100644 index d4178a52b41..00000000000 --- a/tests/modules/nf-core/bcftools/split/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: bcftools split test_bcftools_split - command: nextflow run ./tests/modules/nf-core/bcftools/split -entry test_bcftools_split -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/bcftools/split/nextflow.config - tags: - - bcftools - - bcftools/split - files: - - path: output/bcftools/test.chr22.vcf.gz - - path: output/bcftools/versions.yml