Skip to content

Commit

Permalink
ltrharvest: Added test to verify graceful handling of no ltr input (#…
Browse files Browse the repository at this point in the history
…5978)

* ltrharvest: Added test to verify graceful handling of no ltr input

* Updated test data paths

* Fixed test data path

* Removed unstable items from snapshot

* Updated snapshotting logic
  • Loading branch information
GallVp authored Jul 20, 2024
1 parent 4f1b730 commit 78575b0
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 36 deletions.
45 changes: 37 additions & 8 deletions modules/nf-core/ltrharvest/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ nextflow_process {
tag "modules_nfcore"
tag "ltrharvest"

test("homo_sapiens-genome_21_fasta") {
test("homo_sapiens - genome_21_fasta") {

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true)
]
"""
}
Expand All @@ -24,15 +24,45 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.gff3).match("gff3") },
{ assert snapshot(
process.out.gff3,
process.out.versions
).match()
},
{ assert path(process.out.scn[0][1]).text.contains("46510803 46520182 9380 46510803 46510940 138 46520042 46520182 141 86.52 0 chr21") },
{ assert snapshot(path(process.out.versions[0]).text).match("script_versions") }
)
}

}

test("homo_sapiens-genome_fasta-stub") {
test("sarscov2 - genome_fasta - no_ltr") {

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

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.gff3,
process.out.versions
).match()
},
{ assert path(process.out.scn[0][1]).text.contains("predictions are reported in the following way") },
)
}

}

test("homo_sapiens - genome_fasta - stub") {

options '-stub'

Expand All @@ -41,7 +71,7 @@ nextflow_process {
"""
input[0] = [
[ id:'test' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
]
"""
}
Expand All @@ -50,8 +80,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert snapshot(path(process.out.versions[0]).text).match("stub_versions") }
{ assert snapshot(process.out).match() }
)
}

Expand Down
55 changes: 29 additions & 26 deletions modules/nf-core/ltrharvest/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
{
"homo_sapiens-genome_fasta-stub": {
"sarscov2 - genome_fasta - no_ltr": {
"content": [
[
[
{
"id": "test"
},
"test.gff3:md5,bddeb04277af08b5850e64708e8af02a"
]
],
[
"versions.yml:md5,51e82185b713482d1d48b6f15abe7fcc"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-17T10:40:36.380052"
},
"homo_sapiens - genome_fasta - stub": {
"content": [
{
"0": [
Expand Down Expand Up @@ -44,21 +64,11 @@
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nextflow": "24.04.3"
},
"timestamp": "2024-02-22T14:44:30.682167"
"timestamp": "2024-07-17T10:40:40.967557"
},
"script_versions": {
"content": [
"\"LTRHARVEST\":\n LTR_HARVEST_parallel: v1.1\n genometools: 1.6.5\n"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-02-22T14:44:26.672478"
},
"gff3": {
"homo_sapiens - genome_21_fasta": {
"content": [
[
[
Expand All @@ -67,22 +77,15 @@
},
"test.gff3:md5,da13c4ba22e44ef944ddec38aa72c468"
]
],
[
"versions.yml:md5,51e82185b713482d1d48b6f15abe7fcc"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-02-22T19:29:33.962761"
},
"stub_versions": {
"content": [
"\"LTRHARVEST\":\n LTR_HARVEST_parallel: v1.1\n genometools: 1.6.5\n"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nextflow": "24.04.3"
},
"timestamp": "2024-02-22T14:44:30.729166"
"timestamp": "2024-07-17T10:40:30.946"
}
}
2 changes: 0 additions & 2 deletions modules/nf-core/ltrharvest/tests/tags.yml

This file was deleted.

0 comments on commit 78575b0

Please sign in to comment.