This repository was archived by the owner on Aug 7, 2026. It is now read-only.
Repository navigation
test: replace the docker-compose stack with the supabase cli - #132
Merged
Merged
Conversation
gotrue v2.155.6 predates the format validation of refresh tokens (supabase/auth#2216) and postgres 13 is EOL. Align the compose stack with the CLI stack (gotrue v2.191.0, postgres 17) so both test tiers run against the same server generation. All 77 legacy tests pass unchanged.
Tr00d
marked this pull request as ready for review
July 7, 2026 15:01
spydon
approved these changes
Jul 7, 2026
o-santi
approved these changes
Jul 7, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
#131 uncovered a classifier bug that had been invisible for months because the test stack pinned
supabase/gotrue:v2.155.6(mid-2024) — the suite was validating the SDK against a server generation that no longer exists in the wild. An SDK's tests should track the server they integrate with, and the earlier drift is caught, the cheaper it is to fix.This PR removes the pin entirely: every suite now runs against the Supabase CLI stack, and CI installs the latest CLI on every run. When gotrue changes auth behavior upstream, the next CI run says so.
Changes
GotrueTests/Support/TestClientsis the single fixture for building clients: anon, admin (service-role JWT signed with the CLI's secret), and stateless factories, all env-overridable (SUPABASE_CLI_AUTH_URL/SUPABASE_CLI_ANON_KEY/SUPABASE_CLI_JWT_SECRET). Ping tests get a URL carrying the apikey as a query parameter, since Kong rejects bare requests andNetworkStatus.PingCheckrequires a 200.supabase/config.tomlprovides what compose used to: anonymous sign-ins, manual linking, phone signup with autoconfirm (dummy Twilio credentials — never contacted), TOTP MFA, GitHub as a dummy provider for the LinkIdentity tests, local SMTP for recovery emails, and raised rate limits (the suite performs ~80 sign-ups per run; the CLI default allows 30 per 5 minutes).localhost:9999, and the bad-service-key test targets the live stack because it needs a server to reject the token (AdminTokenRequired) rather than a dead socket (Offline).docker-compose.yml,GotrueTests/db/, and the compose step in the workflow. An intermediate commit first bumped compose to gotrue v2.191.0/postgres 17 — kept in history as the verification that the legacy suite passes on a current server before the stack swap.Trade-off
Floating the latest CLI means an upstream gotrue release can break CI on an unrelated PR. That's intentional — for this repo, "find out immediately" beats "reproducible forever." If an upstream break ever needs quarantining,
supabase/setup-cliaccepts an exact version for a temporary pin.Verification
Full suite (86 tests: legacy + contract + behavior) passes locally against the CLI stack alone, with the compose stack stopped and removed.