From d587915b2307cf1f91f9c915c4ad96c4e52ce68c Mon Sep 17 00:00:00 2001 From: Andre Watson Date: Tue, 17 Dec 2024 14:00:59 -0700 Subject: [PATCH] adding nf-test file --- .github/workflows/ci-tests.yml | 2 +- .../runReadsToContig/runReadsToContig.nf.test | 101 ++++++++++++++++++ .../runReadsToContig.nf.test.snap | 14 +++ 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 tests/modules/runReadsToContig/runReadsToContig.nf.test create mode 100644 tests/modules/runReadsToContig/runReadsToContig.nf.test.snap diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 3a049c4..4c63f4a 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -36,4 +36,4 @@ jobs: sudo mv nf-test /usr/local/bin/ - name: Run Tests (Shard ${{ matrix.shard }}/${{ strategy.job-total }}) - run: nf-test test --ci --shard ${{ matrix.shard }}/${{ strategy.job-total }} \ No newline at end of file + run: nf-test test --ci --shard ${{ matrix.shard }}/${{ strategy.job-total }} --changed-since HEAD^ \ No newline at end of file diff --git a/tests/modules/runReadsToContig/runReadsToContig.nf.test b/tests/modules/runReadsToContig/runReadsToContig.nf.test new file mode 100644 index 0000000..3933515 --- /dev/null +++ b/tests/modules/runReadsToContig/runReadsToContig.nf.test @@ -0,0 +1,101 @@ +nextflow_workflow { + + name "Test Workflow READSTOCONTIGS" + script "modules/runReadsToContig/runReadsToContig.nf" + workflow "READSTOCONTIGS" + + test("BWA mem") { + + when { + params { + shared { + outDir = "./testing_output" + projName = "testR2C" + } + r2c { + r2c_aligner = "bwa" + extractUnmapped = true + } + } + workflow { + """ + input[0] = params.r2c.plus(params.shared) + input[1] = [file("${projectDir}/test_data/Ecoli_10x.1.fastq"),file("${projectDir}/test_data/Ecoli_10x.2.fastq")] + input[2] = file("${projectDir}/nf_assets/NO_FILE2") + input[3] = file("${projectDir}/test_data/contigs.fa") + """ + } + } + + then { + assertAll( + {assert workflow.success} + ) + } + + } + + test("Bowtie2") { + + when { + params { + shared { + outDir = "./testing_output" + projName = "testR2C" + } + r2c { + r2c_aligner = "bowtie2" + extractUnmapped = true + } + } + workflow { + """ + input[0] = params.r2c.plus(params.shared) + input[1] = [file("${projectDir}/test_data/Ecoli_10x.1.fastq"),file("${projectDir}/test_data/Ecoli_10x.2.fastq")] + input[2] = file("${projectDir}/nf_assets/NO_FILE2") + input[3] = file("${projectDir}/test_data/contigs.fa") + """ + } + } + + then { + assertAll( + {assert workflow.success} + ) + } + + } + + test("minimap2") { + + when { + params { + shared { + outDir = "./testing_output" + projName = "testR2C" + } + r2c { + r2c_aligner = "minimap2" + extractUnmapped = true + } + } + workflow { + """ + input[0] = params.r2c.plus(params.shared) + input[1] = [file("${projectDir}/test_data/Ecoli_10x.1.fastq"),file("${projectDir}/test_data/Ecoli_10x.2.fastq")] + input[2] = file("${projectDir}/nf_assets/NO_FILE2") + input[3] = file("${projectDir}/test_data/contigs.fa") + """ + } + } + + then { + assertAll( + {assert workflow.success} + ) + } + + } + + +} diff --git a/tests/modules/runReadsToContig/runReadsToContig.nf.test.snap b/tests/modules/runReadsToContig/runReadsToContig.nf.test.snap new file mode 100644 index 0000000..cc4cc37 --- /dev/null +++ b/tests/modules/runReadsToContig/runReadsToContig.nf.test.snap @@ -0,0 +1,14 @@ +{ + "BWA mem": { + "content": [ + "Final_contigs.fasta:md5,cfb6bc7595556231e115e5c9ad57f20d", + "readsToContigs_coverage.table.json:md5,ea221b314df455a84177b669edb3e5b7", + "readsToContigs.alnstats.txt:md5,259f501e745b79cb92b69e335d01cac7" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-17T13:52:25.552513444" + } +} \ No newline at end of file