Skip to content

Commit

Permalink
test: merge sharded test reports
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Aug 14, 2023
1 parent 3a77bfc commit 8dc2864
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 154 deletions.
52 changes: 48 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,53 @@ jobs:
- name: Run Playwright tests
run: xvfb-run yarn playwright test tests/specs --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=1

- uses: actions/upload-artifact@v3
- name: Upload blob report to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report/
retention-days: 10
name: all-reports
path: playwright-report
retention-days: 1

merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: always()
needs:
- test

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- uses: actions/cache@v3
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: yarn --frozen-lockfile

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v3
with:
name: all-reports
path: all-reports

- run: ls -la .

- run: ls -la all-reports

- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-reports

- name: Upload HTML report
uses: actions/upload-artifact@v3
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
"@emotion/babel-preset-css-prop": "11.11.0",
"@emotion/cache": "11.11.0",
"@ls-lint/ls-lint": "2.0.1",
"@playwright/test": "1.34.3",
"@playwright/test": "1.37.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"@redux-devtools/cli": "2.0.0",
"@redux-devtools/remote": "0.8.0",
Expand Down Expand Up @@ -279,7 +279,7 @@
"@types/webpack": "5.28.1",
"@types/zxcvbn": "4.4.1",
"@typescript-eslint/parser": "5.60.1",
"@vitest/coverage-istanbul": "0.32.2",
"@vitest/coverage-istanbul": "0.34.1",
"audit-ci": "6.6.1",
"babel-loader": "9.1.2",
"base64-loader": "1.0.0",
Expand Down Expand Up @@ -324,7 +324,7 @@
"ts-unused-exports": "7.0.3",
"tsconfig-paths-webpack-plugin": "4.0.1",
"typescript": "5.1.6",
"vitest": "0.32.2",
"vitest": "0.34.1",
"vm-browserify": "1.1.2",
"web-ext": "7.4.0",
"web-ext-submit": "7.4.0",
Expand Down
Loading

0 comments on commit 8dc2864

Please sign in to comment.