Enable test coverage for playwright tests.

This commit is contained in:
Jade Welton
2026-03-06 08:01:11 -08:00
parent c343bad630
commit 5ab70d6642
30 changed files with 1230 additions and 220 deletions
+11 -1
View File
@@ -161,6 +161,7 @@ jobs:
env:
NODE_TLS_REJECT_UNAUTHORIZED: 0
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
COVERAGE: 1
strategy:
fail-fast: false
matrix:
@@ -217,6 +218,8 @@ jobs:
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --list
- name: Run test shard ${{ matrix['shardIndex'] }} of ${{ matrix['shardTotal']}}
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=3
- name: "Generate code coverage report for shard ${{ matrix['shardIndex'] }}"
run: npx nyc report --reporter=html --reporter=text --report-dir=coverage/shard-${{ matrix.shardIndex }}
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
@@ -224,6 +227,13 @@ jobs:
name: blob-report-${{ matrix.shardIndex }}
path: blob-report
retention-days: 1
- name: Upload coverage report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.shardIndex }}
path: coverage/shard-${{ matrix.shardIndex }}
retention-days: 1
merge-playwright-reports:
name: "Merge Playwright Reports"
@@ -255,4 +265,4 @@ jobs:
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14
retention-days: 14