From 1975ed7a701676a12297ea5efedf033964084e38 Mon Sep 17 00:00:00 2001 From: Koen Bossers <61537771+koenbossers@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:30:56 +0200 Subject: [PATCH] nf-test for module sourmash/sketch (#4104) * nf-test for module sourmash/sketch * add "sourmash" and "sourmash/sketch" tags Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> --------- Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> --- .../sourmash/sketch/tests/main.nf.test | 36 +++++++++++++++++++ .../sourmash/sketch/tests/main.nf.test.snap | 33 +++++++++++++++++ .../nf-core/sourmash/sketch/tests/tags.yml | 2 ++ tests/config/pytest_modules.yml | 4 --- 4 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 modules/nf-core/sourmash/sketch/tests/main.nf.test create mode 100644 modules/nf-core/sourmash/sketch/tests/main.nf.test.snap create mode 100644 modules/nf-core/sourmash/sketch/tests/tags.yml diff --git a/modules/nf-core/sourmash/sketch/tests/main.nf.test b/modules/nf-core/sourmash/sketch/tests/main.nf.test new file mode 100644 index 00000000000..d638d6d1132 --- /dev/null +++ b/modules/nf-core/sourmash/sketch/tests/main.nf.test @@ -0,0 +1,36 @@ +nextflow_process { + + name "Test Process SOURMASH_SKETCH" + script "../main.nf" + process "SOURMASH_SKETCH" + tag "sourmash" + tag "sourmash/sketch" + tag "modules" + tag "modules_nfcore" + + test("Should run without failures") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/sourmash/sketch/tests/main.nf.test.snap b/modules/nf-core/sourmash/sketch/tests/main.nf.test.snap new file mode 100644 index 00000000000..3af6b436ba6 --- /dev/null +++ b/modules/nf-core/sourmash/sketch/tests/main.nf.test.snap @@ -0,0 +1,33 @@ +{ + "Should run without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sig:md5,c23a5a251d2b6babba8ae0e3905e8d04" + ] + ], + "1": [ + "versions.yml:md5,f9e858fd5c324fb5b555824d698b90a8" + ], + "signatures": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sig:md5,c23a5a251d2b6babba8ae0e3905e8d04" + ] + ], + "versions": [ + "versions.yml:md5,f9e858fd5c324fb5b555824d698b90a8" + ] + } + ], + "timestamp": "2023-10-17T15:03:34.724011196" + } +} \ No newline at end of file diff --git a/modules/nf-core/sourmash/sketch/tests/tags.yml b/modules/nf-core/sourmash/sketch/tests/tags.yml new file mode 100644 index 00000000000..92ad1525eb2 --- /dev/null +++ b/modules/nf-core/sourmash/sketch/tests/tags.yml @@ -0,0 +1,2 @@ +sourmash/sketch: + - modules/nf-core/sourmash/sketch/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index e027f8c8ce4..6405f2881d3 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -3655,10 +3655,6 @@ sourmash/index: - modules/nf-core/sourmash/index/** - tests/modules/nf-core/sourmash/index/** -sourmash/sketch: - - modules/nf-core/sourmash/sketch/** - - tests/modules/nf-core/sourmash/sketch/** - sourmash/taxannotate: - modules/nf-core/sourmash/taxannotate/** - tests/modules/nf-core/sourmash/taxannotate/**