Files
SnapOtter/tests/qa/generate-ledger.mts
T
SnapOtterandGitHub d8cf979d4b fix: resolve 18 QA-discovered bugs across tools, previews, and the AI pipeline (#242)
Exhaustive QA sweep of all 157 tools. Fixes: CSP blob media, csv-excel ExcelJS interop, ocr-pdf segfault, chart-maker upload, non-PDF doc preview, RAW decode, merge-tool multi-file path, html-to-image chromium, ogv/wma/amr/ac3 preview fallbacks, meme/gif/stabilize codecs, nav+home a11y. Plus orphan-format and test-debt cleanup, the AI bundle build script, and a reusable Playwright QA harness under tests/qa/.
2026-06-15 22:26:24 +08:00

61 lines
1.7 KiB
TypeScript

// Generates the master coverage ledger (157 rows, complete by construction) from
// tools-meta.json. Discovery shards update cells; any "pending" cell at the end is
// an explicit, surfaced gap. Run: npx tsx tests/qa/generate-ledger.mts
import { readFileSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
interface ToolMeta {
id: string;
name: string;
modality: string;
acceptedInputs: string[];
executionHint: string;
isAI: boolean;
}
const dir = path.dirname(fileURLToPath(import.meta.url));
const meta: ToolMeta[] = JSON.parse(readFileSync(path.join(dir, "tools-meta.json"), "utf8"));
// Cells: "pending" | "pass" | "fail" | "n/a"; counts are integers.
const tools = meta.map((t) => ({
toolId: t.id,
name: t.name,
modality: t.modality,
executionHint: t.executionHint,
isAI: t.isAI,
acceptedFormats: t.acceptedInputs,
acceptedFormatCount: t.acceptedInputs.length,
inputFormatsTested: 0,
inputFormatsTotal: t.acceptedInputs.length,
settingsTested: "pending",
outputFormatsTested: "pending",
multiFile: "pending",
inputPreview: "pending",
outputPreview: "pending",
download: "pending",
negativePath: "pending",
consoleClean: "pending",
status: "pending",
bugs: [] as string[],
}));
const out = path.join(dir, "..", "..", "docs", "qa", "coverage-ledger.json");
writeFileSync(
out,
`${JSON.stringify(
{
generatedAtNote: "stamp set by harness at run time",
toolCount: tools.length,
byModality: tools.reduce<Record<string, number>>((acc, t) => {
acc[t.modality] = (acc[t.modality] ?? 0) + 1;
return acc;
}, {}),
tools,
},
null,
2,
)}\n`,
);
console.log(`ledger: ${tools.length} tools -> ${out}`);