From be4f907729fce59ca73b6d79545cd220544729c7 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Sat, 20 Jul 2024 12:39:09 +1200 Subject: [PATCH] ltrfinder: Added test to verify graceful handling of no ltr input (#5979) --- modules/nf-core/ltrfinder/tests/main.nf.test | 32 +++++++++-- .../nf-core/ltrfinder/tests/main.nf.test.snap | 57 ++++++++++++++----- modules/nf-core/ltrfinder/tests/tags.yml | 2 - 3 files changed, 69 insertions(+), 22 deletions(-) delete mode 100644 modules/nf-core/ltrfinder/tests/tags.yml diff --git a/modules/nf-core/ltrfinder/tests/main.nf.test b/modules/nf-core/ltrfinder/tests/main.nf.test index 447ce34d3e1..f971f7bb1f7 100644 --- a/modules/nf-core/ltrfinder/tests/main.nf.test +++ b/modules/nf-core/ltrfinder/tests/main.nf.test @@ -19,7 +19,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] """ } @@ -37,8 +37,29 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot(path(process.out.versions[0]).text).match("versions") } + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2-genome_fasta-no_ltr") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } @@ -53,7 +74,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] """ } @@ -62,8 +83,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot(path(process.out.versions[0]).text).match("stub_versions") } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/ltrfinder/tests/main.nf.test.snap b/modules/nf-core/ltrfinder/tests/main.nf.test.snap index 54a2cee10f2..0f1790fc6fe 100644 --- a/modules/nf-core/ltrfinder/tests/main.nf.test.snap +++ b/modules/nf-core/ltrfinder/tests/main.nf.test.snap @@ -48,15 +48,54 @@ }, "timestamp": "2024-02-16T09:14:38.509965" }, - "versions": { + "sarscov2-genome_fasta-no_ltr": { "content": [ - "\"LTRFINDER\":\n LTR_FINDER_parallel: v1.1\n ltr_finder: v1.07\n" + { + "0": [ + [ + { + "id": "test" + }, + "test.scn:md5,2ce449dff751e59dbc292b6888491954" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.gff3:md5,bddeb04277af08b5850e64708e8af02a" + ] + ], + "2": [ + "versions.yml:md5,7b24225b810fa88cfb2a887de11be333" + ], + "gff": [ + [ + { + "id": "test" + }, + "test.gff3:md5,bddeb04277af08b5850e64708e8af02a" + ] + ], + "scn": [ + [ + { + "id": "test" + }, + "test.scn:md5,2ce449dff751e59dbc292b6888491954" + ] + ], + "versions": [ + "versions.yml:md5,7b24225b810fa88cfb2a887de11be333" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-16T09:16:55.301422" + "timestamp": "2024-07-16T13:03:03.505263" }, "stub": { "content": [ @@ -106,15 +145,5 @@ "nextflow": "23.10.1" }, "timestamp": "2024-02-16T09:14:43.054758" - }, - "stub_versions": { - "content": [ - "\"LTRFINDER\":\n LTR_FINDER_parallel: v1.1\n ltr_finder: v1.07\n" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-16T09:16:59.800724" } } \ No newline at end of file diff --git a/modules/nf-core/ltrfinder/tests/tags.yml b/modules/nf-core/ltrfinder/tests/tags.yml deleted file mode 100644 index 006ded2c8ff..00000000000 --- a/modules/nf-core/ltrfinder/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -ltrfinder: - - "modules/nf-core/ltrfinder/**"