Customizable wpt options and profile in workflows (#30912)

* wpt -> wpt-sync

* Add profile configuration option

* Add wpt (for custom tests selection) to CI

* Renaming of wpt-* options

* fixup! do renames also in scripts

* fixup! profile

* Fix try labels
This commit is contained in:
Samson 2023-12-22 13:49:39 +01:00 committed by GitHub
parent 81f5157522
commit 1f0f50b22b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 105 additions and 61 deletions

View file

@ -5,21 +5,25 @@ on:
profile:
required: true
type: string
wpt:
wpt-tests-to-run:
default: ""
required: false
type: string
layout:
wpt-sync-from-upstream:
required: false
type: boolean
wpt-layout:
required: true
type: string
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
WPT_COMMAND_LINE_ARG: "${{ inputs.layout == 'layout-2013' && '--legacy-layout' || '' }}"
WPT_COMMAND_LINE_ARG: "${{ inputs.wpt-layout == 'layout-2013' && '--legacy-layout' || '' }}"
jobs:
linux-wpt:
name: WPT ${{ inputs.layout }}
name: WPT ${{ inputs.wpt-layout }}
runs-on: ubuntu-22.04
env:
max_chunk_id: 20
@ -63,13 +67,13 @@ jobs:
sudo apt install ./libffi6_3.2.1-8_amd64.deb
python3 ./mach bootstrap-gstreamer
- name: Sync from upstream WPT
if: ${{ inputs.wpt == 'sync' }}
if: ${{ inputs.wpt-sync-from-upstream == 'true' }}
run: |
./mach update-wpt --sync --patch
- name: Run tests
if: ${{ inputs.wpt != 'sync' }}
if: ${{ inputs.wpt-sync-from-upstream != 'true' }}
run: |
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG ${{ inputs.wpt-tests-to-run }} \
--${{ inputs.profile }} --processes $(nproc) --timeout-multiplier 2 \
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
@ -79,7 +83,7 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}
INTERMITTENT_TRACKER_DASHBOARD_SECRET: ${{ secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET }}
- name: Run tests (sync)
if: ${{ inputs.wpt == 'sync' }}
if: ${{ inputs.wpt-sync-from-upstream == 'true' }}
run: |
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
--${{ inputs.profile }} --processes $(nproc) --timeout-multiplier 2 \
@ -88,24 +92,24 @@ jobs:
--always-succeed
- name: Archive filtered results
uses: actions/upload-artifact@v3
if: ${{ always() && inputs.wpt != 'sync' }}
if: ${{ always() && inputs.wpt-sync-from-upstream != 'true' }}
with:
name: wpt-filtered-results-linux-${{ inputs.layout }}
name: wpt-filtered-results-linux-${{ inputs.wpt-layout }}
path: |
filtered-test-wpt.${{ matrix.chunk_id }}.json
unexpected-test-wpt.${{ matrix.chunk_id }}.log
- name: Archive logs
uses: actions/upload-artifact@v3
if: ${{ failure() && inputs.wpt != 'sync' }}
if: ${{ failure() && inputs.wpt-sync-from-upstream != 'true' }}
with:
name: wpt-logs-linux-${{ inputs.layout }}
name: wpt-logs-linux-${{ inputs.wpt-layout }}
path: |
test-wpt.${{ matrix.chunk_id }}.log
- name: Archive logs
uses: actions/upload-artifact@v3
if: ${{ inputs.wpt == 'sync' }}
if: ${{ inputs.wpt-sync-from-upstream == 'true' }}
with:
name: wpt-logs-linux-${{ inputs.layout }}
name: wpt-logs-linux-${{ inputs.wpt-layout }}
path: |
test-wpt.${{ matrix.chunk_id }}.log
wpt-jsonsummary.${{ matrix.chunk_id }}.log
@ -113,7 +117,7 @@ jobs:
report-test-results:
name: Report WPT Results
runs-on: ubuntu-latest
if: ${{ always() && !cancelled() && inputs.wpt == 'test' }}
if: ${{ always() && !cancelled() && inputs.wpt-sync-from-upstream != 'true' }}
needs:
- "linux-wpt"
steps:
@ -122,20 +126,20 @@ jobs:
fetch-depth: 2
- uses: actions/download-artifact@v3
with:
name: wpt-filtered-results-linux-${{ inputs.layout }}
name: wpt-filtered-results-linux-${{ inputs.wpt-layout }}
path: wpt-filtered-results-linux
- name: Create aggregated unexpected results
run: |
cat wpt-filtered-results-linux/*.log > unexpected-test-wpt-${{ inputs.layout }}.log
cat wpt-filtered-results-linux/*.log > unexpected-test-wpt-${{ inputs.wpt-layout }}.log
- name: Archive aggregate results
uses: actions/upload-artifact@v3
with:
name: wpt-filtered-results-linux
path: |
unexpected-test-wpt-${{ inputs.layout }}.log
unexpected-test-wpt-${{ inputs.wpt-layout }}.log
- name: Comment on PR with results
run: |
etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-${{ inputs.layout }}" wpt-filtered-results-linux/*.json
etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-${{ inputs.wpt-layout }}" wpt-filtered-results-linux/*.json
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}