Skip to content

ci: run Playwright e2e suite on every PR - #31

Open
RVerdiF wants to merge 8 commits into
caribeedu:mainfrom
RVerdiF:feat/e2e-ci
Open

ci: run Playwright e2e suite on every PR#31
RVerdiF wants to merge 8 commits into
caribeedu:mainfrom
RVerdiF:feat/e2e-ci

Conversation

@RVerdiF

@RVerdiF RVerdiF commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

What & why

Adds an e2e job 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) and e2e.

e2e job (CI-only infra + 2 real app fixes)

  • New e2e job: 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.
  • fix(build): copy CLI shim into the vite build outputcreateShimDir reads src/shim/shim.mjs from app.getAppPath(); when running from .vite/build (dev and e2e) the file was missing, the boot threw ENOENT and no window opened. A closeBundle hook mirrors it. Packaged builds (asar contains src/) are unaffected — this fixed a real dev-mode bug the e2e exposed.
  • CI hardening: --no-sandbox --disable-gpu --disable-dev-shm-usage only when process.env.CI (root container); robust teardown (close with 5s grace then SIGKILL) so app.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)

Module Before (stmts) After
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%
ptyManager.ts 61.5% 98.2% (38 tests)

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 typecheck and npm run lint pass (0 errors; pre-existing warnings in Canvas.tsx untouched)
  • Behavior verified: check and e2e jobs green on this PR (e2e boots the packaged app under Xvfb and passes all 3 specs)
  • No AGENTS.md invariant violated — test-only changes plus two CI/build fixes (shim copy, e2e job); no runtime behavior changed
  • Docs updated if behavior or architecture changed — N/A: no user-facing behavior change

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.
@RVerdiF
RVerdiF requested a review from caribeedu August 13, 2026 23:48
@RVerdiF RVerdiF self-assigned this Aug 13, 2026
@RVerdiF RVerdiF added the tests Test coverage, CI and quality-gate changes (no user-facing behavior) label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test coverage, CI and quality-gate changes (no user-facing behavior)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant