From 1ddc2821c7bc890907642c258955e4608aced0ed Mon Sep 17 00:00:00 2001 From: Emilio Palumbo Date: Thu, 18 Apr 2024 18:55:36 +0200 Subject: [PATCH] Add nf-test for inferExp process --- tests/modules/inferExp/rseqc/main.nf.test | 47 +++++++++++++++++++ .../modules/inferExp/rseqc/main.nf.test.snap | 38 +++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 tests/modules/inferExp/rseqc/main.nf.test create mode 100644 tests/modules/inferExp/rseqc/main.nf.test.snap diff --git a/tests/modules/inferExp/rseqc/main.nf.test b/tests/modules/inferExp/rseqc/main.nf.test new file mode 100644 index 0000000..fadaed9 --- /dev/null +++ b/tests/modules/inferExp/rseqc/main.nf.test @@ -0,0 +1,47 @@ +nextflow_process { + + name "Test Process inferExp" + script "modules/inferExp/rseqc/main.nf" + process "inferExp" + + test("Should infer strendedness from BAM (compressed annotation)") { + + when { + process { + """ + input[0] = file("${baseDir}/data/annotation.gtf.gz") + input[1] = Channel.from([ + [ "sample3", "test3", file("${baseDir}/data/sample3_m4_n10_toGenome.bam"), "bam", "GenomeAlignments", true] + ]) + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + + test("Should infer strendedness from BAM (uncompressed annotation)") { + + when { + process { + """ + input[0] = file("${baseDir}/data/annotation.gtf.gz") + input[1] = Channel.from([ + [ "sample3", "test3", file("${baseDir}/data/sample3_m4_n10_toGenome.bam"), "bam", "GenomeAlignments", true] + ]) + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + +} diff --git a/tests/modules/inferExp/rseqc/main.nf.test.snap b/tests/modules/inferExp/rseqc/main.nf.test.snap new file mode 100644 index 0000000..530680d --- /dev/null +++ b/tests/modules/inferExp/rseqc/main.nf.test.snap @@ -0,0 +1,38 @@ +{ + "Should infer strendedness from BAM (uncompressed annotation)": { + "content": [ + { + "0": [ + [ + "sample3", + "test3", + "{\"paired\": true, \"exp\": \"MATE2_SENSE\"}" + ] + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T18:54:10.824148" + }, + "Should infer strendedness from BAM (compressed annotation)": { + "content": [ + { + "0": [ + [ + "sample3", + "test3", + "{\"paired\": true, \"exp\": \"MATE2_SENSE\"}" + ] + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T18:54:02.195879" + } +} \ No newline at end of file