From 2a6fda4131ae1a389fe5c04e17018ed5418c5549 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Mon, 26 Aug 2024 18:35:10 +1200 Subject: [PATCH] Added nf-test for bam2fastx/bam2fastq (#6343) * Added nf-test for bam2fastx/bam2fastq * Swap to snapshot all --------- Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- .../bam2fastx/bam2fastq/tests/main.nf.test | 37 +++++++++++++++++++ .../bam2fastq/tests/main.nf.test.snap | 35 ++++++++++++++++++ tests/config/pytest_modules.yml | 3 -- .../nf-core/bam2fastx/bam2fastq/main.nf | 16 -------- .../bam2fastx/bam2fastq/nextflow.config | 5 --- .../nf-core/bam2fastx/bam2fastq/test.yml | 9 ----- 6 files changed, 72 insertions(+), 33 deletions(-) create mode 100644 modules/nf-core/bam2fastx/bam2fastq/tests/main.nf.test create mode 100644 modules/nf-core/bam2fastx/bam2fastq/tests/main.nf.test.snap delete mode 100644 tests/modules/nf-core/bam2fastx/bam2fastq/main.nf delete mode 100644 tests/modules/nf-core/bam2fastx/bam2fastq/nextflow.config delete mode 100644 tests/modules/nf-core/bam2fastx/bam2fastq/test.yml diff --git a/modules/nf-core/bam2fastx/bam2fastq/tests/main.nf.test b/modules/nf-core/bam2fastx/bam2fastq/tests/main.nf.test new file mode 100644 index 00000000000..0d4f80ae699 --- /dev/null +++ b/modules/nf-core/bam2fastx/bam2fastq/tests/main.nf.test @@ -0,0 +1,37 @@ + +nextflow_process { + + name "Test Process BAM2FASTX_BAM2FASTQ" + script "../main.nf" + process "BAM2FASTX_BAM2FASTQ" + + tag "modules" + tag "modules_nfcore" + tag "bam2fastx" + tag "bam2fastx/bam2fastq" + + test("test-bam2fastx-bam2fastq") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/alz.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/alz.bam.pbi', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() + } + ) + } + } + +} diff --git a/modules/nf-core/bam2fastx/bam2fastq/tests/main.nf.test.snap b/modules/nf-core/bam2fastx/bam2fastq/tests/main.nf.test.snap new file mode 100644 index 00000000000..342241ef940 --- /dev/null +++ b/modules/nf-core/bam2fastx/bam2fastq/tests/main.nf.test.snap @@ -0,0 +1,35 @@ +{ + "test-bam2fastx-bam2fastq": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fastq.gz:md5,8abf16176fd1625998ee28590e1039b1" + ] + ], + "1": [ + "versions.yml:md5,1b954947255d9b2ad16d2c523258cceb" + ], + "fastq": [ + [ + { + "id": "test" + }, + "test.fastq.gz:md5,8abf16176fd1625998ee28590e1039b1" + ] + ], + "versions": [ + "versions.yml:md5,1b954947255d9b2ad16d2c523258cceb" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T06:30:10.25178642" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 8724459c084..dfc7ff75421 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -34,9 +34,6 @@ atlas/splitmerge: authentict/deam2cont: - modules/nf-core/authentict/deam2cont/** - tests/modules/nf-core/authentict/deam2cont/** -bam2fastx/bam2fastq: - - modules/nf-core/bam2fastx/bam2fastq/** - - tests/modules/nf-core/bam2fastx/bam2fastq/** bamtools/convert: - modules/nf-core/bamtools/convert/** - tests/modules/nf-core/bamtools/convert/** diff --git a/tests/modules/nf-core/bam2fastx/bam2fastq/main.nf b/tests/modules/nf-core/bam2fastx/bam2fastq/main.nf deleted file mode 100644 index d8073765b6d..00000000000 --- a/tests/modules/nf-core/bam2fastx/bam2fastq/main.nf +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BAM2FASTX_BAM2FASTQ } from '../../../../../modules/nf-core/bam2fastx/bam2fastq/main.nf' - -workflow test_bam2fastx_bam2fastq { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['pacbio']['alz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['pacbio']['alzpbi'], checkIfExists: true) - ] - - BAM2FASTX_BAM2FASTQ ( input ) -} diff --git a/tests/modules/nf-core/bam2fastx/bam2fastq/nextflow.config b/tests/modules/nf-core/bam2fastx/bam2fastq/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/bam2fastx/bam2fastq/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/bam2fastx/bam2fastq/test.yml b/tests/modules/nf-core/bam2fastx/bam2fastq/test.yml deleted file mode 100644 index 18b9f144a72..00000000000 --- a/tests/modules/nf-core/bam2fastx/bam2fastq/test.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: bam2fastx bam2fastq test_bam2fastx_bam2fastq - command: nextflow run ./tests/modules/nf-core/bam2fastx/bam2fastq -entry test_bam2fastx_bam2fastq -c ./tests/config/nextflow.config - tags: - - bam2fastx/bam2fastq - - bam2fastx - files: - - path: output/bam2fastx/test.fastq.gz - md5sum: f0329f9ea12324c6631ac9f3712f2ca5 - - path: output/bam2fastx/versions.yml