fix(e2e): fix shard DB isolation and flaky test selectors#123
Merged
ryota-murakami merged 1 commit intomainfrom Feb 17, 2026
Merged
fix(e2e): fix shard DB isolation and flaky test selectors#123ryota-murakami merged 1 commit intomainfrom
ryota-murakami merged 1 commit intomainfrom
Conversation
NEXT_PUBLIC_SUPABASE_URL is inlined at build time by Next.js, so all 12 parallel shards shared the same database (port 54321) instead of their own PostgREST instances. Add runtime SUPABASE_URL env var that server code prefers, restoring true per-shard isolation. Also fix strict mode violation where /project note/i matched both the dialog heading and editor content, and clear editor before typing tests.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 Morph Preview Test⚡ Looks like you hit your rate limits! Please upgrade your limits here, or wait a few minutes and try again. If you need help, reach out to support@morphllm.com. Automated testing by Morph |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
=======================================
Coverage 72.12% 72.12%
=======================================
Files 143 143
Lines 4233 4233
Branches 1137 1137
=======================================
Hits 3053 3053
Misses 1159 1159
Partials 21 21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🧪 E2E Coverage Report (Sharded: 12 parallel jobs)
📊 Full report available in workflow artifacts |
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.
Summary
NEXT_PUBLIC_SUPABASE_URLis inlined at build time by Next.js, so all 12 parallel E2E shards shared the same database (port 54321) instead of their shard-specific PostgREST instances — causing massive cross-test contamination (column renames, card deletes, board renames leaking across shards)SUPABASE_URLserver env var thatserver.tsprefers over the build-timeNEXT_PUBLIC_SUPABASE_URL, restoring true per-shard database isolationgetByText(/project note/i)strict mode violation (matched both dialog heading and editor content) and NoteModal typing test not clearing existing contentChanges
src/lib/env.tsSUPABASE_URLserver env varsrc/lib/supabase/server.tsgetSupabaseUrl()helper; all 4 client creators use runtime URLscripts/e2e-parallel.shSUPABASE_URLto each Next.js server instancee2e/logged-in/note-modal.spec.tsgetByText→getByRole('heading'); clear editor before typinge2e/logged-in/project-info-links.spec.tsgetByText→getByRole('heading')Test plan
pnpm typecheck— passpnpm lint— passpnpm test— 1282/1282 passpnpm build— passpnpm e2e:parallel— 12/12 shards pass (was 3/12 before fix)