Conversation
|
🎉 This PR is included in version 0.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
kallebysantos
pushed a commit
to kallebysantos/supabase-cli
that referenced
this pull request
May 6, 2026
…(CLI-1360, CLI-1361) (supabase#34) ## What kind of change does this PR introduce? Enhancement to the E2E test framework (CLI-1360, CLI-1361). Stacks on supabase#33. ## What is the current behavior? - Tests set up replay server state and run CLI subprocesses inline with ad-hoc `beforeEach`/`afterEach` boilerplate, duplicated across every test file. - Fixture data is stored as flat per-endpoint JSON files (`recorded/<METHOD>_<PATH>/default.response.json`) with no ordering guarantees for multi-step commands. - Placeholder normalisation used numbered suffixes (`<UUID_1>`, `<TIMESTAMP_1>`, etc.) that caused Go CLI `time.Parse` failures when parsed as real timestamps. ## What is the new behavior? **CLI-1360 — `testBehaviour` / `testParity` custom test API:** - `testBehaviour(name, fn)` wraps a test with full harness lifecycle: temp dir, scenario start/end, and access to `{ run, apiUrl }`. - `testParity(args, opts?)` runs the same command against Go and TS-legacy inside a managed scenario and asserts full parity (stdout, stderr, exit code, requests, fs side-effects). - Both are exported from `test-context.ts` and eliminate all per-file setup boilerplate. **CLI-1361 — Scenario-based fixture system:** - Fixtures are stored as ordered `fixtures/scenarios/<slug>/interactions.json` arrays, one entry per request/response pair. - Recording (`RECORD=true`) dual-writes: each scenario is flushed atomically on `DELETE /_ctrl/scenario`, even when no API calls were made (error-override tests). - Replay uses `normalizeUrlPath` for stable, idempotent path comparison (no numbered placeholder counters). - Placeholder normalisation simplified to unnumbered `<UUID>`, `<PROJECT_REF>`, `<JWT>`, `<API_KEY>`. Timestamps become a fixed valid ISO string (`2000-01-01T00:00:00Z`) so Go CLI `time.Parse` calls succeed against fixture data. - Go version-update notifications stripped from normalised output so parity assertions are not broken by upgrade banners.
Open
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.
What kind of change does this PR introduce?
Feature.
What is the current behavior?
No SMTP server, so no way to check sent emails.
Fixes #22.
What is the new behavior?
Adds an email testing server (inbucket). Can't do things like password reset yet, but at least we can now see sent emails for email confirmation, invitation, password reset, and magic link.