chore(web): continuous handoff WBV2-P1154-001
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-09-03 14:46:28 +08:00
parent 1f8bf6fc97
commit e89a5ac318
14 changed files with 8671 additions and 9 deletions

View File

@@ -4,8 +4,9 @@ import path from "node:path";
import { expect, test } from "@playwright/test";
const root = path.resolve(import.meta.dirname, "../../..");
const fixtures = JSON.parse(process.env.WBV2_BATCH_FIXTURES ?? "[]") as string[];
const fixtures = JSON.parse(process.env.WBV2_BATCH_FIXTURES ?? JSON.stringify(process.env.WBV2_BATCH_FIXTURE ? [process.env.WBV2_BATCH_FIXTURE] : [])) as string[];
const task = process.env.WBV2_BATCH_TASK ?? "WBV2-P1152-001";
const productionPath = process.env.WBV2_BATCH_PRODUCTION ?? `tests/golden/${task}/modifier-reader-batch-production.json`;
const expectedTypes = JSON.parse(process.env.WBV2_BATCH_TYPES ?? "[]") as string[];
const sourceUnits = JSON.parse(process.env.WBV2_BATCH_UNITS ?? "[]") as string[];
if (!fixtures.length || !expectedTypes.length || !sourceUnits.length) throw new Error("multi-fixture batch requires fixtures, expected types and source units");
@@ -78,7 +79,8 @@ test("multi-fixture modifier reader batch preserves Blender Main metadata", asyn
...result,
};
fs.mkdirSync(path.join(root, `tests/golden/${task}`), { recursive: true });
fs.writeFileSync(path.join(root, `tests/golden/${task}/modifier-reader-batch-production.json`), `${JSON.stringify(report, null, 2)}\n`);
fs.mkdirSync(path.dirname(path.join(root, productionPath)), { recursive: true });
fs.writeFileSync(path.join(root, productionPath), `${JSON.stringify(report, null, 2)}\n`);
const observedTypes = new Set(Object.values(result).flatMap((entry: any) => entry?.types ?? []));
for (const type of expectedTypes) expect(observedTypes.has(type)).toBe(true);