Speed up playwright runs by sharding using tenbin
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
23
.github/workflows/end-to-end-tests.yaml
vendored
23
.github/workflows/end-to-end-tests.yaml
vendored
@@ -164,13 +164,25 @@ jobs:
|
||||
if: matrix.project == 'WebKit' && steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn playwright install-deps webkit
|
||||
|
||||
# Restore test-results.json file, which records the execution time of each test file.
|
||||
# splitTests function uses this file for sharding.
|
||||
- name: Restore playwright-results.json
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: playwright-results.json
|
||||
key: playwright-results-${{ github.ref_name }}
|
||||
restore-keys: |
|
||||
playwright-results-${{ github.base_ref }}
|
||||
playwright-results-develop
|
||||
|
||||
# We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
|
||||
- name: Run Playwright tests
|
||||
run: |
|
||||
yarn playwright test \
|
||||
--shard "${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}" \
|
||||
--project="${{ matrix.project }}" \
|
||||
${{ (github.event_name == 'pull_request' && matrix.runAllTests == false ) && '--grep-invert @mergequeue' || '' }}
|
||||
env:
|
||||
SHARD: "${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}"
|
||||
|
||||
- name: Upload blob report to GitHub Actions Artifacts
|
||||
if: always()
|
||||
@@ -212,10 +224,17 @@ jobs:
|
||||
|
||||
- name: Merge into HTML Report
|
||||
if: inputs.skip != true
|
||||
run: yarn playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts,./playwright/stale-screenshot-reporter.ts ./all-blob-reports
|
||||
run: yarn playwright merge-reports --reporter=html,json,./playwright/flaky-reporter.ts,./playwright/stale-screenshot-reporter.ts ./all-blob-reports
|
||||
env:
|
||||
# Only pass creds to the flaky-reporter on main branch runs
|
||||
GITHUB_TOKEN: ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}
|
||||
PLAYWRIGHT_JSON_OUTPUT_NAME: playwright-results.json
|
||||
|
||||
- name: Cache playwright-results.json
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: playwright-results.json
|
||||
key: playwright-results-${{ github.ref_name }}
|
||||
|
||||
# Upload the HTML report even if one of our reporters fails, this can happen when stale screenshots are detected
|
||||
- name: Upload HTML report
|
||||
|
||||
Reference in New Issue
Block a user