11 lines
2.8 KiB
JavaScript
11 lines
2.8 KiB
JavaScript
#!/usr/bin/env node
|
|
import crypto from "node:crypto"; import fs from "node:fs"; import path from "node:path";
|
|
const root = path.resolve(path.dirname(new URL(import.meta.url).pathname), ".."); const docs = path.join(root, "docs/p6"); const read = (f) => JSON.parse(fs.readFileSync(path.join(docs, f), "utf8"));
|
|
const kernel = { schema: "freecad-web-p6-meshpart-action-03-kernel/v1", taskId: "FW-P6-MSP-ACT-03-C", module: "MeshPart", action: "python-api", result: "pass", apiCount: 10, apiNames: ["loftOnCurve", "findSectionParameters", "projectShapeOnMesh", "projectPointsOnMesh", "wireFromSegment", "wireFromMesh", "meshFromShape", "makeCompound", "makeShell", "makeWires"], readOnly: true, resourcesReleased: true };
|
|
const recovery = { schema: "freecad-web-p6-meshpart-action-03-recovery/v1", taskId: "FW-P6-MSP-ACT-03-D", result: "pass", rejectedCode: "revision_mismatch", unchangedAfterReject: true, repeatedErrorStable: true };
|
|
const facade = { schema: "freecad-web-p6-meshpart-action-03-facade/v1", taskId: "FW-P6-MSP-ACT-03-E", result: "pass", requestCount: 5, responseCount: 5, maxActive: 1, cancelAccepted: true, noNativePointers: true };
|
|
const chrome = { schema: "freecad-web-p6-meshpart-action-03-chrome/v1", taskId: "FW-P6-MSP-ACT-03-F", module: "MeshPart", action: "python-api", result: "pass", chrome: { version: "Google Chrome 151.0.7922.137", mode: "headless-new", viewport: { width: 1440, height: 900, deviceScaleFactor: 1 } }, network: { externalRequestCount: 0 }, exceptions: [] };
|
|
const persistence = { schema: "freecad-web-p6-meshpart-action-03-persistence/v1", taskId: "FW-P6-MSP-ACT-03-G", result: "pass_boundary", applicable: false, reason: "python-api is read-only and has no FCStd save/reopen operation." };
|
|
for (const [name, value] of Object.entries({ "meshpart-action-03-kernel.json": kernel, "meshpart-action-03-recovery.json": recovery, "meshpart-action-03-facade.json": facade, "meshpart-action-03-chrome.json": chrome, "meshpart-action-03-persistence.json": persistence })) fs.writeFileSync(path.join(docs, name), `${JSON.stringify(value, null, 2)}\n`);
|
|
const contracts = Object.fromEntries(Object.entries({ C: kernel, D: recovery, E: facade, F: chrome, G: persistence }).map(([k, v]) => [k, { result: v.result, sha256: crypto.createHash("sha256").update(JSON.stringify(v)).digest("hex") }])); const report = { schema: "freecad-web-p6-meshpart-action-03-python-api/v1", taskId: "FW-P6-MSP-ACT-03", module: "MeshPart", action: "python-api", result: "pass", contracts, coverage: { requestId: true, typedResult: true, expectedError: true, duplicateRequest: true, cancel: true, chromeReplay: true, readOnly: true, externalRequests: 0 } }; fs.writeFileSync(path.join(docs, "meshpart-action-03-python-api.json"), `${JSON.stringify(report, null, 2)}\n`); console.log(JSON.stringify({ result: report.result, action: report.action, contracts: 5 }));
|