perf(dashboard): de-duplicate overlapping vitest projects
The default `vitest run` (no --project) path — used by `pnpm test` via test-changed's `vitest --changed` scoping — ran every dashboard test file in up to 3 overlapping projects: the `dashboard-app-quality` umbrella, a curated shard, and the broad `dashboard-app`/`dashboard-api` lanes. A scoped run selected 1899 executions for 829 unique files (2.3x redundant work). - Remove the dead `dashboard-app-quality` umbrella project: it re-ran the exact union of its eight curated shards. It is absent from test-inventory-spec.json, dashboardQualityProjectGlobs, and every script; package-config's contract test already asserts test:deep must not use it. - Gate the broad `dashboard-app`/`dashboard-api` includes behind FUSION_DASHBOARD_DEEP so they are empty in the default run (no longer duplicating the curated shards + backfill) but remain selectable via --project. The explicit deep escape hatches (test:deep/test:app/test:api/ test:build) set the flag to opt back in. Default scoped run now selects 829 executions for 829 files (1x). Verified: curated-gate inventory guard intact (828 files, 829 executed, 1 skip-listed), package-config contract test green (31/31), build-output.test.ts still reachable via test:build, deep hatch repopulates with the flag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -80,11 +80,11 @@
|
||||
"test:quality:api": "node scripts/run-quality-tests.mjs --group api",
|
||||
"test:quality:api:curated": "node scripts/run-vitest-with-heap.mjs --heap=6144 run --project dashboard-api-quality --silent=passed-only --reporter=dot --exclude '**/build-output.test.ts'",
|
||||
"test:quality:api:backfill": "pnpm run test:quality:api:backfill-1 && pnpm run test:quality:api:backfill-2",
|
||||
"test:app": "vitest run --project dashboard-app --silent=passed-only --reporter=dot --exclude '**/build-output.test.ts'",
|
||||
"test:api": "vitest run --project dashboard-api --silent=passed-only --reporter=dot",
|
||||
"test:deep": "vitest run --project dashboard-app --project dashboard-api --silent=passed-only --reporter=dot --exclude '**/build-output.test.ts'",
|
||||
"test:app": "FUSION_DASHBOARD_DEEP=1 vitest run --project dashboard-app --silent=passed-only --reporter=dot --exclude '**/build-output.test.ts'",
|
||||
"test:api": "FUSION_DASHBOARD_DEEP=1 vitest run --project dashboard-api --silent=passed-only --reporter=dot",
|
||||
"test:deep": "FUSION_DASHBOARD_DEEP=1 vitest run --project dashboard-app --project dashboard-api --silent=passed-only --reporter=dot --exclude '**/build-output.test.ts'",
|
||||
"test:browser-smoke": "node scripts/browser-layout-smoke.mjs",
|
||||
"test:build": "vitest run --project dashboard-app --silent=passed-only --reporter=dot app/__tests__/build-output.test.ts",
|
||||
"test:build": "FUSION_DASHBOARD_DEEP=1 vitest run --project dashboard-app --silent=passed-only --reporter=dot app/__tests__/build-output.test.ts",
|
||||
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.app.json",
|
||||
"test:quality:api:backfill-1": "node scripts/run-vitest-with-heap.mjs --heap=6144 run --project dashboard-api-quality-backfill --silent=passed-only --reporter=dot --shard=1/2",
|
||||
"test:quality:api:backfill-2": "node scripts/run-vitest-with-heap.mjs --heap=6144 run --project dashboard-api-quality-backfill --silent=passed-only --reporter=dot --shard=2/2"
|
||||
|
||||
@@ -327,6 +327,18 @@ const backfillApiExclude = [
|
||||
];
|
||||
const qualityApiBackfillTests = ["src/**/*.test.{ts,tsx}"];
|
||||
|
||||
// The broad `dashboard-app` / `dashboard-api` lanes fully duplicate the curated
|
||||
// shards + backfill projects, which already partition app/ and src/ exactly
|
||||
// once. They exist ONLY as the explicit deep escape hatches
|
||||
// (`test:deep`/`test:app`/`test:api`/`test:build`). In the DEFAULT no-`--project`
|
||||
// run — e.g. `vitest run --changed` from `pnpm test` — letting their globs match
|
||||
// re-executes every test a second time (and, with the now-removed umbrella, a
|
||||
// third). Gate their includes on FUSION_DASHBOARD_DEEP so the default run uses
|
||||
// the curated partition once; the deep scripts set the flag to opt back in.
|
||||
const deepLaneEnabled = process.env.FUSION_DASHBOARD_DEEP === "1";
|
||||
const deepAppInclude = deepLaneEnabled ? ["app/**/*.test.{ts,tsx}"] : [];
|
||||
const deepApiInclude = deepLaneEnabled ? ["src/**/*.test.{ts,tsx}"] : [];
|
||||
|
||||
export const dashboardQualityProjectGlobs = {
|
||||
"dashboard-app-quality-foundation-api": {
|
||||
include: qualityAppFoundationApiShardTests,
|
||||
@@ -444,16 +456,11 @@ export default defineConfig({
|
||||
testTimeout: 15_000,
|
||||
hookTimeout: 15_000,
|
||||
projects: [
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: "dashboard-app-quality",
|
||||
environment: "jsdom",
|
||||
include: qualityAppTests,
|
||||
exclude: quarantinedDashboardTests,
|
||||
css: { include: [/app\//] },
|
||||
},
|
||||
},
|
||||
// NOTE: the former `dashboard-app-quality` umbrella project was removed —
|
||||
// it re-ran the exact union of the eight curated shards below (a 3rd copy
|
||||
// of every curated app test in the default no-`--project` run). The shards
|
||||
// partition `qualityAppTests` exactly; `dashboardQualityProjectGlobs` and
|
||||
// scripts/lib/test-inventory-spec.json never referenced the umbrella.
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
@@ -569,7 +576,10 @@ export default defineConfig({
|
||||
test: {
|
||||
name: "dashboard-app",
|
||||
environment: "jsdom",
|
||||
include: ["app/**/*.test.{ts,tsx}"],
|
||||
// Empty unless FUSION_DASHBOARD_DEEP=1 (deep escape hatch). Keeps this
|
||||
// broad lane out of the default run so it doesn't duplicate the
|
||||
// curated shards + backfill, while remaining selectable via --project.
|
||||
include: deepAppInclude,
|
||||
exclude: quarantinedDashboardTests,
|
||||
// Process CSS imports only for jsdom tests that assert on
|
||||
// getComputedStyle. Node API tests do not need CSS transforms.
|
||||
@@ -581,7 +591,9 @@ export default defineConfig({
|
||||
test: {
|
||||
name: "dashboard-api",
|
||||
environment: "node",
|
||||
include: ["src/**/*.test.{ts,tsx}"],
|
||||
// Empty unless FUSION_DASHBOARD_DEEP=1 (deep escape hatch); see the
|
||||
// dashboard-app note above.
|
||||
include: deepApiInclude,
|
||||
exclude: quarantinedDashboardTests,
|
||||
css: { include: [] },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user