Skip to content

Commit

Permalink
Add bamstats nf-test
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Apr 18, 2024
1 parent dbf09a0 commit b2d1900
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
57 changes: 57 additions & 0 deletions tests/modules/bamStats/bamstats/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
nextflow_process {

name "Test Process bamStats"
script "modules/bamStats/bamstats/main.nf"
process "bamStats"

tag "module"

test("Should produce BAM stats (compressed annotation)") {

when {
params {
// define parameters here. Example:
// outdir = "tests/results"
}
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 produce BAM stats (uncompressed annotation)") {

when {
params {
// define parameters here. Example:
// outdir = "tests/results"
}
process {
"""
input[0] = file("${baseDir}/data/annotation.gtf")
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()
}

}

}
44 changes: 44 additions & 0 deletions tests/modules/bamStats/bamstats/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"Should produce BAM stats (uncompressed annotation)": {
"content": [
{
"0": [
[
"sample3",
"test3",
"sample3_stats.json:md5,77c72bef6f1410e33c90dbc01697fffc",
"json",
"BamStats",
true
]
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-18T17:10:13.589448"
},
"Should produce BAM stats (compressed annotation)": {
"content": [
{
"0": [
[
"sample3",
"test3",
"sample3_stats.json:md5,77c72bef6f1410e33c90dbc01697fffc",
"json",
"BamStats",
true
]
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-18T17:10:05.978606"
}
}

0 comments on commit b2d1900

Please sign in to comment.