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

nf-test for pilon #5293

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/nf-core/pilon/meta.yml
Expand Up @@ -11,7 +11,7 @@ tools:
documentation: "https://github.com/broadinstitute/pilon/wiki/Requirements-&-Usage"
tool_dev_url: "https://github.com/broadinstitute/pilon"
doi: "10.1371/journal.pone.0112963"
licence: "['GPL v2']"
licence: ["GPL-2.0-or-later"]
input:
- meta:
type: map
Expand Down
38 changes: 38 additions & 0 deletions modules/nf-core/pilon/tests/main.nf.test
@@ -0,0 +1,38 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "pilon"


test("Test PILON") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Change test name to something more specific, there is no standard (yet) but something like pilon - bam - paired should do


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

Choose a reason for hiding this comment

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

Apparently the new guideline is to use URLs instead of the test_data object, so please change the tests accordingly

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, I just started so can you point to the guidelines? I found some info (but not technical details) here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Refer to #5281 for an example, I believe it's not documented yet, but the documentation team is working on it

Copy link
Contributor

Choose a reason for hiding this comment

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

Changing to the test-data path is not required currently, just optional.

]
input[1] = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
]
input[2] = "bam"
"""
}
}

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

}
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that the module has multiple modes, is it possible to add tests for the others? And a stub test as well, although I see the module currently lacks a stub


}
61 changes: 61 additions & 0 deletions modules/nf-core/pilon/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/pilon/tests/tags.yml
@@ -0,0 +1,2 @@
pilon:
- "modules/nf-core/pilon/**"
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Expand Up @@ -1631,9 +1631,6 @@ picard/sortsam:
picard/sortvcf:
- modules/nf-core/picard/sortvcf/**
- tests/modules/nf-core/picard/sortvcf/**
pilon:
- modules/nf-core/pilon/**
- tests/modules/nf-core/pilon/**
pindel/pindel:
- modules/nf-core/pindel/pindel/**
- tests/modules/nf-core/pindel/pindel/**
Expand Down
20 changes: 0 additions & 20 deletions tests/modules/nf-core/pilon/main.nf

This file was deleted.

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

This file was deleted.

8 changes: 0 additions & 8 deletions tests/modules/nf-core/pilon/test.yml

This file was deleted.