Skip to content

Commit

Permalink
Swap clippy to nf-test (nf-core#7277)
Browse files Browse the repository at this point in the history
  • Loading branch information
SPPearce authored and fellen31 committed Jan 10, 2025
1 parent 1254968 commit 5b0eb56
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 70 deletions.
14 changes: 14 additions & 0 deletions modules/nf-core/clippy/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,18 @@ process CLIPPY {
clippy: \$(clippy -v)
END_VERSIONS
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_Peaks.bed
touch ${prefix}_Summits.bed
touch ${prefix}_intergenic_regions.gtf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
clippy: \$(clippy -v)
END_VERSIONS
"""

}
90 changes: 90 additions & 0 deletions modules/nf-core/clippy/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
nextflow_process {

name "Test Process CLIPPY"
script "../main.nf"
process "CLIPPY"

tag "modules"
tag "modules_nfcore"
tag "clippy"

test("non-intergenic") {

config "./nextflow.config"

when {
params {
module_args = '-inter 3'
}
process {
"""
input[0] = [
[ id:'test' ], // meta map
file("https://raw.githubusercontent.com/nf-core/test-datasets/clipseq/crosslinks/clippy.bed", checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chr21_gencode.gtf', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true)
"""
}
}

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

}

test("intergenic") {

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file("https://raw.githubusercontent.com/nf-core/test-datasets/clipseq/crosslinks/clippy.bed", checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chr21_gencode.gtf', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true)
"""
}
}

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

}

test("non-intergenic - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[]
]
input[1] = []
input[2] = []
"""
}
}

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

}

}
177 changes: 177 additions & 0 deletions modules/nf-core/clippy/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{
"non-intergenic - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_Peaks.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test_Summits.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
{
"id": "test"
},
"test_intergenic_regions.gtf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
"versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5"
],
"intergenic_gtf": [
[
{
"id": "test"
},
"test_intergenic_regions.gtf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"peaks": [
[
{
"id": "test"
},
"test_Peaks.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"summits": [
[
{
"id": "test"
},
"test_Summits.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2025-01-08T16:59:22.78408481"
},
"non-intergenic": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed:md5,d793b0bafe5478207bfe80dd635a215c"
]
],
"1": [
[
{
"id": "test"
},
"test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed:md5,afc2143816a8ae91329d7e557a91eeba"
]
],
"2": [

],
"3": [
"versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5"
],
"intergenic_gtf": [

],
"peaks": [
[
{
"id": "test"
},
"test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed:md5,d793b0bafe5478207bfe80dd635a215c"
]
],
"summits": [
[
{
"id": "test"
},
"test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed:md5,afc2143816a8ae91329d7e557a91eeba"
]
],
"versions": [
"versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2025-01-08T16:58:19.283343973"
},
"intergenic": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed:md5,d793b0bafe5478207bfe80dd635a215c"
]
],
"1": [
[
{
"id": "test"
},
"test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed:md5,afc2143816a8ae91329d7e557a91eeba"
]
],
"2": [

],
"3": [
"versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5"
],
"intergenic_gtf": [

],
"peaks": [
[
{
"id": "test"
},
"test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed:md5,d793b0bafe5478207bfe80dd635a215c"
]
],
"summits": [
[
{
"id": "test"
},
"test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed:md5,afc2143816a8ae91329d7e557a91eeba"
]
],
"versions": [
"versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2025-01-08T16:59:13.088102108"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/clippy/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: 'CLIPPY_INTERGENIC' {
ext.args = params.module_args
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ cellrangeratac/mkfastq:
cellrangeratac/mkref:
- modules/nf-core/cellrangeratac/mkref/**
- tests/modules/nf-core/cellrangeratac/mkref/**
clippy:
- modules/nf-core/clippy/**
- tests/modules/nf-core/clippy/**
cnvnator/cnvnator:
- modules/nf-core/cnvnator/cnvnator/**
- tests/modules/nf-core/cnvnator/cnvnator/**
Expand Down
34 changes: 0 additions & 34 deletions tests/modules/nf-core/clippy/main.nf

This file was deleted.

10 changes: 0 additions & 10 deletions tests/modules/nf-core/clippy/nextflow.config

This file was deleted.

23 changes: 0 additions & 23 deletions tests/modules/nf-core/clippy/test.yml

This file was deleted.

0 comments on commit 5b0eb56

Please sign in to comment.