- pnpm build now excludes @fusion/desktop and @fusion/mobile by default (recursive build still available as pnpm build:all). Saves time on workspace-wide builds that don't need the native shells. - Hoist the per-package max-worker computation into a shared packages/core/src/__test-utils__/vitest-workers.ts util. Every vitest.config.ts now calls computeMaxWorkers(), which honors VITEST_MAX_WORKERS, FUSION_TEST_TOTAL_WORKERS, and a per-config defaultCap, clamped to cpus-1. - pnpm test sets VITEST_MAX_WORKERS=2 so the workspace run keeps total fan-out modest with --workspace-concurrency=2. - Switch dashboard vitest pool from forks to threads so jsdom/React suites share a V8 heap instead of duplicating ~500MB per worker. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import { resolve } from "node:path";
|
|
import { computeMaxWorkers } from "../core/src/__test-utils__/vitest-workers";
|
|
|
|
const maxWorkers = computeMaxWorkers();
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
setupFiles: [resolve(__dirname, "../core/src/__test-utils__/vitest-setup.ts")],
|
|
globalSetup: [resolve(__dirname, "../core/src/__test-utils__/vitest-teardown.ts")],
|
|
testTimeout: 30_000,
|
|
hookTimeout: 30_000,
|
|
pool: "threads",
|
|
maxWorkers,
|
|
poolOptions: { threads: { minThreads: 1, maxThreads: maxWorkers } },
|
|
fileParallelism: true,
|
|
passWithNoTests: true,
|
|
projects: [
|
|
{
|
|
test: {
|
|
name: "desktop",
|
|
include: ["src/__tests__/**/*.test.ts"],
|
|
pool: "threads",
|
|
isolate: true,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
name: "desktop-renderer",
|
|
include: ["src/renderer/**/*.test.ts", "src/renderer/**/*.test.tsx"],
|
|
environment: "jsdom",
|
|
isolate: true,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|