Skip to content

Commit f1862f2

Browse files
committed
Fix loop iteration
1 parent 04bf59d commit f1862f2

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

modules/local/input_validation/input_validation_vcf.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ process INPUT_VALIDATION_VCF {
2525
echo '${JsonOutput.toJson(params.refpanel)}' > reference-panel.json
2626
2727
# Verify if VCF files are valid
28-
for vcf in "$vcf_files"; do
28+
for vcf in $vcf_files; do
2929
# Attempt to create the index using tabix
3030
if ! output=\$(tabix -p vcf "\$vcf" 2>&1); then
3131
echo ::group type=error

tests/main.validate.nf.test

+22-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,33 @@ nextflow_pipeline {
33
name "Pipeline Tests for Input Validation"
44
script "main.nf"
55

6+
test("Should pass with several files") {
7+
8+
when {
9+
params {
10+
project = "test-job"
11+
build = "hg19"
12+
files = "$projectDir/tests/data/input/three/*.vcf.gz"
13+
allele_frequency_population = "eur"
14+
mode = "qc-only"
15+
refpanel_yaml = "$projectDir/tests/data/refpanels/hapmap2/cloudgene.yaml"
16+
output = "${outputDir}"
17+
}
18+
}
19+
20+
then {
21+
assert workflow.success
22+
}
23+
24+
}
25+
626
test("Should fail due to wrong path") {
727

828
when {
929
params {
1030
project = "test-job"
1131
build = "hg19"
12-
files = "$projectDir/tests/data/input/chr20-phased/*.vcf.gzz"
32+
files = "$projectDir/tests/data/input/chr20-phased/*.vcf.gz"
1333
allele_frequency_population = "eur"
1434
mode = "qc-only"
1535
refpanel_yaml = "$projectDir/tests/data/refpanels/hapmap2/cloudgene.yaml"
@@ -23,14 +43,13 @@ nextflow_pipeline {
2343

2444
}
2545

26-
2746
test("Should fail due to unsorted file") {
2847

2948
when {
3049
params {
3150
project = "test-job"
3251
build = "hg19"
33-
files = "$projectDir/tests/data/input/invalid-vcfs/unsorted.vcf.gz"
52+
files = "$projectDir/tests/data/input/invalid-vcfs/*.vcf.gz"
3453
allele_frequency_population = "eur"
3554
mode = "qc-only"
3655
refpanel_yaml = "$projectDir/tests/data/refpanels/hapmap2/cloudgene.yaml"

0 commit comments

Comments
 (0)