test(FN-000): slim dashboard default tests

This commit is contained in:
Aron Prins
2026-05-06 13:18:06 +02:00
parent a9f2fb65ef
commit 9a1d9b59c6
6 changed files with 63 additions and 10 deletions

View File

@@ -28,3 +28,4 @@ why it broke, how it was fixed, and what command verified the fix.
| TSH-010 | Dashboard lane scripts | `pnpm --filter @fusion/dashboard test:api` failed with "No test files found" after converting dashboard to Vitest projects. | Positional glob filters were evaluated against all projects instead of selecting the intended dashboard project. | Dashboard lane scripts now use `--project dashboard-app` and `--project dashboard-api`. | `pnpm --filter @fusion/dashboard test:api` and `pnpm --filter @fusion/dashboard exec vitest run --project dashboard-app app/__tests__/agent-css-classes.test.ts --silent=passed-only --reporter=dot` |
| TSH-011 | PR build coverage | While reducing PR shard minutes, the workflow temporarily had no standalone `pnpm build` job. | The old workflow only had lint, typecheck, and test shards, so removing the shard-local build also removed PR build coverage. | Added an explicit `build` job to `pr-checks.yml` and updated the workflow contract test to require it. | `pnpm --filter @runfusion/fusion exec vitest run src/__tests__/ci-workflow.test.ts --silent=passed-only --reporter=dot` and `pnpm build` |
| TSH-012 | Warning filtering | The first SQLite warning filter also installed a `process.on("warning")` listener that could duplicate unrelated warnings. | Node still prints non-filtered warnings by default, so manually writing them again made future warning output noisier. | The shared setup now only wraps `process.emitWarning` for the known SQLite experimental warning, and the dashboard noisy-output marker list no longer suppresses generic trace-warning guidance. | `pnpm --filter @fusion/core typecheck`, `pnpm --filter @fusion/core exec vitest run src/__tests__/central-db.test.ts --silent=passed-only --reporter=dot`, and `pnpm test:full` |
| TSH-013 | Dashboard default runtime | The default dashboard package test still took about 9 minutes after the noise cleanup. | `pnpm --filter @fusion/dashboard test` continued to run every app/jsdom and API/node file, including exhaustive modal/view permutations and broad route matrices intended for deeper sweeps. | Added curated `dashboard-app-quality` and `dashboard-api-quality` Vitest projects for the default package gate, kept exhaustive coverage behind `test:deep`, `test:app`, and `test:api`, and documented when to run each lane. | `/usr/bin/time -p pnpm --filter @fusion/dashboard test` (148 files, 3642 tests, `real 91.73`), `/usr/bin/time -p pnpm --filter @fusion/dashboard test:deep` (419 files, 10747 tests, `real 335.47`), and `/usr/bin/time -p pnpm test:full` (`real 308.34`) |

View File

@@ -45,7 +45,7 @@ pnpm dev # build + run CLI entrypoint in dev mode
pnpm dev:ui # dashboard dev server only
pnpm lint # lint all packages
pnpm test # changed-only workspace tests (falls back to full suite in safety contexts)
pnpm test:full # full workspace test suite (clean-worktree compatible)
pnpm test:full # full workspace quality gate (clean-worktree compatible)
pnpm build # workspace builds (excludes desktop/mobile)
pnpm build:all # full workspace build (includes desktop/mobile)
pnpm verify:workspace # canonical lint -> test -> build verification gate
@@ -68,7 +68,7 @@ Fusion codifies workspace verification as a deterministic contract:
GitHub Actions now runs deterministic test sharding via `pnpm test:ci:shard --shard <index> --total <count>` in both PR checks and manual CI, while keeping local semantics unchanged:
- `pnpm test` remains changed-only local iteration.
- `pnpm test:full` remains the canonical full local suite.
- `pnpm test:full` remains the canonical workspace quality gate; dashboard exhaustive coverage is explicit via `pnpm --filter @fusion/dashboard test:deep`.
- `pnpm verify:workspace` remains the canonical local lint -> test -> build gate.
`test:ci:shard` is a CI-focused entrypoint (`scripts/ci-test-shard.mjs`) that partitions workspace packages with `test` scripts by shard index modulo total shard count so coverage is deterministic and reproducible.
@@ -161,16 +161,18 @@ pnpm --filter @runfusion/fusion test:extension-integration
## Dashboard Test Lanes
Dashboard tests are split into explicit local lanes. The default dashboard package gate runs the app/API tests; the built-client contract remains a separate lane because it performs its own production build:
Dashboard tests are split into explicit local lanes. The default dashboard package gate is a curated quality gate that keeps representative app/API coverage without running every exhaustive modal, view, and route permutation on every local or PR pass:
```bash
pnpm --filter @fusion/dashboard test:app # React/jsdom app tests
pnpm --filter @fusion/dashboard test:api # Node API/server tests
pnpm --filter @fusion/dashboard test # curated app/API quality gate
pnpm --filter @fusion/dashboard test:deep # exhaustive app + API suite
pnpm --filter @fusion/dashboard test:app # exhaustive React/jsdom app tests
pnpm --filter @fusion/dashboard test:api # exhaustive Node API/server tests
pnpm --filter @fusion/dashboard test:browser-smoke # local browser layout smoke
pnpm --filter @fusion/dashboard test:build # built client output contract
```
Use these lanes for local iteration before PRs. The full workspace test gate runs the default dashboard app/API suite, `pnpm build` remains an explicit PR gate, and PR test shards avoid a redundant pre-test workspace build to save GitHub Actions minutes.
Use the default lane for normal local iteration before PRs. Run `test:deep` when changing broad dashboard architecture, shared modal/view infrastructure, or route registration behavior where the exhaustive permutations are still useful. The built-client contract remains a separate lane because it performs its own production build. `pnpm build` remains an explicit PR gate, and PR test shards avoid a redundant pre-test workspace build to save GitHub Actions minutes.
## Release Process