Skip to content

Commit f4ca526

Browse files
added unit test
Signed-off-by: Shashank Mittal <[email protected]>
1 parent ff9137b commit f4ca526

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/webhook/v1beta1/experiment/validator/validator_test.go

+11
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,17 @@ func TestValidateParameters(t *testing.T) {
455455
},
456456
testDescription: "Not empty max for categorical parameter type",
457457
},
458+
{
459+
parameters: func() []experimentsv1beta1.ParameterSpec {
460+
ps := newFakeInstance().Spec.Parameters
461+
ps[0].FeasibleSpace.Distribution = "invalid-distribution"
462+
return ps
463+
}(),
464+
wantErr: field.ErrorList{
465+
field.Invalid(field.NewPath("spec").Child("parameters").Index(0).Child("feasibleSpace").Child("distribution"), "", ""),
466+
},
467+
testDescription: "Invalid distribution type",
468+
},
458469
}
459470

460471
for _, tc := range tcs {

0 commit comments

Comments
 (0)