feat(config): support parallel test projects setup#1585
feat(config): support parallel test projects setup#1585yamachi4416 wants to merge 1 commit intonuxt:mainfrom
Conversation
commit: |
cfd69bf to
b4e637b
Compare
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis pull request reorganizes the app-vitest-workspace example from a single monolithic setup into a multi-app workspace with app1 and app2, each with separate Vitest configurations. The root vitest.config.ts is updated to auto-discover per-app config files using a glob pattern. Additionally, a concurrency-safe wrapper with a lock mechanism is introduced in src/config.ts around startNuxtAndGetViteConfig to serialize calls and prevent race conditions during Vite config initialization. Package dependencies and scripts are updated to support preparing both apps independently. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
b4e637b to
f002d54
Compare
| const startNuxtAndGetViteConfig: typeof _startNuxtAndGetViteConfig = (() => { | ||
| let _lock = Promise.resolve() | ||
|
|
||
| return async (...args) => { | ||
| const acquire = _lock | ||
| let release = () => {} | ||
| _lock = new Promise(resolve => release = resolve) | ||
| try { | ||
| await acquire | ||
| return await _startNuxtAndGetViteConfig(...args) | ||
| } | ||
| finally { | ||
| release() | ||
| } | ||
| } | ||
| })() |
There was a problem hiding this comment.
ideally Nuxt's default asyncContext should mean this isn't necessary:
I wonder what's going wrong, that this isn't working?
There was a problem hiding this comment.
thank you for the review
agreed, investigation will follow to find why
There was a problem hiding this comment.
loadNuxt and buildNuxt run successfully in parallel.
however, when modules use different versions of @nuxt/kit, asyncContext appears to be undefined in those using the secondary version, causing a fallback to nuxtCtx and resulting in a reference to an incorrect Nuxt instance.
🔗 Linked issue
resolves #1307
resolves #1583
❓ Type of change
📚 Description