ci: run Playwright e2e suite on every PR - #31
Open
RVerdiF wants to merge 8 commits into
Open
Conversation
Boots the packaged Electron app under Xvfb (ubuntu runner) and runs e2e/app.spec.ts, e2e/canvas.spec.ts and e2e/portal.spec.ts. The specs launch .vite/build/main.js, so the job builds with electron-forge package first; playwright install-deps provides the system libs (no browser download — Electron ships via npm).
GitHub Actions runners run as root in a container, where Chromium's SUID sandbox helper is unavailable and the app never opens a window. Pass --no-sandbox only when process.env.CI is set; local runs are unchanged.
Coverage (suite 553 tests / 42 files, all green): - icons.tsx 37% -> 100% (39 tests) - Panel.tsx 45% -> 93%, Composer.tsx 63% -> 99%, TerminalPalette.tsx 70% -> 100% - presetStore.ts 64% -> 100%, skillInstall.ts 55% -> 100% - fsService.ts 80% -> 100%, gitService.ts 65% -> 99% (lines/funcs 100%) e2e CI: shared launchApp() helper adds --no-sandbox --disable-gpu --disable-dev-shm-usage on CI runners (root container); ELECTRON_ENABLE_LOGGING surfaces app stderr for diagnosable failures. Local launches unchanged.
The runner log only showed a silent firstWindow timeout; the Electron child's own output was swallowed. Attach listeners on launch so the next run reveals the actual boot failure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds an
e2ejob to CI running the existing Playwright suite on every PR, plus a third wave of unit tests taking the suite to 589 tests. All checks green:check(typecheck + lint + coverage gate) ande2e.e2e job (CI-only infra + 2 real app fixes)
e2ejob:npm run package(builds.vite/build/main.js),playwright install-deps,xvfb-run npm run test:e2e. The 3 specs (app boot, terminal lifecycle, portal via CLI) now run on every PR instead of only locally.createShimDirreadssrc/shim/shim.mjsfromapp.getAppPath(); when running from.vite/build(dev and e2e) the file was missing, the boot threw ENOENT and no window opened. AcloseBundlehook mirrors it. Packaged builds (asar containssrc/) are unaffected — this fixed a real dev-mode bug the e2e exposed.--no-sandbox --disable-gpu --disable-dev-shm-usageonly whenprocess.env.CI(root container); robust teardown (close with 5s grace then SIGKILL) soapp.close()never eats the test timeout when the app holds live PTYs.test(routineService): retry tmpdir cleanup after PTY kill — fixes a pre-existing flaky test (ENOTEMPTY race).Wave 6 — coverage (unit tests only, no production changes)
Suite: 589 tests / 42 files (was 388). Coverage ratcheted to 48/46/45/48 (stmts/branches/funcs/lines) against a measured baseline of 51.2/49.6/48.3/51.7.
Checklist
npm run typecheckandnpm run lintpass (0 errors; pre-existing warnings inCanvas.tsxuntouched)checkande2ejobs green on this PR (e2e boots the packaged app under Xvfb and passes all 3 specs)