Skip to content

A local-first personal finance app

Shard e2e ci jobs (#6359)

Matiss Janis Aboltinsecb8a1a54847
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index a013c9c928..51adc54e47 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -38,9 +38,13 @@ jobs:
run: ./.github/actions/netlify-wait-for-build
functional:
- name: Functional
+ name: Functional (shard ${{ matrix.shard }}/5)
needs: netlify
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3, 4, 5]
container:
image: mcr.microsoft.com/playwright:v1.56.0-jammy
steps:
@@ -50,13 +54,13 @@ jobs:
- name: Trust the repository directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Run E2E Tests on Netlify URL
- run: yarn e2e
+ run: yarn e2e --shard=${{ matrix.shard }}/5
env:
E2E_START_URL: ${{ needs.netlify.outputs.netlify_url }}
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: always()
with:
- name: desktop-client-test-results
+ name: desktop-client-test-results-shard-${{ matrix.shard }}
path: packages/desktop-client/test-results/
retention-days: 30
overwrite: true
@@ -84,9 +88,13 @@ jobs:
overwrite: true
vrt:
- name: Visual regression
+ name: Visual regression (shard ${{ matrix.shard }}/5)
needs: netlify
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3, 4, 5]
container:
image: mcr.microsoft.com/playwright:v1.56.0-jammy
steps:
@@ -94,13 +102,52 @@ jobs:
- name: Set up environment
uses: ./.github/actions/setup
- name: Run VRT Tests on Netlify URL
- run: yarn vrt
+ run: yarn vrt --shard=${{ matrix.shard }}/5
env:
E2E_START_URL: ${{ needs.netlify.outputs.netlify_url }}
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: always()
with:
- name: desktop-client-test-results
- path: packages/desktop-client/test-results/
+ name: vrt-blob-report-${{ matrix.shard }}
+ path: packages/desktop-client/blob-report/
+ retention-days: 1
+ overwrite: true
+
+ merge-vrt:
+ name: Merge VRT Reports
+ needs: vrt
+ runs-on: ubuntu-latest
+ if: ${{ !cancelled() }}
+ container:
+ image: mcr.microsoft.com/playwright:v1.56.0-jammy
+ steps:
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - name: Set up environment
+ uses: ./.github/actions/setup
+ - name: Download all blob reports
+ uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
+ with:
+ path: packages/desktop-client/all-blob-reports
+ pattern: vrt-blob-report-*
+ merge-multiple: true
+ - name: Merge reports
+ id: merge-reports
+ run: yarn workspace @actual-app/web run playwright merge-reports --reporter html ./all-blob-reports
+ - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
+ id: playwright-report-vrt
+ with:
+ name: html-report--attempt-${{ github.run_attempt }}
+ path: packages/desktop-client/playwright-report
retention-days: 30
overwrite: true
+ - name: Comment on PR with VRT report link
+ if: github.event_name == 'pull_request' && needs.vrt.result == 'failure'
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ with:
+ script: |
+ await github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: `VRT tests ❌ failed. [View the test report](${{ steps.playwright-report-vrt.outputs.artifact-url }}).`
+ });
diff --git a/packages/desktop-client/playwright.config.ts b/packages/desktop-client/playwright.config.ts
index bd14af2eb2..40804157f1 100644
--- a/packages/desktop-client/playwright.config.ts
+++ b/packages/desktop-client/playwright.config.ts
@@ -4,6 +4,7 @@ import { defineConfig } from '@playwright/test';
export default defineConfig({
timeout: 60000, // 60 seconds
retries: 1,
+ fullyParallel: true,
workers: process.env.CI ? 1 : undefined,
testDir: 'e2e/',
reporter: process.env.CI ? 'blob' : [['html', { open: 'never' }]],
diff --git a/upcoming-release-notes/6359.md b/upcoming-release-notes/6359.md
new file mode 100644
index 0000000000..4dd1099e4c
--- /dev/null
+++ b/upcoming-release-notes/6359.md
@@ -0,0 +1,7 @@
+---
+category: Enhancements
+authors: [MatissJanis]
+---
+
+Implement parallelization of E2E tests using matrix-based sharding in GitHub Actions workflow.
+