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

Added nf-test for gfaffix #6597

Merged
merged 6 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
3 changes: 1 addition & 2 deletions modules/nf-core/gfaffix/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ name: gfaffix
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::gfaffix=0.1.5
- bioconda::gfaffix=0.1.5b
14 changes: 13 additions & 1 deletion modules/nf-core/gfaffix/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,19 @@ process GFAFFIX {

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gfaffix: \$(gfaffix --version 2>&1 | grep -o 'gfaffix .*' | cut -f2 -d ' ')
gfaffix: \$(gfaffix --version | grep -o 'gfaffix .*' | cut -f2 -d ' ')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.gfaffix.gfa
touch ${prefix}.affixes.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gfaffix: \$(gfaffix --version | grep -o 'gfaffix .*' | cut -f2 -d ' ')
END_VERSIONS
"""
}
63 changes: 63 additions & 0 deletions modules/nf-core/gfaffix/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "gfaffix"

test("test-gfaffix") {

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gfa/assembly.gfa', checkIfExists: true) ]
]

"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.gfa,
process.out.affixes,
process.out.versions,
file(process.out.versions[0]).readLines().collect { it.trim() }, // Trap for conda version mismatches
).match()
}
)
}
}

test("test-gfaffix-stub") {
options '-stub'

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gfa/assembly.gfa', checkIfExists: true) ]
]

"""
}
}

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

}
83 changes: 83 additions & 0 deletions modules/nf-core/gfaffix/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"test-gfaffix": {
"content": [
[
[
{
"id": "test"
},
"test.gfaffix.gfa:md5,30d7a68fc07623779dbb3d708320c844"
]
],
[
[
{
"id": "test"
},
"test.affixes.txt:md5,c3540baa386462552d7ebe4e4b7eda6a"
]
],
[
"versions.yml:md5,3ec7c6a9cbafbb8131f4e325e140aa80"
],
[
"\"GFAFFIX\":",
"gfaffix: 0.1.5b"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-06T14:14:01.340269"
},
"test-gfaffix-stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.gfaffix.gfa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test.affixes.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,3ec7c6a9cbafbb8131f4e325e140aa80"
],
"affixes": [
[
{
"id": "test"
},
"test.affixes.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"gfa": [
[
{
"id": "test"
},
"test.gfaffix.gfa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,3ec7c6a9cbafbb8131f4e325e140aa80"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-06T14:36:34.068923"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ genrich:
geoquery/getgeo:
- modules/nf-core/geoquery/getgeo/**
- tests/modules/nf-core/geoquery/getgeo/**
gfaffix:
- modules/nf-core/gfaffix/**
- tests/modules/nf-core/gfaffix/**
gfastats:
- modules/nf-core/gfastats/**
- tests/modules/nf-core/gfastats/**
Expand Down
13 changes: 0 additions & 13 deletions tests/modules/nf-core/gfaffix/main.nf

This file was deleted.

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

This file was deleted.

9 changes: 0 additions & 9 deletions tests/modules/nf-core/gfaffix/test.yml

This file was deleted.

Loading