lint stuck with malformed template object See https://github.com/helm/helm/issues/11391
(t *testing.T)
| 225 | // lint stuck with malformed template object |
| 226 | // See https://github.com/helm/helm/issues/11391 |
| 227 | func 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 | } |