feat: add qa lab extension

This commit is contained in:
Peter Steinberger
2026-04-05 08:51:27 +01:00
parent d7f75ee087
commit bb60b53124
39 changed files with 2607 additions and 1126 deletions

View File

@@ -0,0 +1,37 @@
import { startQaLabServer } from "./lab-server.js";
export async function runQaLabSelfCheckCommand(opts: { output?: string }) {
const server = await startQaLabServer({
outputPath: opts.output,
});
try {
const result = await server.runSelfCheck();
process.stdout.write(`QA self-check report: ${result.outputPath}\n`);
} finally {
await server.stop();
}
}
export async function runQaLabUiCommand(opts: { host?: string; port?: number }) {
const server = await startQaLabServer({
host: opts.host,
port: Number.isFinite(opts.port) ? opts.port : undefined,
});
process.stdout.write(`QA Lab UI: ${server.baseUrl}\n`);
process.stdout.write("Press Ctrl+C to stop.\n");
const shutdown = async () => {
process.off("SIGINT", onSignal);
process.off("SIGTERM", onSignal);
await server.stop();
process.exit(0);
};
const onSignal = () => {
void shutdown();
};
process.on("SIGINT", onSignal);
process.on("SIGTERM", onSignal);
await new Promise(() => undefined);
}