Use @tenbin/jest

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2025-01-09 13:59:27 +00:00
parent 6a7aa172c4
commit 034e11abe7
6 changed files with 49 additions and 9 deletions

View File

@@ -164,16 +164,13 @@ 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.
# Restore playwright-results.json file, which records the execution time of each test file.
# The 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
key: playwright-results
# We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
- name: Run Playwright tests
@@ -234,7 +231,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: playwright-results.json
key: playwright-results-${{ github.ref_name }}
key: playwright-results
# Upload the HTML report even if one of our reporters fails, this can happen when stale screenshots are detected
- name: Upload HTML report

View File

@@ -64,6 +64,14 @@ jobs:
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2
# Restore tenbin-report.json file, which records the execution time of each test file.
# @tenbin/jest/sequencer uses this file for sharding.
- name: Restore tenbin-report.json
uses: actions/cache/restore@v4
with:
path: tenbin-report.json
key: tenbin-report
- name: Run tests
run: |
yarn test \
@@ -78,6 +86,14 @@ jobs:
# tell jest to use coloured output
FORCE_COLOR: true
# @tenbin/jest/reporter generates tenbin-report.json for each shard.
- name: Upload tenbin-report.json
if: github.ref_name == 'main'
uses: actions/upload-artifact@v4
with:
name: tenbin-report-${{ matrix.runner }}
path: tenbin-report.json
- name: Move coverage files into place
if: env.ENABLE_COVERAGE == 'true'
run: mv coverage/lcov.info coverage/${{ steps.setupNode.outputs.node-version }}-${{ matrix.runner }}.lcov.info
@@ -112,3 +128,16 @@ jobs:
context: SonarCloud Code Analysis
sha: ${{ github.sha }}
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
# Download, merge & upload tenbin-report.json
- uses: actions/download-artifact@v4
with:
path: tenbin-report
pattern: tenbin-report-*
- name: Merge tenbin-report
run: jq -s add tenbin-report/**/tenbin-report.json > tenbin-report.json
- name: Cache tenbin-report.json
uses: actions/cache/save@v4
with:
path: tenbin-report.json
key: tenbin-report