test(web): verify turn UX across four workers

This commit is contained in:
Bingxi Zhao (Frank)
2026-09-01 20:23:05 +08:00
parent bfdf874a10
commit e1ca8f65dc
5 changed files with 425 additions and 14 deletions

View File

@@ -1,6 +1,9 @@
name: Tests
on:
workflow_dispatch:
schedule:
- cron: "17 3 * * *"
push:
branches:
- main
@@ -96,6 +99,52 @@ jobs:
working-directory: web
run: npx eslint .
multi-worker-web:
name: Four-worker browser acceptance
if: vars.DEEPTUTOR_MULTI_WORKER_E2E_URL != ''
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install frontend dependencies
working-directory: web
run: npm ci --legacy-peer-deps
- name: Install Playwright Chromium
working-directory: web
run: npx playwright install --with-deps chromium
- name: Run desktop and mobile four-worker scenarios
working-directory: web
run: >-
npx playwright test
--project=multi-worker-turns-desktop
--project=multi-worker-turns-mobile
env:
DEEPTUTOR_MULTI_WORKER_E2E: "1"
WEB_BASE_URL: ${{ vars.DEEPTUTOR_MULTI_WORKER_E2E_URL }}
NEXT_PUBLIC_API_BASE: ${{ vars.DEEPTUTOR_MULTI_WORKER_E2E_URL }}
DEEPTUTOR_MULTI_WORKER_CONTROL_URL: ${{ vars.DEEPTUTOR_MULTI_WORKER_CONTROL_URL || vars.DEEPTUTOR_MULTI_WORKER_E2E_URL }}
- name: Upload browser traces and videos
if: always()
uses: actions/upload-artifact@v4
with:
name: multi-worker-browser-evidence
path: |
web/playwright-report
web/test-results
if-no-files-found: ignore
import-check:
name: Import Check (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
@@ -207,7 +256,7 @@ jobs:
test-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [lint, web-tests, import-check, python-tests]
needs: [lint, web-tests, multi-worker-web, import-check, python-tests]
if: always()
steps:
@@ -219,9 +268,10 @@ jobs:
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Lint and format | ${{ needs.lint.result == 'success' && '✅ Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Web node tests | ${{ needs.web-tests.result == 'success' && '✅ Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Four-worker browser acceptance | ${{ needs.multi-worker-web.result == 'success' && '✅ Passed' || needs.multi-worker-web.result == 'skipped' && '⏭️ Fixture not configured' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Import check (3.11/3.12/3.13; 3.14 best-effort) | ${{ needs.import-check.result == 'success' && '✅ Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Python tests (3.11/3.12/3.13; 3.14 best-effort) | ${{ needs.python-tests.result == 'success' && '✅ Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
- name: Fail if tests failed
if: needs.lint.result == 'failure' || needs.web-tests.result == 'failure' || needs.import-check.result == 'failure' || needs.python-tests.result == 'failure'
if: needs.lint.result == 'failure' || needs.web-tests.result == 'failure' || needs.multi-worker-web.result == 'failure' || needs.import-check.result == 'failure' || needs.python-tests.result == 'failure'
run: exit 1