10 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. The CLI response is intentionally bounded: it prints check names/statuses, screenshot path, counts, and resultPath; the full per-check diagnostics are written to resultPath under .state/e2e/ so failures remain inspectable without flooding stdout.
- Public exposure: Docker port summary must show only frontend and provider ingress host mappings; public core、public database and known private microservice ports such as FindJob
3254, MET Nonlinear3288and Todo Note4211probes must fail. - Core API:
docker exec unidesk-backend-corecalls internalGET /api/overview, which must reportdbReady: true,pgdata.volumeName=unidesk_pgdata_10gb, a positive PostgreSQL database byte count, and at least one online node. - Provider self-connection: internal
GET /api/nodesmust containmain-serverwithstatus: online,labels.providerGatewayVersionequal tosrc/components/provider-gateway/package.jsonandlabels.providerGatewayUpgradePolicy: "always-enabled"; 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. - Microservices: internal
/api/microservicesmust includetodo-noteonmain-serverplusfindjob,pipelineandmet-nonlinearonD601withpublic=false;/api/microservices/todo-note/healthmust reportstorage=postgres,/api/microservices/todo-note/proxy/api/instancesmust expose the migrated Todo Note lists, and a temporary Todo Note list create/add/toggle/undo/delete cycle must succeed through the real provider-gateway proxy;/api/microservices/findjob/healthand/api/microservices/findjob/proxy/api/summarymust succeed through the real provider-gateway proxy;/api/microservices/findjob/proxy/api/jobs?__unideskArrayLimit=jobs:5must return a bounded preview with_unidesk.arrayLimitsmetadata;/api/microservices/pipeline/healthand/api/microservices/pipeline/proxy/api/snapshot?__unideskArrayLimit=registry.components:8,runs:3must return Pipeline health, registry and run previews;/api/microservices/met-nonlinear/health,/api/microservices/met-nonlinear/proxy/api/queue,/api/microservices/met-nonlinear/proxy/api/projects?root=projects&limit=20and/api/microservices/met-nonlinear/proxy/api/imagesmust return the D601 TS backend health, queue/GPU policy, project preview and readymet-nonlinear-ml:tf26image status. - Database: the command writes an
unidesk_e2e_markersrow throughdocker exec unidesk-database psql, confirms provider state is stored in PostgreSQL, and checks Todo Note rows exist intodo_note_instancesusing the same named volume. - 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, verifies desktop sidebar collapse andPGDATAoverview metric, 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, opensDocker 状态, switches tomain-server, and verifies the Docker Desktop-style container view including the database named volumeunidesk_pgdata_10gb, opens网关版本and verifies the provider-gateway version, SSH 透传可用性、远程更新可用性 plus structured automatic update records forprovider.upgrade, then opens微服务 / 服务目录、微服务 / Todo Note、微服务 / FindJob、微服务 / Pipelineand微服务 / MET Nonlinearto verify 主 server Todo Note、D601、仓库引用、私有后端映射、Todo Note 迁移清单和树形任务、FindJob 指标和岗位预览、Pipeline 组件矩阵、React Flow 控制图和最近运行、MET Nonlinear 项目库/Fork/待启动队列/当前队列/已完成/失败诊断/GPU/镜像都通过 React 控件展示。 - Microservice frontend assertions must wait for real backend data, not only the page skeleton. For Todo Note this means the page must show the migrated lists
CONSTAR、大论文、找工作、小论文、事务, support creating a temporary list and task through the frontend, and delete that temporary list afterwards. The temporary list must be selected again by its unique generated name before deletion so E2E never deletes a migrated source list by accident. For FindJob this means the page must show a numeric岗位总量,HEALTH OK, and a non-emptyPREVIEWcount such as40/1463 PREVIEW; for Pipeline this means the page must showPipeline v2 工作台,Health OK, a numeric component count, a non-empty React Flow control graph,控制图, and最近运行; for MET Nonlinear this means the page must showMET Nonlinear 训练编排,Health OK,Fork Project,加入待启动队列,启动队列,当前队列, 最大并发设置、task queue and GPU/image panels, and must not show the removed hard-coded创建10个10轮任务frontend entry; loading placeholders like--or empty states are not sufficient for E2E success.
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.
Automatic update records in the frontend are covered by the same rule: provider.upgrade task history must be rendered as rows/cards with status, mode, task id, source, duration, policy, outcome summary, and updated time. The page must not expose upgrade plan/result JSON as a log block unless the operator clicks 查看原始JSON.
Provider operation availability is also covered by the structured rendering rule. host.ssh availability must be displayed as badges or equivalent controls derived from capabilities and hostSsh* labels, and remote update availability must be displayed from provider.upgrade capability plus the always-enabled policy; these fields must not require opening raw Provider JSON.
Microservice pages are covered by the same rule. Todo Note must show lists, task tree, filters, reminder input, movement controls, undo/redo and metrics as controls; FindJob must show metrics, jobs and drafts as cards/tables; Pipeline must show component classes, React Flow graph nodes/edges, run cards and log summaries as controls; MET Nonlinear must show queue rows, GPU/image cards, project config preview, progress bars, ETA and history diagnostics as controls; the full microservice config, summary, snapshot, jobs preview, drafts and run JSON can only appear after an explicit 查看原始JSON click.
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 runand inspectfailedChecksor the emittedresultPathif any check fails- a database persistence marker check across at least one CLI-controlled restart
Provider Upgrade Gate
When delivery explicitly includes upgrading or rebuilding a compute-node provider-gateway such as D601 or D518, the automated E2E plan check is not sufficient. The operator must first bootstrap any legacy provider only from a node-local terminal, node-owned web terminal, systemd, scheduled task, or detached shell if it cannot yet schedule upgrades; SSH passthrough carried by the same provider-gateway must not be used for synchronous self-rebuilds. Then run provider.upgrade with mode: "schedule" against that Provider ID, confirm the task succeeds, confirm the sleep-and-validate candidate gateway reconnects in the public frontend, confirm the final container restart policy is always, and finally verify any required host.ssh capability with bun scripts/cli.ts ssh <PROVIDER_ID> hostname. This schedule check is a node-upgrade gate, not a replacement for the standard public frontend Playwright E2E gate.
External compute nodes should run that schedule check through the remote main-server passthrough form: bun scripts/cli.ts --main-server-ip 74.48.78.17 debug dispatch <PROVIDER_ID> provider.upgrade --mode schedule --wait-ms 15000. The default remote transport logs in to the public frontend and does not require a main server SSH key; this proves the node can validate itself without direct access to backend-core REST or PostgreSQL.