perf(dashboard tests): raise per-package worker cap and scope CSS to jsdom
Local single-package runs were single-threaded due to defaultCap: 1; bump to 3 so iterative `pnpm --filter @fusion/dashboard test` actually uses available cores (workspace runs still clamp via FUSION_TEST_TOTAL_WORKERS). CSS transform was applied to every file via /.+/ but only jsdom-environment tests under app/** read computed styles. Restrict include to /app\// so node-env src/** tests skip the CSS pipeline. Wall time on the dashboard suite drops from ~205s to ~148s (-28%). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import react from "@vitejs/plugin-react";
|
||||
import { resolve } from "node:path";
|
||||
import { computeMaxWorkers } from "../core/src/__test-utils__/vitest-workers";
|
||||
|
||||
const maxWorkers = computeMaxWorkers({ defaultCap: 1 });
|
||||
const maxWorkers = computeMaxWorkers({ defaultCap: 3 });
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
@@ -24,9 +24,10 @@ export default defineConfig({
|
||||
environmentMatchGlobs: [
|
||||
["app/**", "jsdom"],
|
||||
],
|
||||
// Process CSS imports so jsdom-based tests that assert on getComputedStyle
|
||||
// see the actual rules from co-located component CSS files.
|
||||
css: { include: [/.+/] },
|
||||
// Process CSS imports only for jsdom-based tests that assert on
|
||||
// getComputedStyle. Node-env tests under src/** don't need CSS rules and
|
||||
// skipping the transform there cuts a large slice of total wall time.
|
||||
css: { include: [/app\//] },
|
||||
globals: true,
|
||||
include: ["app/**/*.test.{ts,tsx}", "src/**/*.test.{ts,tsx}"],
|
||||
setupFiles: [
|
||||
|
||||
Reference in New Issue
Block a user