Skip to content

Commit

Permalink
stubs and test for rnaseq modules - part IV (#5939)
Browse files Browse the repository at this point in the history
* fix stubs and add stub tests

* fix linting

* fix some linting

* fix linting

* better comment

* change container

* update snapshots

* improve untar stubs

* update snapshots

* update snapshots

* update env

* better

* use seqera containers

* quay.io

* proper usage

* update snapshots

* keep ubuntu for now

* update tests and snap

* update test and snapshot

* update test and snapshot
  • Loading branch information
maxulysse authored Jul 12, 2024
1 parent 0554167 commit 4e5f468
Show file tree
Hide file tree
Showing 45 changed files with 652 additions and 293 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nextflow": "24.04.3"
},
"timestamp": "2024-02-09T17:06:15.671842533"
"timestamp": "2024-07-11T16:35:51.079804"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,47 @@ nextflow_process {
tag "antismash/antismashlitedownloaddatabases"
tag "untar"

setup {
test("antiSMASH-lite downloaddatabases") {

run("UNTAR", alias: "UNTAR_CSS") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/css.tar.gz', checkIfExists: true)
]
"""
setup {

run("UNTAR", alias: "UNTAR_CSS") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/css.tar.gz', checkIfExists: true)
]
"""
}
}
}

run("UNTAR", alias: "UNTAR_DETECTION") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/detection.tar.gz', checkIfExists: true)
]
"""
run("UNTAR", alias: "UNTAR_DETECTION") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/detection.tar.gz', checkIfExists: true)
]
"""
}
}
}

run("UNTAR", alias: "UNTAR_MODULES") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/modules.tar.gz', checkIfExists: true)
]
"""
run("UNTAR", alias: "UNTAR_MODULES") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/modules.tar.gz', checkIfExists: true)
]
"""
}
}
}
}

