Improve execution preflight diagnostics
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-08-24 17:04:16 -04:00
parent 5c8cfd1a8c
commit 603a5a92f2
6 changed files with 240 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
import assert from "node:assert/strict";
import test from "node:test";
import { collectGeneratedGapPreflight } from "../../../tools/web/generated-gap-preflight.mjs";
import { readIndexedTask, root, verifyTaskIndex } from "../../../tools/web/task-context-lib.mjs";
test("generated gap preflight accepts a runnable task with existing inputs", () => {
verifyTaskIndex();
const entry = readIndexedTask("M16-GAP-00281");
assert.deepEqual(collectGeneratedGapPreflight({ root, task: "M16-GAP-00281", entry }), []);
});
test("generated gap preflight reports state and input failures before WASM startup", () => {
const issues = collectGeneratedGapPreflight({
root,
task: "M16-GAP-00282",
entry: {
id: "M16-GAP-00282",
state: "pending",
fixture: { path: "tests/files/web/generated/does-not-exist.blend" },
desktopCommand: "blender --python tools/web/generated/does-not-exist.py -- fixture.blend",
},
});
assert.deepEqual(issues.map(({ code }) => code), ["TASK_NOT_RUNNABLE", "INPUT_MISSING", "INPUT_MISSING"]);
});
test("generated gap preflight rejects a missing task argument", () => {
assert.deepEqual(collectGeneratedGapPreflight({ root, task: undefined, entry: null }).map(({ code }) => code), ["TASK_ARGUMENT_INVALID"]);
});