Skip to content

Commit

Permalink
port htseq count pytest to nf-test (nf-core#5194)
Browse files Browse the repository at this point in the history
* port htseq count pytest to nf-test

* rename yml file

* add extra line

* fix tag.yml

* fix meta.yml

* fix meta.yml

---------

Co-authored-by: zxBIB Grochowalski,Lukasz (GCBDS) EXTERNAL <[email protected]>
Co-authored-by: Mauro Saporita <[email protected]>
  • Loading branch information
3 people authored Mar 18, 2024
1 parent 298406d commit 0a7b366
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/htseq/count/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
homepage: "https://htseq.readthedocs.io/en/latest/"
documentation: "https://htseq.readthedocs.io/en/latest/index.html"
doi: "10.1093/bioinformatics/btu638"
licence: "['GPL v3']"
licence: ["GPL v3"]
input:
- meta:
type: map
Expand Down
72 changes: 72 additions & 0 deletions modules/nf-core/htseq/count/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
nextflow_process {

name "Test Process HTSEQ_COUNT"
script "../main.nf"
process "HTSEQ_COUNT"
tag "modules"
tag "modules_nfcore"
tag "htseq"
tag "htseq/count"

test("bam input") {

when {
process {
"""
input[0] = [
[ 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[1] = [
[ id:'test2'], // meta map
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)
]
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert process.out.txt.get(0).get(1) ==~ ".*.txt" },
{ assert snapshot(process.out).match() }
)

}

}

test("cram input") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true)
]
input[1] = [
[ id:'test2'], // meta map
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)
]
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert process.out.txt.get(0).get(1) ==~ ".*.txt" },
{ assert snapshot(process.out).match() }
)

}

}


}
72 changes: 72 additions & 0 deletions modules/nf-core/htseq/count/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/htseq/count/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
htseq/count:
- "modules/nf-core/htseq/count/**"
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,6 @@ homer/pos2bed:
hpsuissero:
- modules/nf-core/hpsuissero/**
- tests/modules/nf-core/hpsuissero/**
htseq/count:
- modules/nf-core/htseq/count/**
- tests/modules/nf-core/htseq/count/**
hypo:
- modules/nf-core/hypo/**
- tests/modules/nf-core/hypo/**
Expand Down

0 comments on commit 0a7b366

Please sign in to comment.