MCPcopy
hub / github.com/helm/helm / TestInstallRelease_WithNotes

Function TestInstallRelease_WithNotes

pkg/action/install_test.go:339–368  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

337}
338
339func TestInstallRelease_WithNotes(t *testing.T) {
340 is := assert.New(t)
341 instAction := installAction(t)
342 instAction.ReleaseName = "with-notes"
343 vals := map[string]any{}
344 resi, err := instAction.Run(buildChart(withNotes("note here")), vals)
345 if err != nil {
346 t.Fatalf("Failed install: %s", err)
347 }
348 res, err := releaserToV1Release(resi)
349 is.NoError(err)
350
351 is.Equal(res.Name, "with-notes")
352 is.Equal(res.Namespace, "spaced")
353
354 r, err := instAction.cfg.Releases.Get(res.Name, res.Version)
355 is.NoError(err)
356 rel, err := releaserToV1Release(r)
357 is.NoError(err)
358 is.Len(rel.Hooks, 1)
359 is.Equal(rel.Hooks[0].Manifest, manifestWithHook)
360 is.Equal(rel.Hooks[0].Events[0], release.HookPostInstall)
361 is.Equal(rel.Hooks[0].Events[1], release.HookPreDelete, "Expected event 0 is pre-delete")
362 is.NotEqual(len(res.Manifest), 0)
363 is.NotEqual(len(rel.Manifest), 0)
364 is.Contains(rel.Manifest, "---\n# Source: hello/templates/hello\nhello: world")
365 is.Equal(rel.Info.Description, "Install complete")
366
367 is.Equal(rel.Info.Notes, "note here")
368}
369
370func TestInstallRelease_WithNotesRendered(t *testing.T) {
371 is := assert.New(t)

Callers

nothing calls this directly

Calls 9

installActionFunction · 0.85
buildChartFunction · 0.85
withNotesFunction · 0.85
FatalfMethod · 0.80
ContainsMethod · 0.80
releaserToV1ReleaseFunction · 0.70
RunMethod · 0.65
GetMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…