Skip to content

Commit

Permalink
add check for failures
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed Oct 29, 2024
1 parent fe5c75a commit 9c1fbc5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/annotation-snpeff.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,31 @@ nextflow_pipeline {
)
}
}

test("Fails with profile test | --tools snpeff --snpeff_db na --build_only_index") {
when {
params {
modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/'
outdir = "$outputDir"
input = "${projectDir}/tests/csv/3.0/vcf_single.csv"
step = 'annotate'
snpeff_cache = 's3://annotation-cache/snpeff_cache/'
snpeff_db = "na"
input = false
build_only_index = true
tools = 'snpeff'
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
assertAll(
{ assert workflow.failed},
{ assert workflow.stdout.toString().contains("This path is not available within annotation-cache") }
)
}
}
}
27 changes: 27 additions & 0 deletions tests/annotation-vep.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,31 @@ nextflow_pipeline {
)
}
}

test("Fails with profile test | --tools vep --vep_cache_version 1 --build_only_index") {
when {
params {
modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/'
outdir = "$outputDir"
input = "${projectDir}/tests/csv/3.0/vcf_single.csv"
step = 'annotate'
vep_cache = 's3://annotation-cache/vep_cache/'
vep_cache_version = 1
input = false
build_only_index = true
tools = 'vep'
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
assertAll(
{ assert workflow.failed},
{ assert workflow.stdout.toString().contains("This path is not available within annotation-cache") }
)
}
}
}

0 comments on commit 9c1fbc5

Please sign in to comment.