Skip to content

Commit

Permalink
nf-test migration (#4113)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarieLataretu authored Oct 18, 2023
1 parent 15b935d commit 977d17c
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 4 deletions.
70 changes: 70 additions & 0 deletions modules/nf-core/samtools/sort/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
nextflow_process {

name "Test Process SAMTOOLS_SORT"
script "../main.nf"
process "SAMTOOLS_SORT"
tag "modules"
tag "modules_nfcore"
tag "samtools"
tag "samtools/sort"

test("test_samtools_sort") {

config "./nextflow.config"

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

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

}

test("test_samtools_sort_stub") {

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

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

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

}

}
39 changes: 39 additions & 0 deletions modules/nf-core/samtools/sort/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/samtools/sort/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
process {

withName: SAMTOOLS_SORT {
ext.prefix = { "${meta.id}.sorted" }
}

}
3 changes: 3 additions & 0 deletions modules/nf-core/samtools/sort/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
samtools/sort:
- modules/nf-core/samtools/sort/**
- tests/modules/nf-core/samtools/sort/**
4 changes: 0 additions & 4 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3298,10 +3298,6 @@ samtools/reheader:
- modules/nf-core/samtools/reheader/**
- tests/modules/nf-core/samtools/reheader/**

samtools/sort:
- modules/nf-core/samtools/sort/**
- tests/modules/nf-core/samtools/sort/**

samtools/stats:
- modules/nf-core/samtools/stats/**
- tests/modules/nf-core/samtools/stats/**
Expand Down

0 comments on commit 977d17c

Please sign in to comment.