Skip to content

Commit

Permalink
Added nf-test for homer/annotatepeaks (#6573)
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp authored Sep 5, 2024
1 parent db53f41 commit 34eb86c
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 31 deletions.
12 changes: 12 additions & 0 deletions modules/nf-core/homer/annotatepeaks/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,16 @@ process HOMER_ANNOTATEPEAKS {
homer: $VERSION
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '4.11' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${prefix}.annotatePeaks.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
homer: $VERSION
END_VERSIONS
"""
}
68 changes: 68 additions & 0 deletions modules/nf-core/homer/annotatepeaks/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

nextflow_process {

name "Test Process HOMER_ANNOTATEPEAKS"
script "../main.nf"
process "HOMER_ANNOTATEPEAKS"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "homer"
tag "homer/annotatepeaks"

test("test-homer-annotatepeaks") {

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gtf', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.txt[0][1]).name, // unstable
process.out.stats,
process.out.versions
).match()
}
)
}
}

test("test-homer-annotatepeaks-stub") {
options '-stub'

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gtf', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
62 changes: 62 additions & 0 deletions modules/nf-core/homer/annotatepeaks/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"test-homer-annotatepeaks-stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.annotatePeaks.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [

],
"2": [
"versions.yml:md5,d109521b6e43672cf246fd269b3833c8"
],
"stats": [

],
"txt": [
[
{
"id": "test"
},
"test.annotatePeaks.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,d109521b6e43672cf246fd269b3833c8"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T21:21:30.264399"
},
"test-homer-annotatepeaks": {
"content": [
"test.annotatePeaks.txt",
[
[
{
"id": "test"
},
"test.annStats.txt:md5,eba336bce28fb5ec5d4ea3215b502dc5"
]
],
[
"versions.yml:md5,d109521b6e43672cf246fd269b3833c8"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T21:28:26.487711"
}
}
3 changes: 3 additions & 0 deletions modules/nf-core/homer/annotatepeaks/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
process {
ext.args = {"-annStats ${meta.id}.annStats.txt"}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,6 @@ hmmer/hmmbuild:
hmtnote/annotate:
- modules/nf-core/hmtnote/annotate/**
- tests/modules/nf-core/hmtnote/annotate/**
homer/annotatepeaks:
- modules/nf-core/homer/annotatepeaks/**
- tests/modules/nf-core/homer/annotatepeaks/**
homer/makeucscfile:
- modules/nf-core/homer/makeucscfile/**
- tests/modules/nf-core/homer/makeucscfile/**
Expand Down
14 changes: 0 additions & 14 deletions tests/modules/nf-core/homer/annotatepeaks/main.nf

This file was deleted.

6 changes: 0 additions & 6 deletions tests/modules/nf-core/homer/annotatepeaks/nextflow.config

This file was deleted.

8 changes: 0 additions & 8 deletions tests/modules/nf-core/homer/annotatepeaks/test.yml

This file was deleted.

0 comments on commit 34eb86c

Please sign in to comment.