From 49ea6c54ae88bfac484a26b275036742639f50d4 Mon Sep 17 00:00:00 2001 From: Sprite Date: Mon, 23 Nov 2026 01:49:54 +0000 Subject: [PATCH] CI: run the browser tests on Debian's chromium Playwright's Chromium download from cdn.playwright.dev timed out on the runner (the only failing step; moon tests passed). Install chromium with apt, skip the Playwright download, and let the tests take CHROMIUM_PATH. The workflow now also runs tests/android-sim.cjs. Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/launcher.yml | 11 ++++++++--- README.md | 2 +- tests/android-sim.cjs | 2 +- tests/e2e.cjs | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/launcher.yml b/.gitea/workflows/launcher.yml index 87938c8..dc69564 100644 --- a/.gitea/workflows/launcher.yml +++ b/.gitea/workflows/launcher.yml @@ -37,10 +37,15 @@ jobs: run: | scripts/build-web.sh --demo mkdir -p /tmp/e2e && cd /tmp/e2e && npm init -y >/dev/null - npm i --no-audit --no-fund playwright@1.65.1 - npx playwright install --with-deps chromium + # Playwright's own Chromium download (cdn.playwright.dev) times out on this runner, + # so use Debian's chromium and point the tests at it. + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i --no-audit --no-fund playwright@1.65.1 + apt-get update -qq && apt-get install -y -qq --no-install-recommends chromium >/dev/null cd "$GITHUB_WORKSPACE" - PLAYWRIGHT=/tmp/e2e/node_modules/playwright node tests/e2e.cjs + export CHROMIUM_PATH=/usr/bin/chromium + export PLAYWRIGHT=/tmp/e2e/node_modules/playwright + node tests/e2e.cjs + node tests/android-sim.cjs apk: needs: test diff --git a/README.md b/README.md index 6eb4d5c..a3d7a1a 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Needs [MoonBit](https://www.moonbitlang.com/download) (`curl -fsSL https://cli.m moon test # the pure core: grid, gestures, updater, the app (js backend) moon test --target wasm-gc # the same tests on a second backend scripts/build-web.sh --demo # the page -> dist/web (with the demo apps.json / widgets.json) -npm install && npx playwright install chromium +npm install && npx playwright install chromium # or CHROMIUM_PATH=/usr/bin/chromium npm test # builds the page, then tests/e2e.cjs and tests/android-sim.cjs android/build.sh # the page + Java shell -> build/ultra-launcher.apk, signed ``` diff --git a/tests/android-sim.cjs b/tests/android-sim.cjs index a1c8fdf..5e5d104 100644 --- a/tests/android-sim.cjs +++ b/tests/android-sim.cjs @@ -23,7 +23,7 @@ const RELEASE = JSON.stringify({ tag_name: "build-9", assets: [ }); }).listen(0); const BASE = `http://localhost:${srv.address().port}`; - const b = await chromium.launch(); + const b = await chromium.launch({ executablePath: process.env.CHROMIUM_PATH || undefined }); const p = await b.newPage({ viewport: { width: 390, height: 780 } }); p.on("pageerror", (e) => { console.error("page error:", e.message); process.exitCode = 1; }); await p.addInitScript((release) => { diff --git a/tests/e2e.cjs b/tests/e2e.cjs index 71f1361..ee21a23 100644 --- a/tests/e2e.cjs +++ b/tests/e2e.cjs @@ -26,7 +26,7 @@ const serve = () => new Promise((resolve) => { const [srv, served] = process.env.BASE ? [null, process.env.BASE] : await serve(); const BASE = served; const shot = async (p, name) => { if (process.env.SHOTS) await p.screenshot({ path: path.join(process.env.SHOTS, name + ".png") }); }; - const b = await chromium.launch(); + const b = await chromium.launch({ executablePath: process.env.CHROMIUM_PATH || undefined }); const p = await b.newPage({ viewport: { width: 390, height: 780 } }); p.on("pageerror", (e) => { console.error("page error:", e.message); process.exitCode = 1; });