mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #286] [CLOSED] perf: split vitest into unit and integration projects #445
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#445
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/286
Author: @southpolesteve
Created: 3/6/2026
Status: ❌ Closed
Base:
main← Head:improve/vitest-workspace-split📝 Commits (1)
1409521perf: split vitest into unit and integration projects📊 Changes
2 files changed (+56 additions, -16 deletions)
View changed files
📝
package.json(+2 -0)📝
vitest.config.ts(+54 -16)📄 Description
Summary
test:unitandtest:integrationnpm scripts for targeted runspnpm test)Motivation
The full vitest suite takes ~2 minutes because
fileParallelism: falseforces all 52 test files to run serially. This is necessary for integration tests (they race on Vite's deps optimizer cache), but the 28 unit test files don't start dev servers and don't need serial execution.With vitest 3.x,
fileParallelismis a global-only setting (it cannot be set per-project), so both projects still run serially when you invokepnpm test. The practical win is that developers and agents can now run subsets:pnpm testpnpm test:unitpnpm test:integrationpnpm test -- tests/routing.test.tsWhen multiple agents are working on the repo simultaneously,
pnpm test:unitprovides a fast feedback loop without the overhead of spinning up Vite dev servers.Integration test classification
Tests are classified as integration if they call
startFixtureServer(), importcreateServerfrom Vite, or spawn dev server subprocesses. TheintegrationTestsarray invitest.config.tsdocuments this and includes guidance for future test authors.Future improvement
When vitest adds per-project
fileParallelismsupport (tracked in vitest 4.x), unit tests can run in parallel while integration tests remain serial. This would further reduce the full suite runtime./bigbonk review this
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.