From 1e3f4d0f4a551cd8c872a20643e4d20bb2d99262 Mon Sep 17 00:00:00 2001 From: Ishwar Date: Tue, 31 Mar 2026 21:54:17 +0530 Subject: [PATCH] fix: update e2e tests to expect exit code 130 on user decline Signed-off-by: Ishwar --- pkg/compose/publish_test.go | 2 -- pkg/e2e/publish_test.go | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/compose/publish_test.go b/pkg/compose/publish_test.go index 31932632f..3b0e5a438 100644 --- a/pkg/compose/publish_test.go +++ b/pkg/compose/publish_test.go @@ -104,7 +104,6 @@ services: } func Test_preChecks_sensitive_data_detected_decline(t *testing.T) { - dir := t.TempDir() envPath := dir + "/secrets.env" secretData := `AWS_SECRET_ACCESS_KEY="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"` @@ -112,7 +111,6 @@ func Test_preChecks_sensitive_data_detected_decline(t *testing.T) { assert.NilError(t, err) project := &types.Project{ - Services: types.Services{ "web": { Name: "web", diff --git a/pkg/e2e/publish_test.go b/pkg/e2e/publish_test.go index b5488df60..1dd83d031 100644 --- a/pkg/e2e/publish_test.go +++ b/pkg/e2e/publish_test.go @@ -71,7 +71,7 @@ or remove sensitive data from your Compose configuration "-p", projectName, "publish", "test/test", "--dry-run") cmd.Stdin = strings.NewReader("n\n") res := icmd.RunCmd(cmd) - res.Assert(t, icmd.Expected{ExitCode: 0}) + res.Assert(t, icmd.Expected{ExitCode: 130}) out := res.Combined() assert.Assert(t, strings.Contains(out, "you are about to publish bind mounts declaration within your OCI artifact."), out) assert.Assert(t, strings.Contains(out, "e2e/fixtures/publish:/user-data"), out) @@ -111,7 +111,7 @@ or remove sensitive data from your Compose configuration "-p", projectName, "publish", "test/test", "--with-env", "--dry-run") cmd.Stdin = strings.NewReader("n\n") res := icmd.RunCmd(cmd) - res.Assert(t, icmd.Expected{ExitCode: 0}) + res.Assert(t, icmd.Expected{ExitCode: 130}) output := res.Combined() assert.Assert(t, strings.Contains(output, "you are about to publish sensitive data within your OCI artifact.\n"), output)