Skip to content

Commit

Permalink
Added nf-test for bedtools/intersect (#6658)
Browse files Browse the repository at this point in the history
* migrate bedtools/intersect to nftest

* changed test file paths

---------

Co-authored-by: Simon Pearce <[email protected]>
  • Loading branch information
LeonHafner and SPPearce authored Sep 18, 2024
1 parent 6453bce commit 749d72f
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 61 deletions.
90 changes: 90 additions & 0 deletions modules/nf-core/bedtools/intersect/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "bedtools"
tag "bedtools/intersect"

test("sarscov2 - bed - bed") {

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

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

}

test("sarscov2 - bam - bam") {

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

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

}

test("sarscov2 - bed - stub") {

options "-stub"

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

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

}

}
101 changes: 101 additions & 0 deletions modules/nf-core/bedtools/intersect/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"sarscov2 - bam - bam": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_out.bam:md5,738324efe2b1e442ceb6539a630c3fe6"
]
],
"1": [
"versions.yml:md5,42ba439339672f4a9193f0f0fe7a7f64"
],
"intersect": [
[
{
"id": "test"
},
"test_out.bam:md5,738324efe2b1e442ceb6539a630c3fe6"
]
],
"versions": [
"versions.yml:md5,42ba439339672f4a9193f0f0fe7a7f64"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-17T20:55:57.454847668"
},
"sarscov2 - bed - bed": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_out.bed:md5,afcbf01c2f2013aad71dbe8e34f2c15c"
]
],
"1": [
"versions.yml:md5,42ba439339672f4a9193f0f0fe7a7f64"
],
"intersect": [
[
{
"id": "test"
},
"test_out.bed:md5,afcbf01c2f2013aad71dbe8e34f2c15c"
]
],
"versions": [
"versions.yml:md5,42ba439339672f4a9193f0f0fe7a7f64"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-17T20:55:49.072132931"
},
"sarscov2 - bed - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_out.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,42ba439339672f4a9193f0f0fe7a7f64"
],
"intersect": [
[
{
"id": "test"
},
"test_out.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,42ba439339672f4a9193f0f0fe7a7f64"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-17T20:56:06.259192552"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/bedtools/intersect/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: BEDTOOLS_INTERSECT {
ext.prefix = { "${meta.id}_out" }
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/bedtools/intersect/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bedtools/intersect:
- "modules/nf-core/bedtools/intersect/**"
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ bbmap/align:
bcftools/convert:
- modules/nf-core/bcftools/convert/**
- tests/modules/nf-core/bcftools/convert/**
bedtools/intersect:
- modules/nf-core/bedtools/intersect/**
- tests/modules/nf-core/bedtools/intersect/**
bedtools/unionbedg:
- modules/nf-core/bedtools/unionbedg/**
- tests/modules/nf-core/bedtools/unionbedg/**
Expand Down
27 changes: 0 additions & 27 deletions tests/modules/nf-core/bedtools/intersect/main.nf

This file was deleted.

14 changes: 0 additions & 14 deletions tests/modules/nf-core/bedtools/intersect/nextflow.config

This file was deleted.

17 changes: 0 additions & 17 deletions tests/modules/nf-core/bedtools/intersect/test.yml

This file was deleted.

0 comments on commit 749d72f

Please sign in to comment.