Skip to content

Commit

Permalink
move gatk4/mergevcfs to nf-test (nf-core#4913)
Browse files Browse the repository at this point in the history
* move gatk4/mergevcfs to nf-test

* Update modules/nf-core/gatk4/mergevcfs/tests/main.nf.test

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* Update modules/nf-core/gatk4/mergevcfs/tests/main.nf.test

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* fix tests

* Delete modules/nf-core/gatk4/mergevcfs/tests/nextflow.config

---------

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>
  • Loading branch information
2 people authored and jennylsmith committed Mar 20, 2024
1 parent 3fd1a27 commit 79d2703
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 75 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/gatk4/mergevcfs/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ input:
description: |
Groovy Map containing reference information
e.g. [ id:'genome']
- ref_dict:
- dict:
type: file
description: Optional Sequence Dictionary as input
pattern: "*.dict"
Expand Down
87 changes: 87 additions & 0 deletions modules/nf-core/gatk4/mergevcfs/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "gatk4"
tag "gatk4/mergevcfs"

test("test_gatk4_mergevcfs") {
when {
process {
"""
input[0] = [ [ id:'test' ], [ file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true), file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_vcf_gz'], checkIfExists: true) ]]
input[1] = [ [], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)]
"""
}
}

then {
assertAll(
{ assert process.success },
{
assert snapshot(
file(process.out.vcf.get(0).get(1)).name,
file(process.out.tbi.get(0).get(1)).name
).match("test_gatk4_mergevcfs")
},
)
}

}

test("test_gatk4_mergevcfs_no_dict") {
when {
process {
"""
input[0] = [ [ id:'test' ], [ file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true), file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_vcf_gz'], checkIfExists: true) ]]
input[1] = [ [],[]]
"""
}
}

then {
assertAll(
{ assert process.success },
{
assert snapshot(
file(process.out.vcf.get(0).get(1)).name,
file(process.out.tbi.get(0).get(1)).name
).match("test_gatk4_mergevcfs_no_dict")
},
)
}

}

test("test_gatk4_mergevcfs_no_dict_stub") {

options "-stub"

when {
process {
"""
input[0] = [ [ id:'test' ], [ file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true), file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_vcf_gz'], checkIfExists: true) ]]
input[1] = [ [],[]]
"""
}
}

then {
assertAll(
{ assert process.success },
{
assert snapshot(
file(process.out.vcf.get(0).get(1)).name,
file(process.out.tbi.get(0).get(1)).name
).match("test_gatk4_mergevcfs_no_dict_stub")
},
)
}

}

}
35 changes: 35 additions & 0 deletions modules/nf-core/gatk4/mergevcfs/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/gatk4/mergevcfs/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gatk4/mergevcfs:
- "modules/nf-core/gatk4/mergevcfs/**"
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,6 @@ gatk4/mergebamalignment:
gatk4/mergemutectstats:
- modules/nf-core/gatk4/mergemutectstats/**
- tests/modules/nf-core/gatk4/mergemutectstats/**
gatk4/mergevcfs:
- modules/nf-core/gatk4/mergevcfs/**
- tests/modules/nf-core/gatk4/mergevcfs/**
gatk4/mutect2:
- modules/nf-core/gatk4/mutect2/**
- tests/modules/nf-core/gatk4/mutect2/**
Expand Down
34 changes: 0 additions & 34 deletions tests/modules/nf-core/gatk4/mergevcfs/main.nf

This file was deleted.

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

This file was deleted.

32 changes: 0 additions & 32 deletions tests/modules/nf-core/gatk4/mergevcfs/test.yml

This file was deleted.

0 comments on commit 79d2703

Please sign in to comment.