MCPcopy
hub / github.com/helm/helm / TestReleaseListWriterMethods

Function TestReleaseListWriterMethods

pkg/cmd/list_test.go:362–467  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

360}
361
362func TestReleaseListWriterMethods(t *testing.T) {
363 timestamp := time.Unix(1452902400, 0).UTC()
364 zeroTimestamp := time.Time{}
365 chartInfo := &chart.Chart{
366 Metadata: &chart.Metadata{
367 Name: "test-chart",
368 Version: "1.0.0",
369 AppVersion: "0.0.1",
370 },
371 }
372
373 releases := []*release.Release{
374 {
375 Name: "test-release",
376 Version: 1,
377 Namespace: "default",
378 Info: &release.Info{
379 LastDeployed: timestamp,
380 Status: common.StatusDeployed,
381 },
382 Chart: chartInfo,
383 },
384 {
385 Name: "zero-time-release",
386 Version: 1,
387 Namespace: "default",
388 Info: &release.Info{
389 LastDeployed: zeroTimestamp,
390 Status: common.StatusFailed,
391 },
392 Chart: chartInfo,
393 },
394 }
395
396 tests := []struct {
397 name string
398 status common.Status
399 }{
400 {"deployed", common.StatusDeployed},
401 {"failed", common.StatusFailed},
402 {"pending-install", common.StatusPendingInstall},
403 {"pending-upgrade", common.StatusPendingUpgrade},
404 {"pending-rollback", common.StatusPendingRollback},
405 {"uninstalling", common.StatusUninstalling},
406 {"uninstalled", common.StatusUninstalled},
407 {"superseded", common.StatusSuperseded},
408 {"unknown", common.StatusUnknown},
409 }
410
411 for _, tt := range tests {
412 t.Run(tt.name, func(t *testing.T) {
413 testReleases := []*release.Release{
414 {
415 Name: "test-release",
416 Version: 1,
417 Namespace: "default",
418 Info: &release.Info{
419 LastDeployed: timestamp,

Callers

nothing calls this directly

Calls 5

newReleaseListWriterFunction · 0.85
RunMethod · 0.65
WriteJSONMethod · 0.65
WriteYAMLMethod · 0.65
WriteTableMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…