mirror of
https://github.com/actualbudget/actual.git
synced 2026-10-11 22:49:59 +00:00
[AI] CI: Support parallel e2e shards locally with per-shard port (#8456)
* [AI] ci: support parallel e2e shards with per-shard port - Add 'Set E2E port' step to functional and vrt jobs (E2E_PORT = 3000 + shard) - Use vars.E2E_SHARD_TOTAL (with fallback '3') for shard denominator in job names and test commands; pass --var E2E_SHARD_TOTAL=1 to run full suite in a single local shard without relaunching - Add .actrc with depot runner image mappings * [AI] fix(ci): address review feedback on e2e shard guard/injection
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
-P depot-ubuntu-latest=catthehacker/ubuntu:act-latest
|
||||
-P depot-ubuntu-latest-4=catthehacker/ubuntu:act-latest
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
overwrite: true
|
||||
|
||||
functional:
|
||||
name: Functional (shard ${{ matrix.shard }}/3)
|
||||
name: Functional (shard ${{ matrix.shard }}/${{ vars.E2E_SHARD_TOTAL || '3' }})
|
||||
runs-on: depot-ubuntu-latest-4
|
||||
needs: build-web
|
||||
strategy:
|
||||
@@ -83,10 +83,16 @@ jobs:
|
||||
with:
|
||||
name: desktop-client-build
|
||||
path: packages/desktop-client/build/
|
||||
- name: Set E2E port
|
||||
if: ${{ matrix.shard <= fromJson(vars.E2E_SHARD_TOTAL || '3') }}
|
||||
run: echo "E2E_PORT=$((3000 + ${{ matrix.shard }}))" >> "$GITHUB_ENV"
|
||||
- name: Run E2E Tests
|
||||
run: yarn e2e --shard=${{ matrix.shard }}/3
|
||||
if: ${{ matrix.shard <= fromJson(vars.E2E_SHARD_TOTAL || '3') }}
|
||||
env:
|
||||
SHARD_TOTAL: ${{ vars.E2E_SHARD_TOTAL || '3' }}
|
||||
run: yarn e2e --shard=${{ matrix.shard }}/$SHARD_TOTAL
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
if: failure()
|
||||
if: ${{ failure() && matrix.shard <= fromJson(vars.E2E_SHARD_TOTAL || '3') }}
|
||||
with:
|
||||
name: desktop-client-test-results-shard-${{ matrix.shard }}
|
||||
path: packages/desktop-client/test-results/
|
||||
@@ -94,7 +100,7 @@ jobs:
|
||||
overwrite: true
|
||||
- name: Upload E2E JUnit report
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
if: ${{ !cancelled() }}
|
||||
if: ${{ !cancelled() && matrix.shard <= fromJson(vars.E2E_SHARD_TOTAL || '3') }}
|
||||
with:
|
||||
name: e2e-junit-${{ matrix.shard }}
|
||||
path: packages/desktop-client/test-results/junit.xml
|
||||
@@ -162,7 +168,7 @@ jobs:
|
||||
path: packages/desktop-electron/e2e/test-results/junit.xml
|
||||
|
||||
vrt:
|
||||
name: Visual regression (shard ${{ matrix.shard }}/3)
|
||||
name: Visual regression (shard ${{ matrix.shard }}/${{ vars.E2E_SHARD_TOTAL || '3' }})
|
||||
runs-on: depot-ubuntu-latest
|
||||
needs: build-web
|
||||
strategy:
|
||||
@@ -188,10 +194,16 @@ jobs:
|
||||
with:
|
||||
name: desktop-client-build
|
||||
path: packages/desktop-client/build/
|
||||
- name: Set E2E port
|
||||
if: ${{ matrix.shard <= fromJson(vars.E2E_SHARD_TOTAL || '3') }}
|
||||
run: echo "E2E_PORT=$((3000 + ${{ matrix.shard }}))" >> "$GITHUB_ENV"
|
||||
- name: Run VRT Tests
|
||||
run: yarn vrt --shard=${{ matrix.shard }}/3
|
||||
if: ${{ matrix.shard <= fromJson(vars.E2E_SHARD_TOTAL || '3') }}
|
||||
env:
|
||||
SHARD_TOTAL: ${{ vars.E2E_SHARD_TOTAL || '3' }}
|
||||
run: yarn vrt --shard=${{ matrix.shard }}/$SHARD_TOTAL
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
if: always()
|
||||
if: ${{ always() && matrix.shard <= fromJson(vars.E2E_SHARD_TOTAL || '3') }}
|
||||
with:
|
||||
name: vrt-blob-report-${{ matrix.shard }}
|
||||
path: packages/desktop-client/blob-report/
|
||||
@@ -199,7 +211,7 @@ jobs:
|
||||
overwrite: true
|
||||
- name: Upload VRT JUnit report
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
if: ${{ !cancelled() }}
|
||||
if: ${{ !cancelled() && matrix.shard <= fromJson(vars.E2E_SHARD_TOTAL || '3') }}
|
||||
with:
|
||||
name: vrt-junit-${{ matrix.shard }}
|
||||
path: packages/desktop-client/test-results/junit.xml
|
||||
|
||||
@@ -2,11 +2,13 @@ import path from 'node:path';
|
||||
|
||||
import { defineConfig } from '@playwright/test';
|
||||
|
||||
const e2ePort = Number(process.env.E2E_PORT) || 3001;
|
||||
|
||||
export default defineConfig({
|
||||
timeout: 60000, // 60 seconds
|
||||
retries: 1,
|
||||
fullyParallel: true,
|
||||
workers: process.env.CI ? 4 : undefined,
|
||||
workers: Number(process.env.E2E_WORKERS) || (process.env.CI ? 4 : undefined),
|
||||
testDir: 'e2e/',
|
||||
reporter: process.env.CI
|
||||
? [['blob'], ['list'], ['junit', { outputFile: 'test-results/junit.xml' }]]
|
||||
@@ -15,7 +17,7 @@ export default defineConfig({
|
||||
userAgent: 'playwright',
|
||||
screenshot: 'only-on-failure',
|
||||
browserName: 'chromium',
|
||||
baseURL: process.env.E2E_START_URL ?? 'http://localhost:3001',
|
||||
baseURL: process.env.E2E_START_URL ?? `http://localhost:${e2ePort}`,
|
||||
trace: 'on-first-retry',
|
||||
ignoreHTTPSErrors: true,
|
||||
},
|
||||
@@ -39,9 +41,9 @@ export default defineConfig({
|
||||
: {
|
||||
cwd: path.join(__dirname, '..', '..'),
|
||||
command: process.env.E2E_USE_BUILD
|
||||
? 'node packages/desktop-client/bin/serve-build.mjs'
|
||||
? `PORT=${e2ePort} node packages/desktop-client/bin/serve-build.mjs`
|
||||
: 'yarn start',
|
||||
url: 'http://localhost:3001',
|
||||
url: `http://localhost:${e2ePort}`,
|
||||
reuseExistingServer: !process.env.CI,
|
||||
stdout: 'ignore',
|
||||
stderr: 'pipe',
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [StephenBrown2]
|
||||
---
|
||||
|
||||
E2E test fixes for easier local runs
|
||||
Reference in New Issue
Block a user