phase 2: ui testing infrastructure

Vitest + @testing-library/jest-dom matchers wired through tests/setup.ts.
Playwright with four projects: chromium-desktop, webkit-desktop,
chromium-mobile-iphone-13, chromium-mobile-pixel-5; traces and
screenshots retained on failure.

.gitea/workflows/ui-test.yaml runs Tier 1 on every push and pull
request: monorepo Go service tests (backend with -p 1 to dodge
testcontainer contention; gateway, game, every pkg/<name> module),
pnpm install --frozen-lockfile, playwright install --with-deps,
pnpm test, pnpm exec playwright test. Uploads playwright-report
and test-results on failure. Integration suite stays gated behind
make -C integration integration; deprecated client/ excluded.

.gitea/workflows/ui-release.yaml mirrors Tier 1 on v* tag push and
keeps commented placeholders for visual regression (Phase 33) and
macOS iOS smoke (Phase 32).

ui/docs/testing.md documents both tiers and the local invocations
that mirror what CI runs. ui/PLAN.md Phase 2 marked done; Phase 3
gains a bullet to extend the go test command with ./ui/core/...;
Phase 36 has the renamed release workflow path.

tools/local-ci/ ships a self-contained docker-compose for verifying
workflows against a local Gitea + arm64 act_runner before pushing
to a real instance.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-07 08:24:44 +02:00
parent cf41be9eff
commit 7450006ed3
17 changed files with 885 additions and 15 deletions
+39 -14
View File
@@ -287,9 +287,9 @@ Targeted tests:
- a single Vitest smoke test that mounts the landing component and
asserts the rendered version string is non-empty.
## Phase 2. Testing Infrastructure
## ~~Phase 2. Testing Infrastructure~~
Status: pending.
Status: done.
Goal: install and configure the test toolchain that every later phase
depends on, including Tier 1 (per-PR) and Tier 2 (release) targets.
@@ -299,17 +299,37 @@ Artifacts:
- `ui/frontend/package.json` dev-dependencies (added on top of the
Phase 1 minimum of `vitest`, `jsdom`, `@testing-library/svelte`):
`@testing-library/jest-dom`, `playwright`, `@playwright/test`
- `ui/frontend/vitest.config.ts` extended for `@testing-library/jest-dom`
matchers (the JSDOM environment itself is wired in Phase 1)
- `ui/frontend/playwright.config.ts` with three projects:
- `ui/frontend/vitest.config.ts` extended with `setupFiles:
["./tests/setup.ts"]` to wire `@testing-library/jest-dom` matchers
into Vitest (the JSDOM environment itself is wired in Phase 1)
- `ui/frontend/tests/setup.ts` registering `jest-dom` matchers
- `ui/frontend/tests/e2e/landing.spec.ts` placeholder Playwright test
asserting the version footer renders
- `ui/frontend/playwright.config.ts` with four projects:
`chromium-desktop`, `webkit-desktop`, `chromium-mobile-iphone-13`,
`chromium-mobile-pixel-5`; tracing and screenshots enabled on failure
- `ui/.gitea/workflows/test.yaml` running Tier 1 on every push and PR
on a Linux runner: `go test ./...`, `pnpm test`, `pnpm exec
playwright install --with-deps`, `pnpm exec playwright test`
- `ui/.gitea/workflows/release.yaml` running Tier 2 on tag push:
visual regression baseline check, optional macOS runner block for
iOS smoke (Phase 32+ only)
`chromium-mobile-pixel-5`; tracing and screenshots enabled on
failure; `webServer: pnpm run dev` on port 5173
- `.gitea/workflows/ui-test.yaml` running Tier 1 on every push and PR
on a Linux runner: monorepo Go service tests for `backend/`,
`gateway/`, `game/`, and every `pkg/<name>/` module (each pkg
module is enumerated explicitly because they sit as independent
go.work modules under a shared `pkg/` directory, and `./pkg/...`
does not recurse across module boundaries). All Go tests run with
`-count=1` so the cache never masks a failing run; backend tests
additionally run with `-p 1` because most backend packages spawn
their own Postgres testcontainer and parallel bootstraps starve
each other on the runner. The integration suite stays gated behind
`make -C integration integration` and lives outside Tier 1; the
deprecated `client/` Fyne client (see §74) is also excluded — its
tests, code, and documentation are frozen and CI must not run
them. Then `pnpm install --frozen-lockfile` from `ui/`,
`pnpm exec playwright install --with-deps`, `pnpm test`,
`pnpm exec playwright test`; Playwright reports and traces
uploaded as artefacts on failure
- `.gitea/workflows/ui-release.yaml` running Tier 2 on tag push (`v*`):
same Tier 1 step set today; visual-regression and macOS-runner
iOS-smoke jobs live as commented sections marked with the phase
number that re-enables them (Phase 33 and Phase 32 respectively)
- `ui/docs/testing.md` topic doc naming the two tiers, the tools
per tier, and the rule that visual regression baselines live in
`ui/frontend/tests/__snapshots__/` until shifted to Argos
@@ -322,7 +342,9 @@ Acceptance criteria:
- a placeholder Playwright test passes in `chromium-desktop` and
`webkit-desktop` projects locally;
- the Gitea Actions Tier 1 workflow runs end-to-end against a clean
clone of the repo on a Linux runner.
clone of the repo on a Linux runner. Until the Gitea runner is
provisioned, the workflow is exercised locally with
`act -W .gitea/workflows/ui-test.yaml`.
Targeted tests:
@@ -342,6 +364,9 @@ implementation. No network, no UI.
Artifacts:
- `ui/core/go.mod` module declared in the project Go workspace
- `.gitea/workflows/ui-test.yaml` and `.gitea/workflows/ui-release.yaml`
extended to add `./ui/core/...` to the Tier 1 / Tier 2 `go test`
command list introduced in Phase 2
- `ui/core/canon/` canonical bytes for `galaxy-request-v1`,
`galaxy-response-v1`, and `galaxy-event-v1`, matching
`docs/ARCHITECTURE.md` §15 byte-for-byte
@@ -1702,7 +1727,7 @@ Artifacts:
follow-up issue to switch to self-hosted Argos
- Appium harness for iOS Simulator and Android Emulator covering the
login flow, push-event flow, and at least one full turn loop;
`.gitea/workflows/release.yaml` extended with macOS-runner Appium
`.gitea/workflows/ui-release.yaml` extended with macOS-runner Appium
job (mandatory pre-release gate)
Dependencies: Phases 1 through 35.