Skip to content

Commit

Permalink
adding nf-test file
Browse files Browse the repository at this point in the history
  • Loading branch information
aw-watson committed Dec 17, 2024
1 parent 46f4aa2 commit d587915
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
run: nf-test test --ci --shard ${{ matrix.shard }}/${{ strategy.job-total }} --changed-since HEAD^
101 changes: 101 additions & 0 deletions tests/modules/runReadsToContig/runReadsToContig.nf.test
Original file line number Diff line number Diff line change
@@ -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}
)
}

}


}
14 changes: 14 additions & 0 deletions tests/modules/runReadsToContig/runReadsToContig.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit d587915

Please sign in to comment.