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

+56 -4
View File
@@ -1,6 +1,6 @@
name: CI
# One pipeline: lint, test and audit must all pass before main deploys (#45).
# One pipeline: lint, test, audit and the UI tests must all pass before main deploys (#45).
# Actions are pinned to full commit SHAs (version in the trailing comment).
on:
@@ -69,10 +69,62 @@ jobs:
- name: Audit production and dev dependencies
run: npm audit --audit-level=high
ui:
name: UI (playwright)
runs-on: ubuntu-latest
# Official image with Chromium and its system libraries; its version must match
# @playwright/test in package.json.
container: mcr.microsoft.com/playwright:v1.64.1-noble
services:
mariadb:
image: mariadb:11.4
env:
MARIADB_RANDOM_ROOT_PASSWORD: '1'
MARIADB_DATABASE: pulse
MARIADB_USER: pulse
MARIADB_PASSWORD: ci-only # throwaway container, never reachable outside the job
env:
DB_HOST: mariadb
DB_PORT: '3306'
DB_NAME: pulse
DB_USER: pulse
DB_PASSWORD: ci-only
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: Install dependencies (lockfile only)
run: npm ci
- name: Wait for MariaDB
run: |
for i in $(seq 1 60); do
node -e 'require("net").connect(3306, "mariadb").on("connect", () => process.exit(0)).on("error", () => process.exit(1))' && exit 0
sleep 1
done
echo "::error::MariaDB service never accepted connections"; exit 1
- name: Start Pulse with three workers
run: scripts/ci/ui-stack.sh start
- name: Run Playwright (desktop and mobile)
run: npm run test:ui
- name: Server and worker logs
if: always()
run: tail -n 200 .ui-stack/*.log || true
- name: Upload report, traces and screenshots
if: failure()
uses: actions/upload-artifact@c6a3b2bd78b3985e4b2f15397fec357f0fd808de # v3.2.2-node20 (v4 is unsupported on Gitea)
with:
name: playwright-report
path: |
playwright-report/
test-results/
retention-days: 14
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [lint, test, audit]
needs: [lint, test, audit, ui]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# Never run two deploys at once; queue instead of cancelling a deploy mid-way.
concurrency:
@@ -131,7 +183,7 @@ jobs:
notify:
name: Notify
runs-on: ubuntu-latest
needs: [lint, test, audit, deploy]
needs: [lint, test, audit, ui, deploy]
# Alert on any failure on main or in the weekly audit, and on every deploy outcome.
if: >-
always() && (
@@ -145,7 +197,7 @@ jobs:
REPO: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
RESULTS: "lint=${{ needs.lint.result }} test=${{ needs.test.result }} audit=${{ needs.audit.result }} deploy=${{ needs.deploy.result }}"
RESULTS: "lint=${{ needs.lint.result }} test=${{ needs.test.result }} audit=${{ needs.audit.result }} ui=${{ needs.ui.result }} deploy=${{ needs.deploy.result }}"
DEPLOYED: ${{ needs.deploy.result == 'success' }}
run: |
if [ -z "$MATRIX_WEBHOOK_URL" ] || [ "$MATRIX_WEBHOOK_URL" = "CONFIGURE_ME" ]; then exit 0; fi