Split the dashboard quality Vitest lane into bounded heap-managed shards to avoid signal exits. - replace the single dashboard quality test command with sequential app and API shard scripts - add a heap wrapper plus Vitest config shard definitions for foundation, component, App, ChatView, and SettingsModal coverage - add guard tests for the sharded dashboard test configuration and restore spinner-animation.css.test.ts to foundation-ui coverage - update the CLI package-config test expectations for the new dashboard test script layout Files changed: packages/cli/src/__tests__/package-config.test.ts | 8 +- packages/dashboard/package.json | 18 +- packages/dashboard/scripts/run-vitest-with-heap.mjs | 41 ++++ packages/dashboard/src/__tests__/dashboard-test-config-guard.test.ts | 77 ++++++ packages/dashboard/vitest.config.ts | 273 ++++++++++++++++++++- 5 files changed, 407 insertions(+), 10 deletions(-) Fusion-Task-Id: FN-5849 Fusion-Task-Lineage: 522f3963-4647-4a59-bb6b-a3dacfbf620e
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
#!/usr/bin/env node
|
|
/* global clearInterval, console, process, setInterval */
|
|
|
|
import { spawn } from "node:child_process";
|
|
const rawArgs = process.argv.slice(2);
|
|
const heapArg = rawArgs.find((arg) => arg.startsWith("--heap="));
|
|
const heapMb = heapArg?.slice("--heap=".length) || "6144";
|
|
const vitestArgs = rawArgs.filter((arg) => !arg.startsWith("--heap="));
|
|
|
|
if (vitestArgs.length === 0) {
|
|
console.error("Usage: node scripts/run-vitest-with-heap.mjs [--heap=6144] <vitest args...>");
|
|
process.exit(1);
|
|
}
|
|
|
|
const nodeOptions = [`--max-old-space-size=${heapMb}`, process.env.NODE_OPTIONS || ""]
|
|
.join(" ")
|
|
.trim();
|
|
const child = spawn("pnpm", ["exec", "vitest", ...vitestArgs], {
|
|
stdio: "inherit",
|
|
env: { ...process.env, NODE_OPTIONS: nodeOptions },
|
|
});
|
|
|
|
const heartbeat = setInterval(() => {
|
|
console.log(`[dashboard-vitest] still running: ${vitestArgs.join(" ")}`);
|
|
}, 5_000);
|
|
|
|
const forwardSignal = (signal) => {
|
|
child.kill(signal);
|
|
};
|
|
|
|
process.on("SIGINT", () => forwardSignal("SIGINT"));
|
|
process.on("SIGTERM", () => forwardSignal("SIGTERM"));
|
|
|
|
child.on("close", (code, signal) => {
|
|
clearInterval(heartbeat);
|
|
if (signal) {
|
|
process.kill(process.pid, signal);
|
|
return;
|
|
}
|
|
process.exit(code ?? 1);
|
|
});
|