Skip to content

Commit 21d3bc4

Browse files
authored
test(cli): parity keyring noise (#6001)
fixes: <details> <summary>ss</summary> <img width="1266" height="909" alt="image" src="https://github.com/user-attachments/assets/082dcec5-3634-4408-83ac-f9b42a7d3da7" /> </details>
1 parent b3cf0e1 commit 21d3bc4

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

packages/cli-test-helpers/src/normalize.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ export function normalize(output: string, options: NormalizeOptions = {}): strin
143143
/^[^\n]*The name org\.freedesktop\.secrets was not provided by any \.service files\n?/gm,
144144
"",
145145
)
146+
// Third shape of the same class: a session bus that is present but
147+
// unreachable surfaces godbus errors ("dbus: couldn't determine
148+
// address of session bus") inside the same store.go wrappers,
149+
// including DeleteAll's "failed to delete all credentials in
150+
// Supabase CLI: %w" (logout). Anchored on the credentials wrappers
151+
// so genuine command errors are never stripped.
152+
.replace(
153+
/^failed to (?:load|set|delete(?: all)?) credentials(?: in [^:\n]+)?: dbus:[^\n]*\n?/gm,
154+
"",
155+
)
146156
// 17c. Docker image-pull progress streamed to stderr. The Go CLI pre-pulls
147157
// via the Docker API and renders progress with jsonmessage
148158
// (`apps/cli-go/internal/utils/docker.go:206-214`), while the ts-legacy

packages/cli-test-helpers/src/normalize.unit.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,23 @@ describe("normalize", () => {
190190
);
191191
});
192192

193+
it("strips dbus session-bus keyring noise under every credentials wrapper", () => {
194+
expect(
195+
normalize("failed to load credentials: dbus: couldn't determine address of session bus\n"),
196+
).toBe("");
197+
expect(
198+
normalize(
199+
"failed to delete all credentials in Supabase CLI: dbus: couldn't determine address of session bus\n",
200+
),
201+
).toBe("");
202+
});
203+
204+
it("keeps genuine credentials failures intact", () => {
205+
expect(normalize("failed to delete credentials: permission denied\n")).toBe(
206+
"failed to delete credentials: permission denied\n",
207+
);
208+
});
209+
193210
it("can strip caller-provided patterns before shared normalization", () => {
194211
expect(
195212
normalize("status: transient\nversion: 2.0.0", { stripPatterns: [/^status: .+\n/gm] }),

0 commit comments

Comments
 (0)