From ae8785bfbf8aac8012b5541b4933b3c6c4571a49 Mon Sep 17 00:00:00 2001 From: Devanshu Date: Tue, 19 Nov 2024 23:46:54 +0530 Subject: [PATCH] Add additional check for io noop Signed-off-by: Devanshu --- cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go b/cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go index 0430b3ae0..c4004950d 100644 --- a/cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go +++ b/cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go @@ -1,7 +1,7 @@ package release import ( - "os" + "bytes" "os/exec" "testing" @@ -9,8 +9,13 @@ import ( ) func TestReleaseCmdRunnerForKappCmd(t *testing.T) { - ReleaseCmdRunner := NewReleaseCmdRunner(os.Stdout, false, "", false, nil) + var buf bytes.Buffer + ReleaseCmdRunner := NewReleaseCmdRunner(&buf, false, "", false, nil) cmd := exec.Command("kapp", "deploy", "-f", "-", "-a", "pkg-test", "-y") err := ReleaseCmdRunner.RunWithCancel(cmd, nil) require.NoError(t, err) + expectedLength := 0 + if actualLength := buf.Len(); actualLength != expectedLength { + t.Errorf("Got Buffer length = %d, Expected empty", actualLength) + } }