Skip to content

Commit

Permalink
added nf-test files for art/illumina (#4038)
Browse files Browse the repository at this point in the history
* added nf-test files

- two tests (single- and paired-end)
- including two nextflow.configs for `ext.args`

* change tests topass on conda/mamba and singularity/docker

- due to gzip the fastq files will have different md5sums with different engines

* added art/illumina

- should trigger the nf-test CI

* extended tag to art/illumina

* fixed typos -.-

* fixed typo again

- missing quote

* renamed test.yml to tags.yml

* removed art/illumina

* added <tool> tag

* added nf-tests for -stub-run

---------

Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>
  • Loading branch information
MarieLataretu and sateeshperi authored Oct 17, 2023
1 parent 8663c9d commit c578777
Show file tree
Hide file tree
Showing 6 changed files with 373 additions and 4 deletions.
181 changes: 181 additions & 0 deletions modules/nf-core/art/illumina/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
nextflow_process {

name "Test Process ART_ILLUMINA"
script "../main.nf"
process "ART_ILLUMINA"
tag "modules"
tag "modules_nfcore"
tag "art"
tag "art/illumina"

test("single-end") {

config "./single-end.nextflow.config"

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[id: 'test'],
[
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
]
input[1] = 'HS25'
input[2] = '15'
input[3] = '150'
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert path(process.out.aln.get(0).get(1)).md5 == "7aa88720911ca1a862e4a24d57435e3c"},
{ assert path(process.out.fastq.get(0).get(1)).linesGzip.size() == 11880 },
{
def read_name = path(process.out.fastq.get(0).get(1)).linesGzip[0]
assert read_name.equals("@MT192765.1-2970")
},
{
def read = path(process.out.fastq.get(0).get(1)).linesGzip[1]
assert read.equals("GAAAAGAGCTATGAATTGCAGACACCTTTTGAAATTAAATTGGCAAAGAAATTTGACACCTTCTATGGGGAATGTCCAAATTTTGTATTTCCCTTAAATTCCATAATCAAGACTATTCAACCAAGGGTTGAAAAGAAAAAGCTTGATGGC")
},
{
def read_qc = path(process.out.fastq.get(0).get(1)).linesGzip[3]
assert read_qc.equals("C1CGGGCGG=GGGJGJG=JJCJJJCJGJJJJGJJJ1JJJGJJGGJGJJGGGJJGJJJCJGGGJ(=G1GGG(CCCGGGCGCGGGCCGCCG8GGGGGGGGGGCC(CGG1GGGG1GGCGCGGCGGGCGCGGGCGGGGCGCCGGGGGCG8GGGG")
},
{ assert snapshot(process.out.versions).match("versions") }
)
}

}

test("single-end-stub") {

options "-stub-run"
config "./single-end.nextflow.config"

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[id: 'test'],
[
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
]
input[1] = 'HS25'
input[2] = '15'
input[3] = '150'
"""
}
}

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

}

test("paired-end") {

config "./paired-end.nextflow.config"

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[id: 'test'],
[
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
]
input[1] = 'HS25'
input[2] = '15'
input[3] = '150'
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert path(process.out.fastq.get(0).get(1).get(0)).linesGzip.size() == 5940 },
{
def read_name = path(process.out.fastq.get(0).get(1).get(0)).linesGzip[0]
assert read_name.equals("@MT192765.1-2970/1")
},
{
def read = path(process.out.fastq.get(0).get(1).get(0)).linesGzip[1]
assert read.equals("GTTGCGACTACGTGATGAGGAACGAGAAGCGGCTTGACTGCCGCCTCTGCTCCCTTCTGCGTAGAAGCCTTTTGGCAATGTTGTTCCTTGAGGAAGTTGTAGCACGATTGCAGCATTGTTAGCAGGATTGCGGGTGCCAATGTGATCTTT")
},
{
def read_qc = path(process.out.fastq.get(0).get(1).get(0)).linesGzip[3]
assert read_qc.equals("CCCGGGGGGGGGGGCJCJJJJJ1JJJGJJ(JJJGGGJJJJGGJGJJGJJJCCGCJCJC=GCGGG8GJGGGCGG=1G1CJGG=GGCGGCGGGGGCCGG=8GJCCGCCGCGGGGGGGC=GGG=CCGCGGCGGGCC=GGGGGGCGGCCCGCGG")
},
{ assert path(process.out.fastq.get(0).get(1).get(1)).linesGzip.size() == 5940 },
{
def read_name = path(process.out.fastq.get(0).get(1).get(1)).linesGzip[0]
assert read_name.equals("@MT192765.1-2970/2")
},
{
def read = path(process.out.fastq.get(0).get(1).get(1)).linesGzip[1]
assert read.equals("GAGCTACCAGACGAATTCGTGGTGGTGACGGTAAAATGAAAGATCTCAGTCCAAGATGGTATTTCTACTACCTAGGAACTGGGCCAGAAGCTGGACTTCCCTATGGTGCTAACAAAGACGGCATCATATGGGTTGCAACTGAGGGAGCCT")
},
{
def read_qc = path(process.out.fastq.get(0).get(1).get(1)).linesGzip[3]
assert read_qc.equals("1CCGGGGGGGCGGGJJJJJGJG1GJGJ=JGJJCJJJCJJJGJ1GJGJGGJJC8JGG=JGGCGCCGCGGCCCGJCGGGGCJC==CGG88CGGGCGGGCCCGGC8JJJJCGGCGGCCGGGG=CGGGGCCGGCCCGCGCCCCG8GGGG=GGGC")
},
{ assert snapshot(process.out.versions).match("versions") }
)
}

}

test("paired-end-stub") {

options "-stub-run"
config "./paired-end.nextflow.config"

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[id: 'test'],
[
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
]
input[1] = 'HS25'
input[2] = '15'
input[3] = '150'
"""
}
}

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

}

}
180 changes: 180 additions & 0 deletions modules/nf-core/art/illumina/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions modules/nf-core/art/illumina/tests/paired-end.nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

ext.args = '-p -m 250 -s 50 -rs 42'

}
5 changes: 5 additions & 0 deletions modules/nf-core/art/illumina/tests/single-end.nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

ext.args = '-rs 42'

}
2 changes: 2 additions & 0 deletions modules/nf-core/art/illumina/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
art/illumina:
- modules/nf-core/art/illumina/**
4 changes: 0 additions & 4 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ arriba:
- modules/nf-core/arriba/**
- tests/modules/nf-core/arriba/**

art/illumina:
- modules/nf-core/art/illumina/**
- tests/modules/nf-core/art/illumina/**

artic/guppyplex:
- modules/nf-core/artic/guppyplex/**
- tests/modules/nf-core/artic/guppyplex/**
Expand Down

0 comments on commit c578777

Please sign in to comment.