add must fail test

This commit is contained in:
Matthias De Smet 2022-05-24 12:43:49 +02:00
parent 7e777c6626
commit 858cbe80c6
4 changed files with 23 additions and 3 deletions

View file

@ -31,7 +31,7 @@ process MOSDEPTH {
def prefix = task.ext.prefix ?: "${meta.id}" def prefix = task.ext.prefix ?: "${meta.id}"
def reference = fasta ? "--fasta ${fasta}" : "" def reference = fasta ? "--fasta ${fasta}" : ""
def interval = bed ? "--by ${bed}" : "" def interval = bed ? "--by ${bed}" : ""
if (bed && ext.args.contains("--by")) { if (bed && args.contains("--by")) {
exit 1, "--by can only be specified once." exit 1, "--by can only be specified once."
} }

View file

@ -3,6 +3,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' include { MOSDEPTH } from '../../../modules/mosdepth/main.nf'
include { MOSDEPTH as MOSDEPTH_FAIL } from '../../../modules/mosdepth/main.nf'
workflow test_mosdepth { workflow test_mosdepth {
input = [ input = [
@ -47,3 +48,14 @@ workflow test_mosdepth_cram_bed {
MOSDEPTH ( input, bed, fasta ) MOSDEPTH ( input, bed, fasta )
} }
workflow test_mosdepth_fail {
input = [
[ id:'test', single_end:true ],
[ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ],
[ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ]
]
bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ]
MOSDEPTH_FAIL ( input, bed, [] )
}

View file

@ -1,5 +1,7 @@
process { process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: MOSDEPTH_FAIL {
ext.args = "--by 100"
}
} }

View file

@ -65,3 +65,9 @@
md5sum: 5d398caf7171ec4406278e2add3009ae md5sum: 5d398caf7171ec4406278e2add3009ae
- path: output/mosdepth/test.regions.bed.gz.csi - path: output/mosdepth/test.regions.bed.gz.csi
md5sum: 47669cfe41f3e222e74d81e1b1be191f md5sum: 47669cfe41f3e222e74d81e1b1be191f
- name: mosdepth test_mosdepth_fail
command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_fail -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config
tags:
- mosdepth
exitcode: 1