From 01b1e4b0f6c27ea8b5c2c7f4397f22afb6f30309 Mon Sep 17 00:00:00 2001 From: kylacochrane Date: Mon, 17 Jun 2024 16:32:10 -0400 Subject: [PATCH] Added tests with pd_columns --- .../columns/keep-zero-loci-empty-file.txt | 1 + tests/pipelines/main_missing_alleles.nf.test | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/data/columns/keep-zero-loci-empty-file.txt diff --git a/tests/data/columns/keep-zero-loci-empty-file.txt b/tests/data/columns/keep-zero-loci-empty-file.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/data/columns/keep-zero-loci-empty-file.txt @@ -0,0 +1 @@ + diff --git a/tests/pipelines/main_missing_alleles.nf.test b/tests/pipelines/main_missing_alleles.nf.test index 7d24c06..51b2e71 100644 --- a/tests/pipelines/main_missing_alleles.nf.test +++ b/tests/pipelines/main_missing_alleles.nf.test @@ -134,5 +134,41 @@ nextflow_pipeline { assert iridanext_metadata.sampleQ."address" == "1" } } + + test("Test fail pipeline if non-existent columns file is passed") { + tag "pipeline_failure_columns_no_exist" + + when { + params { + input = "$baseDir/tests/data/samplesheets/samplesheet-hash_missing.csv" + outdir = "results" + + pd_columns = "./no-exist" + } + } + + then { + assert workflow.failed + assert workflow.stderr.contains("* --pd_columns: the file or directory './no-exist' does not exist.") + } + } + + test("Test failure of pipeline when keeping no loci") { + tag "pipeline_keep_zero_loci" + + when { + params { + input = "$baseDir/tests/data/samplesheets/samplesheet-hash_missing.csv" + outdir = "results" + + gm_thresholds = "0" + pd_columns = "$baseDir/tests/data/columns/keep-zero-loci-empty-file.txt" + } + } + + then { + assert workflow.failed + } + } }