diff --git a/packages/cli-test-helpers/src/normalize.ts b/packages/cli-test-helpers/src/normalize.ts index ec0d3e7815..01feb56139 100644 --- a/packages/cli-test-helpers/src/normalize.ts +++ b/packages/cli-test-helpers/src/normalize.ts @@ -132,6 +132,17 @@ export function normalize(output: string, options: NormalizeOptions = {}): strin // strip it from both sides. (Same class of divergence that defers the // login/logout parity tests in auth.e2e.test.ts.) .replace(/^Keyring is not supported on WSL\n?/gm, "") + // Go wraps other Secret Service failures instead of mapping them to + // the WSL message: when no D-Bus secrets daemon is running, keyring + // ops fail with "The name org.freedesktop.secrets was not provided + // by any .service files", printed inside store.go's "failed to + // load/set/delete credentials: %w" wrappers (e.g. `projects delete`'s + // best-effort credential cleanup, delete.go:46-48). Same + // backend-availability noise, different wording — strip it too. + .replace( + /^[^\n]*The name org\.freedesktop\.secrets was not provided by any \.service files\n?/gm, + "", + ) // 17c. Docker image-pull progress streamed to stderr. The Go CLI pre-pulls // via the Docker API and renders progress with jsonmessage // (`apps/cli-go/internal/utils/docker.go:206-214`), while the ts-legacy diff --git a/packages/cli-test-helpers/src/normalize.unit.test.ts b/packages/cli-test-helpers/src/normalize.unit.test.ts index 1ccd8895b2..f11c303764 100644 --- a/packages/cli-test-helpers/src/normalize.unit.test.ts +++ b/packages/cli-test-helpers/src/normalize.unit.test.ts @@ -179,6 +179,17 @@ describe("normalize", () => { expect(normalize(table)).toBe(table.replace(/[ \t]+$/gm, "")); }); + it("strips system-keyring availability noise in both Go wordings", () => { + const goStderr = [ + "Do you want to delete project aaaaaaaaaaaaaaaaaaaa? This action is irreversible. [y/N] y", + "Keyring is not supported on WSL", + "failed to delete credentials: The name org.freedesktop.secrets was not provided by any .service files", + ].join("\n"); + expect(normalize(goStderr)).toBe( + "Do you want to delete project aaaaaaaaaaaaaaaaaaaa? This action is irreversible. [y/N] y\n", + ); + }); + it("can strip caller-provided patterns before shared normalization", () => { expect( normalize("status: transient\nversion: 2.0.0", { stripPatterns: [/^status: .+\n/gm] }),