(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…