Give the desktop smoke test the Electron runtime CI never installed (#426)

This commit is contained in:
Coracle Bot 2026-09-07 19:42:39 +00:00 committed by hodlbod
parent cec08e3353
commit 6da908edd0
4 changed files with 10 additions and 2 deletions

View file

@ -94,11 +94,14 @@ jobs:
with: with:
node-version-file: .nvmrc node-version-file: .nvmrc
# playwright's chromium set covers everything but GTK, which chromium
# only needs headed and electron always links against.
- name: Install dependencies - name: Install dependencies
run: | run: |
corepack enable && pnpm i --frozen-lockfile corepack enable && pnpm i --frozen-lockfile
npm ci --prefix electron npm ci --prefix electron
pnpm exec playwright install-deps chromium pnpm exec playwright install-deps chromium
apt-get install -y libgtk-3-0t64
- name: Build desktop - name: Build desktop
run: pnpm run build:desktop run: pnpm run build:desktop

View file

@ -72,7 +72,10 @@ or iOS. `dev:desktop` opens those built assets; rerun `build:desktop` after fron
changes. Live reload is deferred to the desktop configuration work. changes. Live reload is deferred to the desktop configuration work.
Run `pnpm run test:desktop` after building to check the Linux desktop window. On a Run `pnpm run test:desktop` after building to check the Linux desktop window. On a
headless Linux runner, use `xvfb-run -a pnpm run test:desktop`. The separate smoke headless Linux runner, use `xvfb-run -a pnpm run test:desktop`; Electron links
against GTK, which Playwright's chromium dependencies do not cover, so such a box
also needs `libgtk-3-0t64`. The test drops Chromium's sandbox when it runs as
root, because Chromium refuses to start that way. The separate smoke
suite does not start a web dev server or test installers. Windows and macOS desktop suite does not start a web dev server or test installers. Windows and macOS desktop
behavior is not verified by the Linux test. CI builds and runs this suite under behavior is not verified by the Linux test. CI builds and runs this suite under
Xvfb in a separate desktop job. Xvfb in a separate desktop job.

View file

@ -13,7 +13,8 @@ test("the desktop baseline renders, navigates, and keeps external pages outside"
) )
const app = await _electron.launch({ const app = await _electron.launch({
executablePath, executablePath,
chromiumSandbox: true, // Chromium refuses to start as root with its sandbox on, which is what a CI container is.
chromiumSandbox: process.getuid?.() !== 0,
args: [resolve("electron")], args: [resolve("electron")],
env: {...process.env, XDG_CONFIG_HOME: profile}, env: {...process.env, XDG_CONFIG_HOME: profile},
}) })

View file

@ -6,6 +6,7 @@
"main": "build/main.js", "main": "build/main.js",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"postinstall": "install-electron",
"start": "electron ." "start": "electron ."
}, },
"devDependencies": { "devDependencies": {