CI: Playwright UI tests against a real server, workers and MariaDB
CI / Test (jest) (push) Failing after 57s
CI / Lint (eslint) (push) Successful in 59s
CI / Security (npm audit) (push) Successful in 10s
CI / Lint (eslint) (pull_request) Successful in 28s
CI / Test (jest) (pull_request) Successful in 17s
CI / Security (npm audit) (pull_request) Successful in 12s
CI / UI (playwright) (push) Failing after 2m25s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Failing after 1m21s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped

New required-to-be job `UI (playwright)` (#45 phase 5): the official
Playwright image with a MariaDB service container. scripts/ci/ui-stack.sh
starts the real server and three workers (WORKER_AUTH_ENFORCE=1), then
tests/ui/ runs 30 tests on desktop and a phone viewport:

- every page loads with no page errors, console errors or failed requests
  (enforced by a shared fixture for every test)
- quick commands run on a worker and their output and status show in
  Executions; multi-worker mode; failing commands show as failed
- workflows are created and run from the UI and complete on all workers
- Executions updates live over the authenticated browser WebSocket
- no SSO identity: 401 page and API; wrong group: 403
- every page fits a phone screen

External requests are blocked in tests so SSO headers never leave the
machine. Deploy now also waits for the UI job. The API and execution rate
limits can be raised with PULSE_API_RATE_MAX / PULSE_EXEC_RATE_MAX for
test stacks; production defaults are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-22 13:37:23 -05:00
1 parent f97dcc7b2a
commit 5bca0cd87b
15 files changed
+530 -16

No files matched your search

+25 -4
View File
@@ -589,12 +589,33 @@ Everything runs from `.gitea/workflows/ci.yml`:
| `Lint (eslint)` | `npm run lint`, plus a check that fails on em or en dashes in Pulse-owned files | Every push and PR |
| `Test (jest)` | `npm test`: unit tests for `lib/` and the deploy-script sandbox tests | Every push and PR |
| `Security (npm audit)` | `npm audit --audit-level=high` | Every push and PR, and weekly (Monday 06:00) |
| `Deploy` | Calls the `pulse-deploy` webhook on CT 122, waits until `/healthz` reports the tested commit, then tags it `deploy-*` | Push to `main`, only after all three checks pass |
| `UI (playwright)` | Starts the real server and three workers against a MariaDB service container, then runs the Playwright tests in `tests/ui/` (desktop and phone) | Every push and PR |
| `Deploy` | Calls the `pulse-deploy` webhook on CT 122, waits until `/healthz` reports the tested commit, then tags it `deploy-*` | Push to `main`, only after all four checks pass |
| `Notify` | Matrix alert on any failure on `main` or in the weekly audit, and on every deploy | As needed |
Branch protection on `main` requires `CI / Lint (eslint) (push)`, `CI / Test (jest) (push)` and
`CI / Security (npm audit) (push)`. Actions are pinned to commit SHAs and builds use `npm ci`.
The plan for the rest of the pipeline is tracked in #45.
Branch protection on `main` requires `CI / Lint (eslint) (push)`, `CI / Test (jest) (push)`,
`CI / Security (npm audit) (push)` and `CI / UI (playwright) (push)`. Actions are pinned to commit
SHAs and builds use `npm ci`. The plan for the rest of the pipeline is tracked in #45.
### UI tests
The Playwright tests drive the real UI end to end: every page loads with no page errors, console
errors or failed requests; commands typed into Quick Command run on a worker and their output appears
in Executions; workflows are created and run from the UI; live updates arrive over the WebSocket;
pages without an SSO identity are refused; and every page fits a phone screen. Any UI fix should come
with a test here.
Run them locally against a throwaway database (see "Local development against a real database" for
one way to start MariaDB):
```bash
npx playwright install chromium # once
DB_HOST=127.0.0.1 DB_PORT=3399 DB_USER=pulse DB_PASSWORD=... DB_NAME=pulse scripts/ci/ui-stack.sh start
npm run test:ui # add --ui or --headed to watch
scripts/ci/ui-stack.sh stop
```
On a CI failure, the `playwright-report` artifact has the HTML report, traces and screenshots.
### Deploys