Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(ci): a verifier that says FAIL and means it

esengine66aa0729cf00
diff --git a/desktop/scripts/headless-cooked-verify.mjs b/desktop/scripts/headless-cooked-verify.mjs
index cfecd05be..9a92e0aee 100644
--- a/desktop/scripts/headless-cooked-verify.mjs
+++ b/desktop/scripts/headless-cooked-verify.mjs
@@ -46,6 +46,7 @@ function serve(dir) {
app.whenReady().then(async () => {
let server;
+ let failed = true;
const diag = [];
try {
server = await serve(COOKED);
@@ -81,13 +82,15 @@ app.whenReady().then(async () => {
const ok = greenOk && redOk && cornerBlack;
console.log(`\n[verify:render:cooked] ${ok ? 'PASS' : 'FAIL'}`);
console.log('DRIVE_RESULT ' + JSON.stringify({ ...cap, greenOk, redOk, cornerBlack, diag: diag.slice(0, 6) }));
- process.exitCode = ok ? 0 : 1;
+ failed = !ok;
} catch (e) {
console.log('\n[verify:render:cooked] FAIL — ' + (e?.message ?? e));
console.log('DRIVE_RESULT ' + JSON.stringify({ error: String(e?.message ?? e), diag: diag.slice(0, 6) }));
- process.exitCode = 1;
+ failed = true;
} finally {
try { server?.close(); } catch { /* ignore */ }
- app.quit();
+ // app.exit, not process.exitCode + app.quit: Electron quits with status 0
+ // whatever exitCode says, so a FAIL would be reported to the caller as a pass.
+ app.exit(failed ? 1 : 0);
}
});
diff --git a/desktop/scripts/headless-smoke.mjs b/desktop/scripts/headless-smoke.mjs
index a13ca77dd..704cf6d7b 100644
--- a/desktop/scripts/headless-smoke.mjs
+++ b/desktop/scripts/headless-smoke.mjs
@@ -104,9 +104,10 @@ function finish(server) {
const ok = checks.length > 0 && checks.every((c) => c.pass);
console.log(`\n[smoke] ${ok ? 'PASS' : 'FAIL'} — model-authoritative runtime`);
for (const c of checks) console.log(` ${c.pass ? '✓' : '✗'} ${c.name}${c.detail ? ` (${c.detail})` : ''}`);
- process.exitCode = ok ? 0 : 1;
try { server?.close(); } catch { /* ignore */ }
- app.quit();
+ // app.exit, not process.exitCode + app.quit: Electron quits with status 0
+ // whatever exitCode says, so a FAIL would be reported to the caller as a pass.
+ app.exit(ok ? 0 : 1);
}
setTimeout(() => finish(), 45000);
diff --git a/desktop/scripts/headless-verify.mjs b/desktop/scripts/headless-verify.mjs
index c7213c093..0888237ea 100644
--- a/desktop/scripts/headless-verify.mjs
+++ b/desktop/scripts/headless-verify.mjs
@@ -112,13 +112,15 @@ function finish(result, server) {
deviceLossOk;
console.log(`\n[verify:render] ${ok ? 'PASS' : 'FAIL'} — ${SCENE} (${BACKEND})`);
console.log('DRIVE_RESULT ' + JSON.stringify(result));
- process.exitCode = ok ? 0 : 1;
try {
server?.close();
} catch {
/* ignore */
}
- app.quit();
+ // app.exit, not process.exitCode + app.quit: Electron leaves the process with
+ // status 0 on quit whatever exitCode says, so the FAIL above was printed and
+ // then reported as a pass to everything that ran this.
+ app.exit(ok ? 0 : 1);
}
app.whenReady().then(async () => {