feat(e2e): lazy app init + playwright sharding for integration tests#8019
feat(e2e): lazy app init + playwright sharding for integration tests#8019jacekradko wants to merge 7 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 50a5db7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis pull request implements test sharding infrastructure and converts application initialization from eager to lazy evaluation. The CI workflow is extended to run integration tests across three shards for Next.js versions 15 and 16, with shard context propagated via environment variables and artifact naming. A new file-based process locking mechanism coordinates initialization across concurrent workers. Application initialization is refactored to check for running instances, adopt state from prior initialization, acquire a process lock, and perform full initialization only when necessary. The global setup removes explicit app initialization, deferring this work to per-app beforeAll hooks that execute with a 5-minute timeout. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Summary
test.beforeAllintestAgainstRunningAppsPLAYWRIGHT_SHARDenv varHow it works
Before: Global setup starts ALL 13 next.appRouter.* apps in parallel → every test waits for all apps → 8 min total
After: Each shard only initializes the ~4-5 apps its tests actually need → 3 shards run in parallel → ~3-4 min critical path
Lazy init flow
test.beforeAllcallsapp.init()init()checks if app is already running (state file + health check)wxflag)Sharding
PLAYWRIGHT_SHARDenv var (e.g.,"1/3")Test plan
PLAYWRIGHT_SHARDunset returnsundefined)Starting full initvsAdopted from state file)Summary by CodeRabbit
Tests
Chores