Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap samtools dict to nftest #5993

Merged
merged 5 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions modules/nf-core/samtools/dict/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "samtools"
tag "samtools/dict"

test("sarscov2 - fasta") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
SPPearce marked this conversation as resolved.
Show resolved Hide resolved
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match() },
{ assert path(process.out.dict[0][1]).readLines().first().contains("@HD\tVN:1.0\tSO:unsorted") }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you instead of this try to snapshot the stable lines of the file?

)
}

}

test("sarscov2 - fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
"""
}
}

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

}

}
49 changes: 49 additions & 0 deletions modules/nf-core/samtools/dict/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"sarscov2 - fasta - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"genome.fasta.dict:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,47f9e889ed1e779cb54e61d707a7135d"
],
"dict": [
[
{
"id": "test",
"single_end": false
},
"genome.fasta.dict:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,47f9e889ed1e779cb54e61d707a7135d"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-18T09:43:30.509703257"
},
"sarscov2 - fasta": {
"content": [
[
"versions.yml:md5,0af6b2d2d6d9d96bc5abe98b99b91446"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-18T09:51:18.221597999"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1346,9 +1346,6 @@ samtools/collatefastq:
samtools/depth:
- modules/nf-core/samtools/depth/**
- tests/modules/nf-core/samtools/depth/**
samtools/dict:
- modules/nf-core/samtools/dict/**
- tests/modules/nf-core/samtools/dict/**
samtools/fasta:
- modules/nf-core/samtools/fasta/**
- tests/modules/nf-core/samtools/fasta/**
Expand Down
13 changes: 0 additions & 13 deletions tests/modules/nf-core/samtools/dict/main.nf

This file was deleted.

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

This file was deleted.

12 changes: 0 additions & 12 deletions tests/modules/nf-core/samtools/dict/test.yml

This file was deleted.

Loading