MCPcopy Create free account
hub / github.com/cozystack/talm / TestParallelRenderInternals

Function TestParallelRenderInternals

pkg/engine/helm/engine_test.go:245–270  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

243}
244
245func TestParallelRenderInternals(t *testing.T) {
246 // Make sure that we can use one Engine to run parallel template renders.
247 e := new(Engine)
248 var wg sync.WaitGroup
249 for i := range 20 {
250 wg.Add(1)
251 go func(i int) {
252 tt := fmt.Sprintf("expect-%d", i)
253 tpls := map[string]renderable{
254 "t": {
255 tpl: `{{.val}}`,
256 vals: map[string]any{"val": tt},
257 },
258 }
259 out, err := e.render(tpls)
260 if err != nil {
261 t.Errorf("Failed to render %s: %s", tt, err)
262 }
263 if out["t"] != tt {
264 t.Errorf("Expected %q, got %q", tt, out["t"])
265 }
266 wg.Done()
267 }(i)
268 }
269 wg.Wait()
270}
271
272func TestParseErrors(t *testing.T) {
273 vals := chartutil.Values{helmKeyValues: map[string]any{}}

Callers

nothing calls this directly

Calls 1

renderMethod · 0.80

Tested by

no test coverage detected