test: reorganize fixture files into modality-first layout (phase 6b)

Move all fixture files from flat/mixed dirs (content/, media/, documents/,
formats/, hostile/, root loose) into the modality-first hierarchy:
image/{valid,formats,edge,hostile}, video/{valid,formats,hostile},
audio/{valid,formats,hostile}, document/{valid,formats,edge,hostile},
data/valid/, security/. Update index.ts paths, fixtureDir aliases,
all literal refs in 17 e2e/qa/script files, manifest.json, and the
three generator scripts. 163 files moved, 0 dropped, 100 new tests
from expanded document scan.
This commit is contained in:
SnapOtter
2026-06-20 05:51:17 +08:00
parent 1727a7a73e
commit 941ed27912
199 changed files with 560 additions and 429 deletions
+8 -6
View File
@@ -89,21 +89,23 @@ async function run(toolId: string, file: string, settings: Record<string, unknow
return { status: res.status, body: (await res.text()).slice(0, 200) };
}
const C = "tests/fixtures/content";
const IMG = "tests/fixtures/image/valid";
const AUD = "tests/fixtures/audio/valid";
const DOC = "tests/fixtures/document/valid";
const t = await run("transcribe-audio", `${C}/speech-10s.wav`, { outputFormat: "txt" });
const t = await run("transcribe-audio", `${AUD}/speech-10s.wav`, { outputFormat: "txt" });
console.log(
"TRANSCRIBE:",
t.out ? `text="${t.out.toString("utf8").slice(0, 200)}"` : JSON.stringify(t).slice(0, 300),
);
const o = await run("ocr", `${C}/ocr-clean.png`, {});
const o = await run("ocr", `${IMG}/ocr-clean.png`, {});
console.log(
"OCR:",
o.out ? `text="${o.out.toString("utf8").slice(0, 200)}"` : JSON.stringify(o).slice(0, 300),
);
const r = await run("remove-background", `${C}/portrait-color.jpg`, { outputFormat: "png" });
const r = await run("remove-background", `${IMG}/portrait-color.jpg`, { outputFormat: "png" });
if (r.out) {
fs.writeFileSync("/tmp/rembg-out.png", r.out);
let probe = "";
@@ -122,14 +124,14 @@ if (r.out) {
}
// F9: ocr-pdf must not segfault and should return text
const op = await run("ocr-pdf", `${C}/ocr-scanned.pdf`, {});
const op = await run("ocr-pdf", `${DOC}/ocr-scanned.pdf`, {});
console.log(
"OCR-PDF:",
op.out ? `out="${op.out.toString("utf8").slice(0, 160)}"` : JSON.stringify(op).slice(0, 300),
);
// F11: RAW processing must work (resize a .cr2 from the formats fixtures)
const raw = await run("resize", "tests/fixtures/formats/sample.cr2", { width: 80 });
const raw = await run("resize", "tests/fixtures/image/formats/sample.cr2", { width: 80 });
console.log(
"RAW-RESIZE(cr2):",
raw.out ? `bytes=${raw.out.length}` : JSON.stringify(raw).slice(0, 300),