Repository navigation
Integration tests: Run the local stack without Docker, on Supabase CLI's new native runtime - #246
Merged
Merged
Conversation
…ving out the settings that restate the Supabase CLI's defaults. Co-Authored-By: Claude <noreply@anthropic.com>
…ce of Docker, on the platforms that runtime supports, and remove the two tests that asserted Kong's answers, since that stack runs no Kong. `TestDelimitedIdentifierTableNameSingleDot` and `TestDelimitedIdentifierTableNameDoubleDot` asserted what Kong answers for tables named `.` and `..`, which it resolves as dot segments before routing. The native runtime's gateway is the CLI's own proxy, which forwards both names to PostgREST as written, so the two tables are now read as cases of `TestDelimitedIdentifierTableNames`. Co-Authored-By: Claude <noreply@anthropic.com>
…and say its files are edited in place. Co-Authored-By: Claude <noreply@anthropic.com>
… add `check-all.sh`, which runs it and then `integration-test.sh`. Co-Authored-By: Claude <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.
🤖 Claude's Summary
The local stack behind the integration tests moves to Supabase CLI 3.5.0, takes the configuration format that
supabase initnow writes and runs on the CLI's native runtime, so neither CI nor a developer's machine needs Docker any more. That stack runs no Kong, so the two tests that asserted Kong's answers are removed. Because the stack now runs directly on macOS as well as Linux, a newscripts/check-all.shruns the checks and then the integration tests in one go. Each commit below takes one step.03f441a ./scripts/upgrade-to-latest-supabase-cli.sh
The pinned Supabase CLI moves from 3.3.0 to 3.4.0, with the four checksums from the release's published
checksums.txt. From this releasesupabase initwritessupabase/config.jsoncin place ofsupabase/config.toml.d5d2174 Convert the integration stack's configuration from TOML to JSONC, leaving out the settings that restate the Supabase CLI's defaults
The stack's configuration moves from
config.tomltoconfig.jsonc, with a$schemakey that points editors at the CLI's published schema for validation and completion. The CLI still readsconfig.toml, so this follows its new default rather than fixing a fault.Three settings only restated defaults that the pinned CLI's config schema declares, and are gone:
auth.enabled,auth.site_urlanddb.major_version. Postgres now runs whichever major version the pinned CLI defaults to, soDEVELOPMENT.mdno longer lists it among the pins checked by eye. Every other setting differs from its default and carries over unchanged.Test failure messages that named
config.tomlor its section syntax now nameconfig.jsoncand key paths. A comment on the email-change links credited the configuration with turning on secure email change, and now credits the CLI's default. The comment on reading the stack's keys no longer says the configuration keeps Auth on, and loses its references to the Go CLI'sstatus.goand to the CLI repository's tests.a56210a Run the integration stack on the Supabase CLI's native runtime in place of Docker, on the platforms that runtime supports, and remove the two tests that asserted Kong's answers, since that stack runs no Kong
The stack now runs on the Supabase CLI's stack backend and its native runtime, which runs each service as a process on the host. Neither CI nor a developer's machine needs Docker any more, and the tests run directly on macOS 14 or later on Apple silicon as well as on Linux.
config.jsoncturns onexperimental.stackand drops the fixed ports, since the stack backend refuses a configured port from 10000 to 19999. The CLI now gives each stack free ports from 20000 to 32767, which stays below Linux's ephemeral range.project_idgoes too, because the stack backend identifies a stack by its project directory.scripts/integration-test.shstarts the stack with--runtime native --eager, reads its URL and keys withstatus --env --output-format textand destroys it on exit, as the stack backend has nostop --no-backup.DEVELOPMENT.md, which lists the platforms the native runtime supports.DEVELOPMENT.mdlists the native runtime's platforms where it gives the integration tests' prerequisites, and says how to remove a stack that a killed run leaves behind. The headers ofintegration-test.sh,check-fast.shandbuild-and-test.sh, the CI workflow and the runner-label record indecisions.mdno longer mention Docker.This commit also removes two tests,
TestDelimitedIdentifierTableNameSingleDotandTestDelimitedIdentifierTableNameDoubleDot. Both asserted what Kong, the Docker stack's gateway, answers for a table named.or... The SDK sends those names as%2Eand%2E%2E, and Kong resolves both as dot segments before routing (normalization behavior), so neither request reached its table. The second test also required Kong's own no-route message. The native runtime's stack runs no Kong. Its gateway is the CLI's own proxy, which forwards a path as written (HttpProxy.ts), so nothing in either test holds there. Both tables are now read like any other, as two new cases ofTestDelimitedIdentifierTableNames. What the SDK does with a body that will not decode, and with an error body that is not PostgREST's, stays covered by the unit tests inpostgrest/builder_test.go.The stack backend is experimental. The CLI stays checksum-pinned, so its flags and output change only with a deliberate bump, and the upgrade procedure in
DEVELOPMENT.mdnow says to check them.5e375fa ./scripts/upgrade-to-latest-supabase-cli.sh
The pinned Supabase CLI moves from 3.4.0 to 3.5.0, with the three checksums from the release's published
checksums.txt. The stack's Postgres moves from 17.12.0.002 to 17.12.0.006 and its Auth from v2.198.0 to v2.199.0, while PostgREST stays at v16.6. The stack commands the script runs, and the output it reads, are unchanged.ee0c108 Give the current reasons the integration schema lives in migrations, and say its files are edited in place
decisions.mdsaid the integration schema lives inmigrations/because the Supabase CLI ran a seed file as a single prepared batch, so DDL could not share a file with the inserts that depend on it. CLI 3 runs seed statements one at a time, so that reason no longer holds. The entry now gives the reasons that do: Supabase's seeding guidance keeps seed files to data, and declarative schema files undersupabase/schemas/would only be turned into more migration files.DEVELOPMENT.mdnow says how to change the schema: edit the statement that creates an object, since every run starts from an empty database, and add a file only for a new concern. A comment in0_schema.sqlno longer sayspractice_logsis applied after the file that creates it.da64e03 Rename
check-fast.shtocheck-all-except-integration-tests.shand addcheck-all.sh, which runs it and thenintegration-test.shcheck-fast.shtakes longer to run thanintegration-test.sh, so its name no longer fits. It is nowcheck-all-except-integration-tests.sh, which says what it leaves out. The newcheck-all.shruns it and thenintegration-test.sh, stopping at the first that fails, so one command covers both before a push.comment-check.shprobes live websites and stays outside both, as it stayed outsidecheck-fast.sh.All three scripts print the date and time as they start and as they finish, with the real time they ran for, through a helper in
scripts/common.sh. A failed run prints its finish line too, and the last line of acheck-all.shrun gives the time both scripts took together. WhereDEVELOPMENT.md,decisions.md, the CI workflow's comments and one test's comment said "the fast tier", they now name the script that does the work.