MCPcopy
hub / github.com/helm/helm / TestMalformedTemplate

Function TestMalformedTemplate

pkg/chart/v2/lint/lint_test.go:227–247  ·  view source on GitHub ↗

lint stuck with malformed template object See https://github.com/helm/helm/issues/11391

(t *testing.T)

Source from the content-addressed store, hash-verified

225// lint stuck with malformed template object
226// See https://github.com/helm/helm/issues/11391
227func TestMalformedTemplate(t *testing.T) {
228 var values map[string]any
229 c := time.After(3 * time.Second)
230 ch := make(chan int, 1)
231 var m []support.Message
232 go func() {
233 m = RunAll(malformedTemplate, values, namespace).Messages
234 ch <- 1
235 }()
236 select {
237 case <-c:
238 t.Fatal("lint malformed template timeout")
239 case <-ch:
240 if len(m) != 1 {
241 t.Fatalf("All didn't fail with expected errors, got %#v", m)
242 }
243 if !strings.Contains(m[0].Err.Error(), "invalid character '{'") {
244 t.Error("All didn't have the error for invalid character '{'")
245 }
246 }
247}

Callers

nothing calls this directly

Calls 5

FatalMethod · 0.80
FatalfMethod · 0.80
ContainsMethod · 0.80
RunAllFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…