test("antiSMASH-lite downloaddatabases") {
when {
process {
"""
Expand All @@ -64,18 +65,56 @@ test("antiSMASH-lite downloaddatabases") {
assertAll(
{ assert process.success },
{ assert snapshot (
file(process.out.database.get(0)).list().sort(),
process.out.versions,
file(process.out.database.get(0)).list().sort(),
process.out.versions,
).match() }
)
}

}

test("antiSMASH-lite downloaddatabases - stub") {

options "-stub"

setup {

run("UNTAR", alias: "UNTAR_CSS") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/css.tar.gz', checkIfExists: true)
]
"""
}
}

run("UNTAR", alias: "UNTAR_DETECTION") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/detection.tar.gz', checkIfExists: true)
]
"""
}
}

run("UNTAR", alias: "UNTAR_MODULES") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ ],
file('https://github.com/nf-core/test-datasets/raw/59ddeb5929f89ddddaff292d67f9025812762b87/data/delete_me/antismash/modules.tar.gz', checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
Expand All @@ -92,7 +131,5 @@ test("antiSMASH-lite downloaddatabases") {
{ assert snapshot(process.out).match() }
)
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nextflow": "24.04.3"
},
"timestamp": "2024-02-07T23:13:12.85814463"
"timestamp": "2024-07-12T13:41:29.456143"
},
"antiSMASH-lite downloaddatabases": {
"content": [
Expand All @@ -55,8 +55,8 @@
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nextflow": "24.04.3"
},
"timestamp": "2024-02-07T23:12:29.947339678"
"timestamp": "2024-07-12T13:41:08.116244"
}
}
34 changes: 22 additions & 12 deletions modules/nf-core/bracken/build/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ nextflow_process {
tag "bracken/build"
tag "untar"

setup {
run ("UNTAR") {
script "../../../untar/main.nf"
process {
"""
input[0] = [[id: 'db'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2_intermediate.tar.gz', checkIfExists: true)]
"""
test("kraken2 - db") {

setup {
run ("UNTAR") {
script "../../../untar/main.nf"
process {
"""
input[0] = [[id: 'db'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2_intermediate.tar.gz', checkIfExists: true)]
"""
}
}
}
}

test("kraken2 - db") {

when {
process {
Expand All @@ -41,6 +41,7 @@ nextflow_process {
file("${process.out.bracken_files[0][1]}/database100mers.kmer_distrib").name,
file("${process.out.bracken_files[0][1]}/database100mers.kraken").name,
file("${process.out.bracken_files[0][1]}/database.kraken").name,
process.out.versions
).match()
}
)
Expand All @@ -52,6 +53,17 @@ nextflow_process {

options "-stub"

setup {
run ("UNTAR") {
script "../../../untar/main.nf"
process {
"""
input[0] = [[id: 'db'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2_intermediate.tar.gz', checkIfExists: true)]
"""
}
}
}

when {
process {
"""
Expand All @@ -66,7 +78,5 @@ nextflow_process {
{ assert snapshot(process.out).match() }
)
}

}

}
59 changes: 52 additions & 7 deletions modules/nf-core/bracken/build/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
"database.kraken",
"database100mers.kmer_distrib",
"database100mers.kraken",
"database.kraken"
"database.kraken",
[
"versions.yml:md5,925c6ae1387eaf6dbd14656125bc6d9b"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nextflow": "24.04.3"
},
"timestamp": "2024-04-17T18:41:03.693430543"
"timestamp": "2024-07-12T13:45:17.37462"
},
"kraken2 - db - stub": {
"content": [
Expand All @@ -26,7 +29,28 @@
"database.kraken:md5,d41d8cd98f00b204e9800998ecf8427e",
"database100mers.kmer_distrib:md5,d41d8cd98f00b204e9800998ecf8427e",
"database100mers.kraken:md5,d41d8cd98f00b204e9800998ecf8427e",
"file.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
"hash.k2d:md5,d41d8cd98f00b204e9800998ecf8427e",
[
[
"G46z5ZvKEd.fna:md5,d41d8cd98f00b204e9800998ecf8427e",
"G46z5ZvKEd.fna.masked:md5,d41d8cd98f00b204e9800998ecf8427e",
"prelim_map.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"prelim_map_MtGz4nUfR3.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"prelim_map_eNakvrOVZm.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"z_4A5lulyr.fna:md5,d41d8cd98f00b204e9800998ecf8427e",
"z_4A5lulyr.fna.masked:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"opts.k2d:md5,d41d8cd98f00b204e9800998ecf8427e",
"seqid2taxid.map:md5,d41d8cd98f00b204e9800998ecf8427e",
"taxo.k2d:md5,d41d8cd98f00b204e9800998ecf8427e",
[
"names.dmp:md5,d41d8cd98f00b204e9800998ecf8427e",
"nodes.dmp:md5,d41d8cd98f00b204e9800998ecf8427e",
"nucl_gb.accession2taxid:md5,d41d8cd98f00b204e9800998ecf8427e",
"prelim_map.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"unmapped.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
Expand Down Expand Up @@ -66,7 +90,28 @@
"database.kraken:md5,d41d8cd98f00b204e9800998ecf8427e",
"database100mers.kmer_distrib:md5,d41d8cd98f00b204e9800998ecf8427e",
"database100mers.kraken:md5,d41d8cd98f00b204e9800998ecf8427e",
"file.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
"hash.k2d:md5,d41d8cd98f00b204e9800998ecf8427e",
[
[
"G46z5ZvKEd.fna:md5,d41d8cd98f00b204e9800998ecf8427e",
"G46z5ZvKEd.fna.masked:md5,d41d8cd98f00b204e9800998ecf8427e",
"prelim_map.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"prelim_map_MtGz4nUfR3.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"prelim_map_eNakvrOVZm.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"z_4A5lulyr.fna:md5,d41d8cd98f00b204e9800998ecf8427e",
"z_4A5lulyr.fna.masked:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"opts.k2d:md5,d41d8cd98f00b204e9800998ecf8427e",
"seqid2taxid.map:md5,d41d8cd98f00b204e9800998ecf8427e",
"taxo.k2d:md5,d41d8cd98f00b204e9800998ecf8427e",
[
"names.dmp:md5,d41d8cd98f00b204e9800998ecf8427e",
"nodes.dmp:md5,d41d8cd98f00b204e9800998ecf8427e",
"nucl_gb.accession2taxid:md5,d41d8cd98f00b204e9800998ecf8427e",
"prelim_map.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"unmapped.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
Expand All @@ -77,8 +122,8 @@
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nextflow": "24.04.3"
},
"timestamp": "2024-04-17T18:41:14.406736156"
"timestamp": "2024-07-12T13:45:26.452181"
}
}
10 changes: 4 additions & 6 deletions modules/nf-core/centrifuge/centrifuge/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ nextflow_process {
file(process.out.results[0][1]).name,
file(process.out.fastq_mapped[0][1][0]).name,
file(process.out.fastq_unmapped[0][1][0]).name,
process.out.versions
).match() }
)
}

}

test("sarscov2_fastq_pe") {
Expand All @@ -56,8 +56,8 @@ nextflow_process {
input[0] = [
[ id:'test', single_end:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
input[1] = UNTAR.out.untar.map{ it[1] }
input[2] = true
input[3] = true
Expand All @@ -73,10 +73,10 @@ nextflow_process {
file(process.out.results[0][1]).name,
file(process.out.fastq_mapped[0][1][0]).name,
file(process.out.fastq_unmapped[0][1][0]).name,
process.out.versions
).match() }
)
}

}

test("sarscov2_fastq_se_stub") {
Expand All @@ -100,7 +100,5 @@ nextflow_process {
{ assert snapshot(process.out).match() }
)
}

}

}
Loading

0 comments on commit 4e5f468

Please sign in to comment.