Skip to content

Commit

Permalink
added unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Shashank Mittal <[email protected]>
  • Loading branch information
shashank-iitbhu committed Aug 15, 2024
1 parent ff9137b commit f4ca526
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/webhook/v1beta1/experiment/validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,17 @@ func TestValidateParameters(t *testing.T) {
},
testDescription: "Not empty max for categorical parameter type",
},
{
parameters: func() []experimentsv1beta1.ParameterSpec {
ps := newFakeInstance().Spec.Parameters
ps[0].FeasibleSpace.Distribution = "invalid-distribution"
return ps
}(),
wantErr: field.ErrorList{
field.Invalid(field.NewPath("spec").Child("parameters").Index(0).Child("feasibleSpace").Child("distribution"), "", ""),
},
testDescription: "Invalid distribution type",
},
}

for _, tc := range tcs {
Expand Down

0 comments on commit f4ca526

Please sign in to comment.