MCPcopy Index your code
hub / github.com/helm/helm / TestInstallReleaseWithValues

Function TestInstallReleaseWithValues

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

Source from the content-addressed store, hash-verified

286}
287
288func TestInstallReleaseWithValues(t *testing.T) {
289 is := assert.New(t)
290 instAction := installAction(t)
291 userVals := map[string]any{
292 "nestedKey": map[string]any{
293 "simpleKey": "simpleValue",
294 },
295 }
296 expectedUserValues := map[string]any{
297 "nestedKey": map[string]any{
298 "simpleKey": "simpleValue",
299 },
300 }
301 resi, err := instAction.Run(buildChart(withSampleValues()), userVals)
302 if err != nil {
303 t.Fatalf("Failed install: %s", err)
304 }
305 res, err := releaserToV1Release(resi)
306 is.NoError(err)
307 is.Equal(res.Name, "test-install-release", "Expected release name.")
308 is.Equal(res.Namespace, "spaced")
309
310 r, err := instAction.cfg.Releases.Get(res.Name, res.Version)
311 is.NoError(err)
312
313 rel, err := releaserToV1Release(r)
314 is.NoError(err)
315
316 is.Len(rel.Hooks, 1)
317 is.Equal(rel.Hooks[0].Manifest, manifestWithHook)
318 is.Equal(rel.Hooks[0].Events[0], release.HookPostInstall)
319 is.Equal(rel.Hooks[0].Events[1], release.HookPreDelete, "Expected event 0 is pre-delete")
320
321 is.NotEqual(len(res.Manifest), 0)
322 is.NotEqual(len(rel.Manifest), 0)
323 is.Contains(rel.Manifest, "---\n# Source: hello/templates/hello\nhello: world")
324 is.Equal("Install complete", rel.Info.Description)
325 is.Equal(expectedUserValues, rel.Config)
326}
327
328func TestInstallRelease_NoName(t *testing.T) {
329 instAction := installAction(t)

Callers

nothing calls this directly

Calls 9

installActionFunction · 0.85
buildChartFunction · 0.85
withSampleValuesFunction · 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…