test: adjusted to make it more meaningful and to pass

Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
pull/13586/head
Jesse Simpson 9 months ago
parent 383a758aec
commit 6bb836374b
No known key found for this signature in database
GPG Key ID: 237495C89AB0AAFC

@ -389,7 +389,6 @@ func determineIfFormattedErrorIsAcceptable(formattedErr error, originalErr error
} }
equivalenceRating := (float64(matchCount) / float64(len(formattedErrTokens))) * 100 equivalenceRating := (float64(matchCount) / float64(len(formattedErrTokens))) * 100
fmt.Printf("Rating: %f\n", equivalenceRating)
if equivalenceRating >= 80 { if equivalenceRating >= 80 {
return formattedErr return formattedErr
} }

@ -1318,6 +1318,17 @@ func TestNestedHelpersProducesMultilineStacktrace(t *testing.T) {
}, },
} }
expectedErrorMessage := `NestedHelperFunctions/templates/svc.yaml:1:9
executing "NestedHelperFunctions/templates/svc.yaml" at <include "nested_helper.name" .>:
error calling include:
NestedHelperFunctions/templates/_helpers_1.tpl:1:39
executing "nested_helper.name" at <include "common.names.get_name" .>:
error calling include:
NestedHelperFunctions/charts/common/templates/_helpers_2.tpl:1:50
executing "common.names.get_name" at <.Release.Name>:
nil pointer evaluating interface {}.Name
`
v := chartutil.Values{} v := chartutil.Values{}
val, _ := chartutil.CoalesceValues(c, v) val, _ := chartutil.CoalesceValues(c, v)
@ -1327,9 +1338,7 @@ func TestNestedHelpersProducesMultilineStacktrace(t *testing.T) {
_, err := Render(c, vals) _, err := Render(c, vals)
assert.NotNil(t, err) assert.NotNil(t, err)
if err != nil { assert.Equal(t, expectedErrorMessage, err.Error())
t.Errorf("Failed to render templates: %s", err)
}
} }
func TestRenderCustomTemplateFuncs(t *testing.T) { func TestRenderCustomTemplateFuncs(t *testing.T) {

Loading…
Cancel
Save