Skip to content

Commit

Permalink
fix analysis template arguments validate
Browse files Browse the repository at this point in the history
Signed-off-by: zhouchencheng <zhouchencheng@bilibili.com>
  • Loading branch information
zcc35357949 committed Mar 19, 2021
1 parent 8111b1e commit 53c582c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/apis/rollouts/validation/validation_references_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ func TestValidateAnalysisTemplateWithType(t *testing.T) {
assert.Equal(t, expectedError.Error(), allErrs[0].Error())
})

t.Run("validate inline analysisTemplate argument - success", func(t *testing.T) {
template := getAnalysisTemplateWithType()
template.AnalysisTemplate.Spec.Args = []v1alpha1.Argument{
{
Name: "service-name",
},
}
allErrs := ValidateAnalysisTemplateWithType(template)
assert.Empty(t, allErrs)
})

// verify background analysis does not care about a metric that runs indefinitely
t.Run("validate background analysisTemplate - success", func(t *testing.T) {
count := intstr.FromInt(0)
Expand Down

0 comments on commit 53c582c

Please sign in to comment.