singularity-forge/tests/smoke/run.ts
TÂCHES 6f410a0041 feat(ci): implement three-stage promotion pipeline (Dev → Test → Prod) (#1098)
* feat(ci): add version stamp script for dev publishes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(ci): add CLI smoke tests for pipeline test stage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(ci): add FixtureProvider for LLM conversation recording and replay

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(ci): add fixture test runner and sample recordings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(ci): add live test stubs and pipeline npm scripts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(ci): add three-stage promotion pipeline workflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(ci): add weekly cleanup workflow for stale dev versions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(ci): add fixture recording helper stub

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 00:40:06 -06:00

40 lines
1 KiB
TypeScript

import { readdirSync } from "fs";
import { execFileSync } from "child_process";
import { join, dirname } from "path";
import { fileURLToPath } from "url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const testFiles = readdirSync(__dirname)
.filter((f) => f.startsWith("test-") && f.endsWith(".ts"))
.sort();
if (testFiles.length === 0) {
console.error("No smoke test files found");
process.exit(1);
}
let passed = 0;
let failed = 0;
for (const file of testFiles) {
const filePath = join(__dirname, file);
const label = file.replace(/\.ts$/, "");
try {
execFileSync("node", ["--experimental-strip-types", filePath], {
encoding: "utf8",
stdio: "pipe",
timeout: 30_000,
});
console.log(` PASS ${label}`);
passed++;
} catch (err: any) {
console.error(` FAIL ${label}`);
if (err.stdout) console.error(err.stdout);
if (err.stderr) console.error(err.stderr);
failed++;
}
}
console.log(`\nSmoke tests: ${passed} passed, ${failed} failed`);
if (failed > 0) process.exit(1);