From 4bd7a0d7111a97572739644872fbc6a3b6fd781e Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Fri, 23 Aug 2024 10:47:32 +1200 Subject: [PATCH 1/3] Added nf-test for rapidnj --- modules/nf-core/rapidnj/tests/main.nf.test | 36 +++++++++++++++++++ .../nf-core/rapidnj/tests/main.nf.test.snap | 18 ++++++++++ tests/config/pytest_modules.yml | 3 -- tests/modules/nf-core/rapidnj/main.nf | 12 ------- tests/modules/nf-core/rapidnj/nextflow.config | 5 --- tests/modules/nf-core/rapidnj/test.yml | 9 ----- 6 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 modules/nf-core/rapidnj/tests/main.nf.test create mode 100644 modules/nf-core/rapidnj/tests/main.nf.test.snap delete mode 100644 tests/modules/nf-core/rapidnj/main.nf delete mode 100644 tests/modules/nf-core/rapidnj/nextflow.config delete mode 100644 tests/modules/nf-core/rapidnj/test.yml diff --git a/modules/nf-core/rapidnj/tests/main.nf.test b/modules/nf-core/rapidnj/tests/main.nf.test new file mode 100644 index 00000000000..69b8120cfb5 --- /dev/null +++ b/modules/nf-core/rapidnj/tests/main.nf.test @@ -0,0 +1,36 @@ + +nextflow_process { + + name "Test Process RAPIDNJ" + script "../main.nf" + process "RAPIDNJ" + + tag "modules" + tag "modules_nfcore" + tag "rapidnj" + + test("test-rapidnj") { + + when { + process { + """ + input[0] = [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true) ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.stockholm_alignment, + file(process.out.phylogeny[0][1]).name, + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/rapidnj/tests/main.nf.test.snap b/modules/nf-core/rapidnj/tests/main.nf.test.snap new file mode 100644 index 00000000000..067322f28aa --- /dev/null +++ b/modules/nf-core/rapidnj/tests/main.nf.test.snap @@ -0,0 +1,18 @@ +{ + "test-rapidnj": { + "content": [ + [ + "alignment.sth:md5,d2e995c5dd3e3a8212a98414ae5b5de7" + ], + "U", + [ + "versions.yml:md5,6949732c2fc12b8a5a3e478f197e7fe7" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T10:46:46.856713" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index b698856bbae..48c0c4601c2 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1232,9 +1232,6 @@ qcat: quast: - modules/nf-core/quast/** - tests/modules/nf-core/quast/** -rapidnj: - - modules/nf-core/rapidnj/** - - tests/modules/nf-core/rapidnj/** raven: - modules/nf-core/raven/** - tests/modules/nf-core/raven/** diff --git a/tests/modules/nf-core/rapidnj/main.nf b/tests/modules/nf-core/rapidnj/main.nf deleted file mode 100644 index af9caac2f95..00000000000 --- a/tests/modules/nf-core/rapidnj/main.nf +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { RAPIDNJ } from '../../../../modules/nf-core/rapidnj/main.nf' - -workflow test_rapidnj { - - input = [ file(params.test_data['sarscov2']['genome']['informative_sites_fas'], checkIfExists: true) ] - - RAPIDNJ ( input ) -} diff --git a/tests/modules/nf-core/rapidnj/nextflow.config b/tests/modules/nf-core/rapidnj/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/rapidnj/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/rapidnj/test.yml b/tests/modules/nf-core/rapidnj/test.yml deleted file mode 100644 index 2372aa02154..00000000000 --- a/tests/modules/nf-core/rapidnj/test.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: rapidnj - command: nextflow run ./tests/modules/nf-core/rapidnj -entry test_rapidnj -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/rapidnj/nextflow.config - tags: - - rapidnj - files: - - path: output/rapidnj/alignment.sth - md5sum: d2e995c5dd3e3a8212a98414ae5b5de7 - - path: output/rapidnj/rapidnj_phylogeny.tre - md5sum: 775909ea40138101976592cfa1814a1d From f65e90368a7580f9c6e428c6210ed0ef35f54179 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Fri, 23 Aug 2024 11:54:11 +1200 Subject: [PATCH 2/3] Fixed assertion --- modules/nf-core/rapidnj/tests/main.nf.test | 6 +++--- modules/nf-core/rapidnj/tests/main.nf.test.snap | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/rapidnj/tests/main.nf.test b/modules/nf-core/rapidnj/tests/main.nf.test index 69b8120cfb5..7d44f9f50b5 100644 --- a/modules/nf-core/rapidnj/tests/main.nf.test +++ b/modules/nf-core/rapidnj/tests/main.nf.test @@ -10,7 +10,7 @@ nextflow_process { tag "rapidnj" test("test-rapidnj") { - + when { process { """ @@ -23,14 +23,14 @@ nextflow_process { then { assertAll( { assert process.success }, + { assert process.out.phylogeny }, { assert snapshot( process.out.stockholm_alignment, - file(process.out.phylogeny[0][1]).name, process.out.versions ).match() } ) } } - + } diff --git a/modules/nf-core/rapidnj/tests/main.nf.test.snap b/modules/nf-core/rapidnj/tests/main.nf.test.snap index 067322f28aa..05a00e9d3db 100644 --- a/modules/nf-core/rapidnj/tests/main.nf.test.snap +++ b/modules/nf-core/rapidnj/tests/main.nf.test.snap @@ -4,7 +4,6 @@ [ "alignment.sth:md5,d2e995c5dd3e3a8212a98414ae5b5de7" ], - "U", [ "versions.yml:md5,6949732c2fc12b8a5a3e478f197e7fe7" ] @@ -13,6 +12,6 @@ "nf-test": "0.8.4", "nextflow": "24.04.4" }, - "timestamp": "2024-08-23T10:46:46.856713" + "timestamp": "2024-08-23T11:53:44.324999" } } \ No newline at end of file From eaab95db1eee8b9b5c0d5fda341e38bcca37d67b Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Fri, 23 Aug 2024 21:21:57 +1200 Subject: [PATCH 3/3] Update main.nf.test Co-authored-by: Joon Klaps --- modules/nf-core/rapidnj/tests/main.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/rapidnj/tests/main.nf.test b/modules/nf-core/rapidnj/tests/main.nf.test index 7d44f9f50b5..8bd5bd7d0da 100644 --- a/modules/nf-core/rapidnj/tests/main.nf.test +++ b/modules/nf-core/rapidnj/tests/main.nf.test @@ -9,7 +9,7 @@ nextflow_process { tag "modules_nfcore" tag "rapidnj" - test("test-rapidnj") { + test("sarscov2-fasta") { when { process {