Repository navigation
chore: e2e general improvements - #43547
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 9 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change set updates the studio E2E test infrastructure: a GitHub Actions step resets the Supabase directory and re-initializes Supabase before Playwright tests run; global setup now uses native Node.js fs/path/os imports and removes a temporary Playwright locks directory; Playwright config adds contextOptions with reducedMotion: 'reduce'; a new debug utility exports NETWORK_PRESETS and useTestThrottling to apply CPU and network throttling via CDP; test utilities add withSetupCleanup and createTableWithRLS, plus related test adjustments and DB query refactors. Sequence Diagram(s)sequenceDiagram
participant Test as Test Code
participant Playwright as Playwright Runner
participant CDP as CDP Session
participant Browser as Browser Target
Test->>Playwright: call useTestThrottling(page, {cpu?, network?})
Playwright->>CDP: create CDP session for page
alt cpu provided
CDP->>Browser: Emulation.setCPUThrottlingRate(cpuRate)
end
alt network provided
CDP->>Browser: Network.emulateNetworkConditions(preset)
end
Playwright-->>Test: throttling applied
sequenceDiagram
participant GH as GitHub Actions Runner
participant FS as Workspace Filesystem
participant SupabaseCLI as pnpm exec supabase
participant Vercel as Vercel Preview
GH->>FS: remove existing supabase directory (if any)
GH->>SupabaseCLI: supabase init
SupabaseCLI->>FS: create supabase/functions directory
GH->>Vercel: run Playwright tests against Preview
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
e2e/studio/features/_global.setup.ts (1)
84-132:⚠️ Potential issue | 🟠 MajorThe stale-lock cleanup is skipped on the successful setup paths.
Lines 86, 99, and 118 all
returnbefore the new cleanup block runs, so theplaywright-locksdirectory is left behind precisely when setup/auth succeeds. That also means the cleanup happens too late to unblock a run that is already stuck on stale locks beforesetupProjectForTests()/ login work starts. Move this cleanup before the setup flow begins, or wrap the body intry/finallyif you also need post-run cleanup.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@e2e/studio/features/_global.setup.ts` around lines 84 - 132, The cleanup for the stale playwright-locks directory (locksDirPath + fs.access/fs.rm block) runs after early returns from successful auth flows (loginWithEmail, loginWithGithubWithRetry) so it is skipped; move that cleanup block to run before the authentication/setup flow begins (i.e., place the locksDirPath check and fs.rm call before the doAuthentication check and before calling loginWithEmail/loginWithGithubWithRetry) or wrap the entire authentication/setup sequence in a try/finally and perform the locksDirPath cleanup in the finally so it always runs regardless of returns or thrown errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@e2e/studio/features/_global.setup.ts`:
- Around line 84-132: The cleanup for the stale playwright-locks directory
(locksDirPath + fs.access/fs.rm block) runs after early returns from successful
auth flows (loginWithEmail, loginWithGithubWithRetry) so it is skipped; move
that cleanup block to run before the authentication/setup flow begins (i.e.,
place the locksDirPath check and fs.rm call before the doAuthentication check
and before calling loginWithEmail/loginWithGithubWithRetry) or wrap the entire
authentication/setup sequence in a try/finally and perform the locksDirPath
cleanup in the finally so it always runs regardless of returns or thrown errors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 68bb6a1f-ab93-4f74-a0da-a66c15f1d87d
📒 Files selected for processing (4)
.github/workflows/studio-e2e-test.ymle2e/studio/features/_global.setup.tse2e/studio/playwright.config.tse2e/studio/utils/debug.ts
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › cron-jobs.spec.ts › Cron Jobs Integration › Cron Jobs CRUD Operations › can view cron jobs page Skipped testsFeatures › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected |
This comment has been minimized.
This comment has been minimized.
## Problem - Some tests don't always cleanup after themselves or don't do it consistently which make it hard to work on them locally - Some test suites don't allow parallel execution of their tests - Some tests are flaky This a follow up of #43547
Problem
e2e tests are still flaky and not as fast as they could be
Solution