3.9 KiB
UniDesk E2E Reference
UniDesk delivery is not complete until the public frontend, public provider ingress, internal core API, PostgreSQL database, local provider-gateway self-connection, and frontend Playwright flow pass one end-to-end check. The canonical automated command is bun scripts/cli.ts e2e run.
Required Preconditions
config.jsonnetwork.publicHostmust be the externally reachable host name or IP of the main server, not127.0.0.1, when validating browser access from outside the server.bunx playwright install chromiumandbunx playwright install-deps chromiummust have been run on hosts that execute browser E2E tests.- The Docker stack must be running through
bun scripts/cli.ts server start, andbun scripts/cli.ts server statusmust report healthy frontend, provider ingress, internal core, database, and provider-gateway containers.
Automated E2E Scope
bun scripts/cli.ts e2e run validates the following URLs and internal checks derived from config.json:
- Public exposure: Docker port summary must show only frontend and provider ingress host mappings; public core and public database probes must fail.
- Core API:
docker exec unidesk-backend-corecalls internalGET /api/overview, which must reportdbReady: trueand at least one online node. - Provider self-connection: internal
GET /api/nodesmust containmain-serverwithstatus: online; internalGET /api/nodes/system-statusmust contain CPU/memory/disk samples; internalGET /api/nodes/docker-statusmust contain a Docker snapshot formain-server; public provider ingress/healthmust return ok. - Provider remote control: internal
/api/dispatchmust successfully complete a realprovider.upgradetask inmode: "plan"so the upgrade path is validated without recreating the running gateway during E2E. - Database: the command writes an
unidesk_e2e_markersrow throughdocker exec unidesk-database psqland confirms provider state is stored in PostgreSQL. - Frontend: Playwright must open the public frontend URL derived from
network.publicHost, not localhost or a Docker-internal URL; it logs in with the configured account, waits for核心在线, asserts thatmain-serverandMain Server Providerare visible, clicks查看原始JSONto verify Provider data from the frontend, confirms no raw JSON is visible before that click, opens task history to verify duration and failure diagnostics, opens resource nodes资源监控to verify CPU/Memory/Disk curves and provider upgrade precheck dispatch, then opensDocker 状态and verifies the Docker Desktop-style container view including the database named volumeunidesk_pgdata_10gb.
Frontend JSON Rule
The frontend must render JSON data into React controls by default. Raw JSON is allowed only after an explicit 查看原始JSON user action, and E2E must fail if the initial page exposes raw JSON text or a raw JSON block.
Public Boundary Rule
The public frontend URL and provider ingress URL are the only public network interfaces. backend-core REST API and PostgreSQL database are Docker-internal only; E2E must prove the historical public core/database ports are not reachable.
Database Persistence Rule
The PostgreSQL data volume is the named Docker volume unidesk_pgdata_10gb. CLI server control commands must never use docker compose down -v, docker volume rm, or any equivalent data-volume removal. To validate persistence, insert a marker row into unidesk_e2e_markers, run bun scripts/cli.ts server start or a full stop/start cycle, and verify the marker row still exists.
Delivery Gate
Before claiming delivery, run these checks and keep their JSON output or screenshot path available for review:
bun scripts/cli.ts checkbun scripts/cli.ts server start, thenbun scripts/cli.ts job status latestuntilsucceededbun scripts/cli.ts server statusbun scripts/cli.ts e2e run- a database persistence marker check across at least one CLI-controlled restart