Skip to content

Commit

Permalink
Migration test cutadapt (nf-core#4072)
Browse files Browse the repository at this point in the history
* migrate cutadapt test to modules

* add cutadapt pytest

* fix typo

* fix minor typo

* remove cutadapt pytest

* remove modules.yml

* add tags.yml

* fixed paired reads test

* updated snap

* using filtering for output gz

* Update single-read test name

Co-authored-by: Sateesh_Peri <[email protected]>

* Update paired-reads test name

Co-authored-by: Sateesh_Peri <[email protected]>

---------

Co-authored-by: Sateesh_Peri <[email protected]>
  • Loading branch information
mauro-saporita and sateeshperi authored Nov 24, 2023
1 parent 485558b commit 07881e4
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 4 deletions.
69 changes: 69 additions & 0 deletions modules/nf-core/cutadapt/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
nextflow_process {

name "Test Process CUTADAPT"
script "../main.nf"
process "CUTADAPT"
tag "modules"
tag "modules_nfcore"
tag "cutadapt"

test("sarscov2 Illumina single end [fastq]") {

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[ id: 'test', single_end:true ],
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
]
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert process.out.reads != null },
{ assert process.out.reads.get(0).get(1) ==~ ".*.trim.fastq.gz" },
{ assert snapshot(process.out.versions).match("versions") },
{ assert snapshot(path(process.out.reads.get(0).get(1)).linesGzip[0]).match() }
)
}
}

test("sarscov2 Illumina paired-end [fastq]") {

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[ id: 'test', single_end:false ],
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert process.out.reads != null },
{ assert process.out.reads.get(0).get(1).get(0) ==~ ".*.1.trim.fastq.gz" },
{ assert process.out.reads.get(0).get(1).get(1) ==~ ".*.2.trim.fastq.gz" },
{ assert snapshot(path(process.out.reads.get(0).get(1).get(1)).linesGzip[0]).match() },
{ assert snapshot(process.out.versions).match("versions") }
)
}
}
}
22 changes: 22 additions & 0 deletions modules/nf-core/cutadapt/tests/main.nf.test.snap

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

7 changes: 7 additions & 0 deletions modules/nf-core/cutadapt/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
process {

withName: CUTADAPT {
ext.args = '-q 25'
}

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

cutadapt:
- modules/nf-core/cutadapt/**
- tests/modules/nf-core/cutadapt/**

cutesv:
- modules/nf-core/cutesv/**
- tests/modules/nf-core/cutesv/**
Expand Down

0 comments on commit 07881e4

Please sign in to comment.