test(cli): make homeDir-dependent tests hermetic - #5993
Open
kanadgupta wants to merge 4 commits into
Open
Conversation
Extract the repeated mockRuntimeInfo({ homeDir }) + processEnvLayer()
pair into legacyIsolatedHomeLayer, replace the four experimental-gate
tests' hand-rolled TelemetryRuntime blocks with mockTelemetryRuntime,
and document the hermeticity rule in the testing policy.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kanadgupta
marked this pull request as ready for review
July 29, 2026 22:55
Contributor
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@9df3716f50fc99f54d794e956aeacbd7c7136308Preview package for commit |
The parity harness only stripped Go's "Keyring is not supported on WSL" line, but on runners with no D-Bus secrets daemon keyring ops fail with "The name org.freedesktop.secrets was not provided by any .service files" inside store.go's "failed to delete credentials: %w" wrapper. This broke the `projects delete --yes` parity e2e on every PR (the TS port intentionally skips Go's no-op credential cleanup). Strip that wording as the same class of keyring-backend availability noise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ty stderr" This reverts commit 0aef997.
Contributor
Author
|
Test failures are due to an unrelated issue, fix for that is in #5997 |
7ttp
pushed a commit
to 7ttp/cli
that referenced
this pull request
Jul 30, 2026
supabase#5997) The `projects delete --yes` parity e2e is failing on every develop-based PR (e.g. supabase#5993 and unrelated branches). Go's best-effort keyring cleanup in `projects delete` (`delete.go:46`) prints its failure to stderr, and the parity normalizer only strips one of Go's two keyring-failure wordings: `Keyring is not supported on WSL` (emitted when the D-Bus client fails with `exec.ErrNotFound`). When the CI runner has a reachable D-Bus session bus but no secrets daemon, go-keyring instead fails with `The name org.freedesktop.secrets was not provided by any .service files`, wrapped as `failed to delete credentials: …` — which survives normalization and breaks the byte-for-byte stderr comparison. The TS port intentionally skips this no-op cleanup and relies on the harness treating Go's keyring-backend availability noise as environment detail. The failure appeared without any repo change (same test passed and failed on the same rootfs image hours apart on 2026-07-29), pointing at runner-environment drift in D-Bus availability. This extends the existing normalization rule to strip the second wording, with a unit test covering both. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests that combined
mockRuntimeInfo's fixed defaulthomeDir(/tmp/supabase-cli-test-home) with a realFileSystemlayer silently picked up stale files left by older test runs or manual CLI invocations — e.g. a leftover~/.supabase/profilecontainingsupabase-stagingbroke twolegacy-cli-configunit tests on a developer machine.mockRuntimeInfo/mockTelemetryRuntimenow default to a per-process unique path that is never created on disk, so the stale-state class of failure can't recur.legacyCliConfigLayer/legacyCredentialsLayeragainst a real filesystem (the six*.layers.unit.test.tslayer-exposure tests, the four experimental-gate tests, andlegacy-cli-config.layer.unit.test.ts) now pinhomeDirto a per-test temp dir and isolate ambient env via a newlegacyIsolatedHomeLayerhelper, which also replaces the hand-rolledTelemetryRuntimeblocks withmockTelemetryRuntime.apps/cli/AGENTS.md.Verified by recreating a poisoned
/tmp/supabase-cli-test-home(stale profile + access token) and running the full core suite against it.🤖 Generated with Claude Code