Skip to content

Commit

Permalink
Added nf-test for cnvkit/call (#6582)
Browse files Browse the repository at this point in the history
* Added nf-test for cnvkit/call

* Removed defaults
  • Loading branch information
GallVp authored Sep 5, 2024
1 parent 50b3cbc commit bf39676
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 55 deletions.
1 change: 0 additions & 1 deletion modules/nf-core/cnvkit/call/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ name: cnvkit_call
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::cnvkit=0.9.10
11 changes: 11 additions & 0 deletions modules/nf-core/cnvkit/call/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@ process CNVKIT_CALL {
cnvkit: \$(cnvkit.py version | sed -e 's/cnvkit v//g')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.cns
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvkit: \$(cnvkit.py version | sed -e 's/cnvkit v//g')
END_VERSIONS
"""
}
83 changes: 83 additions & 0 deletions modules/nf-core/cnvkit/call/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "cnvkit"
tag "cnvkit/call"

test("test-cnvkit-call") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file('https://raw.githubusercontent.com/etal/cnvkit/v0.9.9/test/formats/amplicon.cns', checkIfExists: true),
[]
]
"""
}
}

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

test("test-cnvkit-call-with-vcf") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file('https://raw.githubusercontent.com/etal/cnvkit/v0.9.9/test/formats/amplicon.cns', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true)
]
"""
}
}

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

test("test-cnvkit-call-with-vcf-stub") {
options '-stub'

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file('https://raw.githubusercontent.com/etal/cnvkit/v0.9.9/test/formats/amplicon.cns', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true)
]
"""
}
}

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

}
107 changes: 107 additions & 0 deletions modules/nf-core/cnvkit/call/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"test-cnvkit-call": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.cns:md5,7746029caf9ecc134a075a2d50be269f"
]
],
"1": [
"versions.yml:md5,f47253e21b991f72a741d6b5c9a351a5"
],
"cns": [
[
{
"id": "test",
"single_end": false
},
"test.cns:md5,7746029caf9ecc134a075a2d50be269f"
]
],
"versions": [
"versions.yml:md5,f47253e21b991f72a741d6b5c9a351a5"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T22:24:41.048386"
},
"test-cnvkit-call-with-vcf": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.cns:md5,2a4b3da8a8131a4ed4ae902a9f96a405"
]
],
"1": [
"versions.yml:md5,f47253e21b991f72a741d6b5c9a351a5"
],
"cns": [
[
{
"id": "test",
"single_end": false
},
"test.cns:md5,2a4b3da8a8131a4ed4ae902a9f96a405"
]
],
"versions": [
"versions.yml:md5,f47253e21b991f72a741d6b5c9a351a5"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T22:24:50.134984"
},
"test-cnvkit-call-with-vcf-stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.cns:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,f47253e21b991f72a741d6b5c9a351a5"
],
"cns": [
[
{
"id": "test",
"single_end": false
},
"test.cns:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,f47253e21b991f72a741d6b5c9a351a5"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T22:24:56.743954"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ circexplorer2/parse:
clippy:
- modules/nf-core/clippy/**
- tests/modules/nf-core/clippy/**
cnvkit/call:
- modules/nf-core/cnvkit/call/**
- tests/modules/nf-core/cnvkit/call/**
cnvkit/export:
- modules/nf-core/cnvkit/export/**
- tests/modules/nf-core/cnvkit/export/**
Expand Down
27 changes: 0 additions & 27 deletions tests/modules/nf-core/cnvkit/call/main.nf

This file was deleted.

5 changes: 0 additions & 5 deletions tests/modules/nf-core/cnvkit/call/nextflow.config

This file was deleted.

19 changes: 0 additions & 19 deletions tests/modules/nf-core/cnvkit/call/test.yml

This file was deleted.

0 comments on commit bf39676

Please sign in to comment.