Files
workinf_Blender_Wasm/tools/web/check-ci-failure-report.mjs
mes123456 7c16b279ae
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
Advance M7 workflows and release operations
2026-08-15 17:43:53 -04:00

27 lines
1.1 KiB
JavaScript

import assert from "node:assert/strict";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { spawnSync } from "node:child_process";
const temporary = fs.mkdtempSync(path.join(os.tmpdir(), "blender-ci-failure-"));
const reportPath = path.join(temporary, "quick-failure.json");
try {
const result = spawnSync(process.execPath, [new URL("./run-ci-lane.mjs", import.meta.url).pathname, "quick", "--self-test-failure"], {
encoding: "utf8",
env: { ...process.env, CI_REPORT_PATH: reportPath },
});
assert.notEqual(result.status, 0, "injected lane failure returned success");
const report = JSON.parse(fs.readFileSync(reportPath, "utf8"));
assert.equal(report.status, "FAILED");
assert.equal(report.records.length, 1);
assert.equal(report.records[0].id, "injected-failure");
assert.equal(report.records[0].exitCode, 17);
assert.ok(fs.existsSync(`${reportPath}.sha256`));
process.stdout.write("ci-failure-report-ok status=FAILED exitCode=17 staleReady=false\n");
}
finally {
fs.rmSync(temporary, { recursive: true, force: true });
}