test(vision): fix stub-mode tests; close the testing-gap wiki note

The two failing apps/vision smoke tests assumed stub mode but the local .env sets
VISION_RECOGNIZER=fast_alpr (real-model work, 2026-06-19), so the app built the real
recognizer: /health reported "fast_alpr" not "stub", and /analyze on garbage bytes
422'd (real decode reject) instead of returning the empty stub contract.

Fix is test isolation: a conftest autouse fixture pins VISION_RECOGNIZER=stub for the
session (an OS env var overrides the .env in pydantic-settings), restoring it after.
vision 7/7.

Updates wiki/concepts/booth-console.md (the "no automated tests" Open note now reflects
the coverage that landed) and appends wiki/log.md.

Full workspace: shared 87, server 75, devices 18, web 17, vision 7 = 204 tests across
8 turbo test tasks, 0 failures; build/lint 14/14.

Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
This commit is contained in:
2026-06-21 16:25:21 +02:00
parent cae900afd2
commit 2fb947e908
3 changed files with 58 additions and 3 deletions
+10 -3
View File
@@ -148,8 +148,15 @@ screen, so the operator always sees the barrier relay's reachability and the pri
and served 404s in this environment).
## Open
- **No automated frontend tests** — the booth/live-feed/modal logic is verified manually
(Playwright + curl + DB inspection), not by a suite. The standing test-harness gap (see
[[reconciliation]]-adjacent notes) now spans front and back.
- **Automated test coverage landed 2026-06-21** (was: "no automated tests anywhere"). `pnpm test`
now runs across all six packages (was shared + vision only): a fresh-SQLite harness
(`@parking/db/testing` → `createTestDb()`, real migrations, never the live DB) backs server-core
suites for the anti-fraud heart — event-log hash-chain + tamper detection, signer, occupancy +
reserved-spots, pay-station, the exit GATE, and the shift takings-split; `@parking/devices` pins the
ESC/POS byte stream (CP852 fallbacks + the Code128 width contract) and printer routing; an HTTP
integration suite boots the real Fastify app (`app.inject`) to exercise the auth/RBAC/CSRF guards;
and `@parking/web` covers the booth formatters + the focus-independent `useScanner` hook. **Still
manual (Playwright):** the live-feed/modal *rendering* and full booth UI flows — the front-end unit
layer covers pure logic + the scanner hook, not component rendering (no jsdom component suite yet).
- The pre-existing admin screens (Setup/Tariff/Permits/Site/Shift) still carry their **old inline
styles** — reachable and functional, not yet on the terminal component system.