Files
hermes-agent/.github/workflows/e2e-desktop-core.yml
emozilla f0fe081b95 test(webapp): drive the gateway-served Webapp end to end
The e2e spec starts the gateway through hermes webapp, runs a turn from a
real browser, keeps the tab signed in across a gateway restart, and checks
that sign-out cuts it off. The smoke script targets the Webapp's port.

Co-authored-by: Bear Huddleston <bear@bearhuddleston.dev>
2026-10-25 03:22:17 -07:00

115 lines
4.2 KiB
YAML

name: E2E Desktop core
# The core Desktop suite (apps/desktop/e2e/core): a small, deterministic lane
# that drives a real Electron build against a real `hermes serve` and a
# scripted loopback model. It guards the failures users must never see:
# duplicated / reordered / lost transcript text, a backend that never becomes
# ready or leaves orphans, and broken clarify/approval round trips.
#
# Unlike the legacy visual lane (e2e-desktop.yml, disabled for flakiness) this
# one runs with retries: 0 and one worker; every wait is event-driven, and the
# suite was held to 10/10 consecutive green full runs on a loaded host before
# it was wired in.
on:
workflow_call:
inputs:
commit:
description: Commit to test and build. Empty keeps the triggering commit.
type: string
default: ''
permissions:
contents: read
concurrency:
group: e2e-desktop-core-${{ inputs.commit != '' && github.run_id || github.ref }}
# A stable run is on the default branch. It must not queue behind or cancel a push.
cancel-in-progress: ${{ inputs.commit == '' }}
jobs:
core:
name: Desktop core E2E (Linux)
runs-on: blacksmith-32vcpu-ubuntu-2404
timeout-minutes: 30
steps:
- uses: useblacksmith/checkout@25227e61ff9dafe400e22fa487b673eac4e4409a # v1
with:
ref: ${{ inputs.commit }}
- name: Install system dependencies for Electron
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq \
xvfb \
libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 \
xdg-utils libatspi2.0-0 libdrm2 libgbm1 libasound2t64
- name: Prepare locked Desktop build and test toolchain
id: pm
uses: ./.github/actions/setup-pm
with:
toolchain: all
extras: '[]'
test-environment: 'true'
# Native addons still need lifecycle scripts. Electron 42 requires
# explicit binary preparation before the native fixtures launch.
- uses: ./.github/actions/retry
with:
command: npm ci
- name: Prepare locked Electron runtime
run: node scripts/build/electron-runtime.mjs --source .
- name: Build the desktop app
working-directory: apps/desktop
# The generator uses the runtime's Pillow + resvg-py, not a build-only venv.
run: npm run build
# webapp-gateway-attach.spec.ts drives the Webapp from a real browser: it needs the
# Webapp renderer and a Chromium Playwright can launch.
- name: Build the Webapp renderer
working-directory: apps/desktop
run: npm run build:webapp
- uses: ./.github/actions/retry
with:
working-directory: apps/desktop
command: npx playwright install --with-deps chromium
# Package the Linux app the way users get it (electron-builder --dir; no
# installer formats, no publish). The packaging preparer acquires its
# pinned archive separately. packaged-smoke.spec.ts asserts the asarUnpack contract
# on this output (#121097) and boots the packaged binary to a first chat.
- name: Package the desktop app (electron-builder --dir)
working-directory: apps/desktop
run: npm run builder -- --dir --publish never --linux
- name: Run the core suite under xvfb
working-directory: apps/desktop
run: |
xvfb-run -a --server-args="-screen 0 1280x1024x24" \
npx playwright test -c e2e/core/playwright.config.ts
env:
CI: 'true'
HERMES_E2E_PYTHON: ${{ steps.pm.outputs.python-path }}
# The pack step above ran: a missing release/linux-unpacked is a failure, not a skip.
HERMES_E2E_REQUIRE_PACKAGED: '1'
OPENROUTER_API_KEY: ''
OPENAI_API_KEY: ''
NOUS_API_KEY: ''
ANTHROPIC_API_KEY: ''
- name: Upload failure artifacts
if: failure() || cancelled()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: desktop-core-e2e-${{ github.sha }}
path: |
apps/desktop/test-results/core
apps/desktop/playwright-report/core
retention-days: 14
overwrite: true
if-no-files-found: ignore