Skip to content

Commit

Permalink
Convert bclconvert and bcl2fastq modules to nf-test (nf-core#4229)
Browse files Browse the repository at this point in the history
* Convert bcl2fastq to nf-test

* Convert bclconvert tests to nf-test

* Sort snapshot to get a consistent file ordering
  • Loading branch information
Aratz authored Oct 26, 2023
1 parent cad186f commit bb0fc44
Show file tree
Hide file tree
Showing 9 changed files with 372 additions and 10 deletions.
32 changes: 32 additions & 0 deletions modules/nf-core/bcl2fastq/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
nextflow_process {

name "Test Process BCL2FASTQ"
script "modules/nf-core/bcl2fastq/main.nf"
process "BCL2FASTQ"
config "./nextflow.config"
tag "bcl2fastq"
tag "modules"
tag "modules_nfcore"

test("homo sapiens illumina [bcl]") {
when {
process {
//TODO use new test dataset when available, see https://github.com/nf-core/test-datasets/issues/996
"""
input[0] = [
[ id: 'test', lane:1 ],
file(params.test_data['homo_sapiens']['illumina']['test_flowcell_samplesheet'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_flowcell'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
215 changes: 215 additions & 0 deletions modules/nf-core/bcl2fastq/tests/main.nf.test.snap

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

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

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

ext.args = "--tiles s_1_1101"
}
2 changes: 2 additions & 0 deletions modules/nf-core/bcl2fastq/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bcl2fastq:
- modules/nf-core/bcl2fastq/**
41 changes: 41 additions & 0 deletions modules/nf-core/bclconvert/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
nextflow_process {

name "Test Process BCLCONVERT"
script "../main.nf"
process "BCLCONVERT"
config "./nextflow.config"
tag "bclconvert"
tag "modules"
tag "modules_nfcore"

test("homo sapiens illumina [bcl]") {
when {
process {
//TODO use new test dataset when available, see https://github.com/nf-core/test-datasets/issues/996
"""
input[0] = [
[ id: 'test', lane:1 ],
file(params.test_data['homo_sapiens']['illumina']['test_flowcell_samplesheet'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_flowcell'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.reports,
process.out.versions,
process.out.fastq,
process.out.undetermined,
file(process.out.logs.get(0).get(1)).list().sort(),
process.out.interop.get(0).get(1).findAll { file(it).name != "IndexMetricsOut.bin" },
).match()
},
{ assert file(process.out.interop.get(0).get(1).find { file(it).name == "IndexMetricsOut.bin" }).exists() }
)
}
}
}
64 changes: 64 additions & 0 deletions modules/nf-core/bclconvert/tests/main.nf.test.snap

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

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

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

ext.args = {[
meta.lane ? "--bcl-only-lane ${meta.lane}" : "",
"--force",
"--first-tile-only true"
].join(" ").trim()}
}
2 changes: 2 additions & 0 deletions modules/nf-core/bclconvert/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bclconvert:
- modules/nf-core/bclconvert/**
10 changes: 0 additions & 10 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,6 @@ bcftools/view:
- modules/nf-core/bcftools/view/**
- tests/modules/nf-core/bcftools/view/**

bcl2fastq:
- modules/nf-core/bcl2fastq/**
- modules/nf-core/untar/**
- tests/modules/nf-core/bcl2fastq/**

bclconvert:
- modules/nf-core/bclconvert/**
- modules/nf-core/untar/**
- tests/modules/nf-core/bclconvert/**

beagle5/beagle:
- modules/nf-core/beagle5/beagle/**
- tests/modules/nf-core/beagle5/beagle/**
Expand Down

0 comments on commit bb0fc44

Please sign in to comment.