@@ -89,6 +89,7 @@ class Tester {
89
89
// A convenient list of normalised service descriptor option names
90
90
// i.e. 'arg.volumes' becomes 'volumes' (also contains expanded ranges)
91
91
def optionNames = []
92
+ def optionMinValues = []
92
93
def optionDefaults = [:]
93
94
// Files created by the entire test collection.
94
95
// Defined in the 'setup_collection.creates' block.
@@ -466,6 +467,7 @@ class Tester {
466
467
// (to avoid contamination from a prior test)
467
468
optionNames. clear()
468
469
optionDefaults. clear()
470
+ optionMinValues. clear()
469
471
470
472
currentServiceDescriptor. serviceConfig. optionDescriptors. each { option ->
471
473
@@ -478,6 +480,11 @@ class Tester {
478
480
optionNames. add(arglessOption)
479
481
}
480
482
483
+ // Collect the optional minValues value
484
+ if (option. minValues != null ) {
485
+ optionMinValues. add(option. minValues)
486
+ }
487
+
481
488
// Collect the optional default value?
482
489
if (option. defaultValue != null ) {
483
490
if (option. defaultValue in java.util.List ) {
@@ -536,7 +543,7 @@ class Tester {
536
543
537
544
if (checkStatus) {
538
545
// Now check that the user has not missed an option.
539
- optionNames. each { option ->
546
+ optionNames. each { String option ->
540
547
boolean foundParam = false
541
548
params. each { param ->
542
549
// Accommodate range parameters
@@ -555,7 +562,7 @@ class Tester {
555
562
}
556
563
}
557
564
}
558
- if (! foundParam) {
565
+ if (! foundParam && optionMinValues . size() > 0 && optionMinValues[ 0 ] > 0 ) {
559
566
Log . err(" Pipeline option '$option ' is not defined in the test's params" +
560
567
" and there is no default value to use." )
561
568
checkStatus = false
0 commit comments