MCPcopy
hub / github.com/helm/helm / TestReleaseTestNotesHandling

Function TestReleaseTestNotesHandling

pkg/cmd/release_testing_test.go:42–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestReleaseTestNotesHandling(t *testing.T) {
43 // Test that ensures notes behavior is correct for test command
44 // This is a simpler test that focuses on the core functionality
45
46 rel := &release.Release{
47 Name: "test-release",
48 Namespace: "default",
49 Info: &release.Info{
50 Status: rcommon.StatusDeployed,
51 Notes: "Some important notes that should be hidden by default",
52 },
53 Chart: &chart.Chart{Metadata: &chart.Metadata{Name: "test", Version: "1.0.0"}},
54 }
55
56 // Set up storage
57 store := storageFixture()
58 store.Create(rel)
59
60 // Set up action configuration properly
61 actionConfig := &action.Configuration{
62 Releases: store,
63 KubeClient: &kubefake.FailingKubeClient{PrintingKubeClient: kubefake.PrintingKubeClient{Out: io.Discard}},
64 Capabilities: common.DefaultCapabilities,
65 }
66
67 // Test the newReleaseTestCmd function directly
68 var buf1 bytes.Buffer
69
70 // Test 1: Default behavior (should hide notes)
71 cmd1 := newReleaseTestCmd(actionConfig, &buf1)
72 cmd1.SetArgs([]string{"test-release"})
73 err1 := cmd1.Execute()
74 if err1 != nil {
75 t.Fatalf("Unexpected error for default test: %v", err1)
76 }
77 output1 := buf1.String()
78 if strings.Contains(output1, "NOTES:") {
79 t.Errorf("Expected notes to be hidden by default, but found NOTES section in output: %s", output1)
80 }
81}

Callers

nothing calls this directly

Calls 6

storageFixtureFunction · 0.85
newReleaseTestCmdFunction · 0.85
FatalfMethod · 0.80
ContainsMethod · 0.80
CreateMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…