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 legsta #6566

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion modules/nf-core/legsta/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ name: legsta
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::legsta=0.5.1
11 changes: 11 additions & 0 deletions modules/nf-core/legsta/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,15 @@ process LEGSTA {
legsta: \$(echo \$(legsta --version 2>&1) | sed 's/^.*legsta //; s/ .*\$//;')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
legsta: \$(echo \$(legsta --version 2>&1) | sed 's/^.*legsta //; s/ .*\$//;')
END_VERSIONS
"""
}
2 changes: 2 additions & 0 deletions modules/nf-core/legsta/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ description: Typing of clinical and environmental isolates of Legionella pneumop
keywords:
- bacteria
- legionella
- clinical
- pneumophila
tools:
- legsta:
description: In silico Legionella pneumophila Sequence Based Typing
Expand Down
57 changes: 57 additions & 0 deletions modules/nf-core/legsta/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "legsta"

test("test-legsta") {

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

"""
}
}

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

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

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

"""
}
}

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

}
72 changes: 72 additions & 0 deletions modules/nf-core/legsta/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"test-legsta": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,c493bdd19335de4828aa8b4e3ce7e1f8"
]
],
"1": [
"versions.yml:md5,a853be87d21977365afe63ef07450a44"
],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,c493bdd19335de4828aa8b4e3ce7e1f8"
]
],
"versions": [
"versions.yml:md5,a853be87d21977365afe63ef07450a44"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T20:09:21.017956"
},
"test-legsta-stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,a853be87d21977365afe63ef07450a44"
],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,a853be87d21977365afe63ef07450a44"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T20:09:26.594828"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,6 @@ krona/ktupdatetaxonomy:
leehom:
- modules/nf-core/leehom/**
- tests/modules/nf-core/leehom/**
legsta:
- modules/nf-core/legsta/**
- tests/modules/nf-core/legsta/**
limma/differential:
- modules/nf-core/limma/differential/**
- tests/modules/nf-core/limma/differential/**
Expand Down
15 changes: 0 additions & 15 deletions tests/modules/nf-core/legsta/main.nf

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Loading