Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

test: replace the docker-compose stack with the supabase cli - #132

Merged
Tr00d merged 3 commits into
masterfrom
fix-legacy-test-stack
Jul 7, 2026
Merged

Tr00d merged 3 commits into
masterfrom
fix-legacy-test-stack

Conversation

@Tr00d

@Tr00d Tr00d commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

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/TestClients is 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 and NetworkStatus.PingCheck requires a 200.
  • supabase/config.toml provides 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).
  • Test suites change only how they build clients. Two exceptions: provider-URL assertions no longer hardcode 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).
  • Deleted: 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-cli accepts 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.

Tr00d added 3 commits July 7, 2026 11:44
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
Tr00d marked this pull request as ready for review July 7, 2026 15:01
@Tr00d
Tr00d merged commit 9371b58 into master Jul 7, 2026
1 check passed
@Tr00d
Tr00d deleted the fix-legacy-test-stack branch July 7, 2026 15:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants