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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
ci: the engine-coupled tests run, instead of reporting success having skipped
esengine7ed0b5c3f17e
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 4d9458abc..c0a2f5767 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -149,6 +149,46 @@ jobs:- name: Run Desktop testsrun: pnpm --filter @estella/editor exec vitest run+ # The engine-coupled half of both suites. 25 test files load the built wasm and+ # `skipIf` themselves out when it is absent — which, in a job that never built+ # or downloaded one, meant they had never run in CI at all. They reported as+ # skipped, the run reported success, and a scene-order regression could only be+ # noticed by whoever happened to have a stale local build.+ #+ # Separate from `test` on purpose: type-checks and the pure-TS suites are the+ # fast feedback on a push, and making them wait for Emscripten would trade a+ # real gap for a slower one. ESTELLA_REQUIRE_WASM makes the skip an error here,+ # so if the artifact ever stops arriving this fails instead of going quiet again.+ test-engine:+ name: Tests (engine-coupled)+ runs-on: ubuntu-latest+ needs: build-emscripten+ timeout-minutes: 25++ steps:+ - uses: actions/checkout@v7++ - uses: ./.github/actions/setup++ - name: Download web wasm artifact+ uses: actions/download-artifact@v8+ with:+ name: wasm-web+ path: build/wasm/web/++ - name: Build SDK+ run: pnpm --filter ./sdk build++ - name: Run SDK tests (engine-coupled)+ env:+ ESTELLA_REQUIRE_WASM: '1'+ run: pnpm --filter ./sdk exec vitest run++ - name: Run Desktop tests (engine-coupled)+ env:+ ESTELLA_REQUIRE_WASM: '1'+ run: pnpm --filter @estella/editor exec vitest run+# Headless pixel verification: real scenes rendered by the editor's electron# host under xvfb (SwiftShader WebGL), asserted pixel-by-pixel.verify-render:diff --git a/desktop/tests/helpers/loadWasm.ts b/desktop/tests/helpers/loadWasm.tsindex a942d7d09..4b178bfca 100644--- a/desktop/tests/helpers/loadWasm.ts+++ b/desktop/tests/helpers/loadWasm.ts@@ -25,6 +25,19 @@ export const WASM_DIR = resolveWasmDir();export const WASM_FILE = resolve(WASM_DIR, 'esengine.wasm');export const HAS_WASM = existsSync(WASM_FILE);+// A skip is the right answer on a machine that has not built the engine, and the+// WRONG one in CI: a job meant to cover these tests would report success having+// run none of them, which is how 25 files stayed green-by-absence while the code+// under them changed. The job that provides the wasm sets ESTELLA_REQUIRE_WASM,+// and here that turns a silent skip into a loud failure.+if (!HAS_WASM && process.env.ESTELLA_REQUIRE_WASM) {+ throw new Error(+ `ESTELLA_REQUIRE_WASM is set but no engine build was found at ${WASM_FILE}. ` ++ 'The wasm artifact did not reach this job — these tests would have been skipped.',+ );+}++let cached: ESEngineModule | null = null;export async function loadWasmModule(): Promise<ESEngineModule> {if (cached) return cached;diff --git a/sdk/tests/helpers/loadWasm.ts b/sdk/tests/helpers/loadWasm.tsindex de03aa303..be6d65a76 100644--- a/sdk/tests/helpers/loadWasm.ts+++ b/sdk/tests/helpers/loadWasm.ts@@ -41,6 +41,19 @@ export const WASM_FILE = resolve(WASM_DIR, 'esengine.wasm');/** True when a built WASM SDK is available to run boundary integration tests. */export const HAS_WASM = existsSync(WASM_FILE);+// A skip is the right answer on a machine that has not built the engine, and the+// WRONG one in CI: a job meant to cover these tests would report success having+// run none of them, which is how 25 files stayed green-by-absence while the code+// under them changed. The job that provides the wasm sets ESTELLA_REQUIRE_WASM,+// and here that turns a silent skip into a loud failure.+if (!HAS_WASM && process.env.ESTELLA_REQUIRE_WASM) {+ throw new Error(+ `ESTELLA_REQUIRE_WASM is set but no engine build was found at ${WASM_FILE}. ` ++ 'The wasm artifact did not reach this job — these tests would have been skipped.',+ );+}++let cachedModule: ESEngineModule | null = null;export async function loadWasmModule(): Promise<ESEngineModule> {