Files
workinf_Blender_Wasm/tools/web/check-blender-feature-route-catalog.mjs
mes123456 e9bfef0c5a
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
feat(web): complete Blender route runtime execution
2026-09-07 00:12:32 +08:00

18 lines
1.7 KiB
JavaScript

import assert from "node:assert/strict";
import fs from "node:fs";
const catalog = JSON.parse(fs.readFileSync(new URL("../../web/app/src/capabilities/blender-feature-route-catalog.json", import.meta.url), "utf8"));
const inventory = JSON.parse(fs.readFileSync(new URL("../../tests/golden/WBV2/dynamic-inventory.json", import.meta.url), "utf8"));
assert.equal(catalog.schemaVersion, 1);
assert.equal(catalog.unitCount, inventory.summary.unitCount);
assert.equal(catalog.classifiedCount, catalog.entries.length);
assert.equal(catalog.unclassifiedCount, 0);
assert.deepEqual(new Set(catalog.entries.map((entry) => entry.id)), new Set(inventory.units.map((entry) => entry.id)));
assert.ok(catalog.entries.every((entry) => ["WEB_MAIN", "SERVER_NATIVE", "BROWSER_EQUIVALENT", "UNAVAILABLE"].includes(entry.route)));
const browserGroups = new Set(Object.keys(catalog.browserActionGroups ?? {}));
assert.ok(catalog.entries.filter((entry) => entry.route === "BROWSER_EQUIVALENT").every((entry) => browserGroups.has(entry.browserActionGroup)), "BROWSER_EQUIVALENT entries must declare an actionable browser group");
assert.ok(catalog.entries.filter((entry) => entry.route === "SERVER_NATIVE").every((entry) => entry.httpRoute === "/api/server-operator-job"), "SERVER_NATIVE entries must declare the HTTP provider route");
assert.equal(catalog.behavioralEvidence.verifiedUnits + catalog.behavioralEvidence.unverifiedUnits, catalog.unitCount);
assert.equal(catalog.behavioralEvidence.verifiedUnits, 1025);
process.stdout.write(`blender-feature-route-catalog-ok units=${catalog.unitCount} server=${catalog.counts.SERVER_NATIVE ?? 0} browser=${catalog.counts.BROWSER_EQUIVALENT ?? 0} verified=${catalog.behavioralEvidence.verifiedUnits} unverified=${catalog.behavioralEvidence.unverifiedUnits}\n`);