test: add end-to-end tests against a local Supabase stack - #15
Open
ivasilov wants to merge 6 commits into
Open
Conversation
Add an opt-in e2e suite that runs the adapter against a real local Supabase (PostgREST + Realtime), booted via the vendored `supabase` CLI. A Vitest `projects` split keeps `pnpm test` unit-only and Docker-free while `pnpm test:e2e` self-boots only the containers the adapter needs (db, kong, rest, realtime, auth), seeds via the service-role admin client, and tears the stack down afterwards. The smoke test covers a PostgREST read, an insert, and a realtime event, and a CI workflow runs both suites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e/delete Add reads (WHERE pushdown + queryOnce), mutations (update/delete via PostgREST), and realtime (update/delete from another client, the delete exercising REPLICA IDENTITY FULL) tests. Extract the shared liveUsers and WAIT helpers into e2e.utils so all e2e files reuse them. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The delete payload carries the key via the default replica identity (the collection key is the primary key), not REPLICA IDENTITY FULL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace per-test collection/live-query/cleanup ceremony with lazy test.extend fixtures whose teardown runs even when a test fails — trailing cleanup calls previously leaked websockets on assertion failure. Fold seeding into reset_e2e() (one RPC per test instead of three round trips), warm realtime up against a dedicated e2e_warmup table instead of sentinel rows in users, use createLiveQueryCollection to drop the singleResult cast, read creds via inject() instead of bridging through process.env, dissolve smoke.test.ts into the topic files, and raise the e2e testTimeout so the innermost failing waiter reports before the test times out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
saltcod
approved these changes
Aug 28, 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 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.
Adds an opt-in end-to-end suite that exercises the adapter against a real local Supabase (PostgREST + Realtime), booted through the vendored
supabaseCLI (added as a dev dependency). A Vitestprojectssplit keepspnpm testunit-only and Docker-free, while the newpnpm test:e2eself-boots only the containers the adapter needs (db, kong, rest, realtime, auth — everything else is disabled insupabase/config.toml), seeds data via the service-role admin client and areset_e2e()RPC, then tears the stack down. The migration definesusers/todos/users_todoswith a realtime publication,REPLICA IDENTITY FULL, and RLS-enabled permissive policies (required for Realtime to broadcast), and the global setup warms up Realtime to avoid a cold-start race. The smoke test covers a PostgREST read, an insert, and a realtime event delivered from a second client. A CI workflow runs the unit checks and the e2e suite on Ubuntu runners.🤖 Generated with Claude Code