Skip to content

Commit f4c04af

Browse files
committed
improvement(desktop): run the live desktop E2E in its own job on a larger runner
1 parent 4710994 commit f4c04af

1 file changed

Lines changed: 63 additions & 9 deletions

File tree

‎.github/workflows/test-build.yml‎

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ jobs:
123123
http-e2e:
124124
name: End-to-end over real HTTP
125125
runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-8vcpu-ubuntu-2404' || 'ubuntu-latest' }}
126-
# Five suites, each starting its own dev app, run in sequence.
127-
timeout-minutes: 45
126+
# Four suites, each starting its own dev app, run in sequence.
127+
timeout-minutes: 30
128128
services:
129129
postgres:
130130
image: pgvector/pgvector:pg17
@@ -357,9 +357,64 @@ jobs:
357357
DESKTOP_INBOX_E2E_REPORT_PATH="$report_dir/desktop-inbox-http-report.json" \
358358
bun run test:desktop-inbox:e2e
359359
360-
# Desktop tools in the real Electron app against a local app with Redis and its realtime
361-
# server: chat switches, Stop, sign-out, approval and the flag-off foreground round trip.
362-
# The spec runs the recording proxy (the app's public origin) and the stand-in worker.
360+
- name: Upload end-to-end reports and server logs
361+
if: failure()
362+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
363+
with:
364+
name: http-e2e-reports
365+
path: ${{ runner.temp }}/e2e/
366+
if-no-files-found: ignore
367+
retention-days: 7
368+
369+
# Desktop tools in the real Electron app against a local app, on its own runner: the
370+
# Electron app, the dev app and its realtime server together outgrow the http-e2e runner.
371+
desktop-live-e2e:
372+
name: Desktop tools against a local app
373+
runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-16vcpu-ubuntu-2404' || 'ubuntu-latest' }}
374+
timeout-minutes: 30
375+
services:
376+
postgres:
377+
image: pgvector/pgvector:pg17
378+
env:
379+
POSTGRES_USER: postgres
380+
POSTGRES_PASSWORD: postgres
381+
POSTGRES_DB: sim_test
382+
ports:
383+
- 5432:5432
384+
options: >-
385+
--health-cmd "pg_isready -U postgres -d sim_test"
386+
--health-interval 5s
387+
--health-timeout 5s
388+
--health-retries 10
389+
redis:
390+
image: redis:7-alpine
391+
ports:
392+
- 6379:6379
393+
options: >-
394+
--health-cmd "redis-cli ping"
395+
--health-interval 5s
396+
--health-timeout 5s
397+
--health-retries 10
398+
env:
399+
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/sim_test
400+
BETTER_AUTH_SECRET: desktop-live-e2e-ci-secret-at-least-32-characters
401+
ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000'
402+
403+
steps:
404+
- name: Checkout code
405+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
406+
407+
- name: Setup workspace
408+
uses: ./.github/actions/setup-workspace
409+
with:
410+
provider: ${{ vars.CI_PROVIDER }}
411+
412+
- name: Provision the database through migrations
413+
working-directory: packages/db
414+
run: bun run db:migrate
415+
416+
# Chat switches, Stop, sign-out, approval and the flag-off foreground round trip. The spec
417+
# runs the recording proxy (the app's public origin) and the stand-in worker.
363418
- name: Verify desktop tools in the Electron app against a local app
364419
env:
365420
NEXT_PUBLIC_APP_URL: http://127.0.0.1:3020
@@ -404,7 +459,6 @@ jobs:
404459
[ $((SECONDS - started)) -lt "$READY_TIMEOUT_SECONDS" ] || { echo '::error::Local app did not become ready'; exit 1; }
405460
sleep 2
406461
done
407-
(while sleep 15; do echo "memory: $(free -m | awk '/Mem:/ {print $7}') MB available"; done) &
408462
cd apps/desktop
409463
SIM_DESKTOP_E2E_SIM_URL=http://127.0.0.1:3021 \
410464
SIM_DESKTOP_E2E_PROXY_PORT=3020 \
@@ -413,13 +467,13 @@ jobs:
413467
SIM_DESKTOP_E2E_REDIS_URL="$REDIS_URL" \
414468
SIM_DESKTOP_E2E_AUTH_SECRET="$BETTER_AUTH_SECRET" \
415469
xvfb-run -a -s '-screen 0 1920x1200x24' bunx playwright test e2e/desktop-tools-live-sim.spec.ts \
416-
--output "$report_dir/desktop-tools-results" --reporter=line --retries=0
470+
--output "$report_dir/desktop-tools-results"
417471
418-
- name: Upload end-to-end reports and server logs
472+
- name: Upload Electron E2E results and server logs
419473
if: failure()
420474
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
421475
with:
422-
name: http-e2e-reports
476+
name: desktop-live-e2e-results
423477
path: ${{ runner.temp }}/e2e/
424478
if-no-files-found: ignore
425479
retention-days: 7

0 commit comments

Comments
 (0)