Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/cli-test-helpers/src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions packages/cli-test-helpers/src/normalize.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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] }),
Expand Down
Loading