Skip to content

feat(chrome)!: update the pinned browser version to 145.0.7563.0 (#3933) #14028

feat(chrome)!: update the pinned browser version to 145.0.7563.0 (#3933)

feat(chrome)!: update the pinned browser version to 145.0.7563.0 (#3933) #14028

Workflow file for this run

# This workflow will check out wpt and run the WebDriver BiDi tests against our
# implementation sharded without generating report or updating expectations.
name: WPT
# Declare default permissions as read only.
permissions: read-all
env:
DEBUG: 'bidi:server:*,bidi:mapper:*'
DEBUG_DEPTH: 10
FORCE_COLOR: 3
PIP_DISABLE_PIP_VERSION_CHECK: 1
on:
push:
branches: 'main'
pull_request:
types:
# These are the defaults. See
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
- opened
- reopened
- synchronize
# Used for `update-expectations`
- labeled
workflow_dispatch:
inputs:
tests:
description: Tests to run (e.g. 'network/combined/')
required: false
type: string
verbose:
description: Verbose logging
default: false
required: false
type: boolean
auto-commit:
description: Auto-commit expectations
default: false
required: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
wpt-required:
name: '[Required] WPT sink'
needs: [wpt]
runs-on: ubuntu-latest
if: ${{ !cancelled() }}
steps:
- if: ${{ needs.wpt.result != 'success' }}
run: 'exit 1'
- run: 'exit 0'
wpt:
name: ${{ matrix.this_chunk }}/${{ matrix.total_chunks }} ${{ matrix.kind }}-${{ matrix.head }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Should be in sync with `update_expectations` job.
kind: [cd, node]
head: [headless, headful]
total_chunks: [6]
this_chunk: [1, 2, 3, 4, 5, 6]
exclude:
# Don't run headful node, as it takes too long.
- kind: node
head: headful
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- name: Set up Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: Disable AppArmor
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- uses: google/wireit@f21db1f3a6a4db31f42787a958cf2a18308effed # setup-github-actions-caching/v2.0.3
- name: Install and build npm dependencies
run: npm ci
- name: Setup dirs
run: mkdir -p out
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.11'
cache: 'pip'
- name: Set up virtualenv
run: pip install virtualenv
- name: Set up hosts
run: ./wpt make-hosts-file | sudo tee -a /etc/hosts
working-directory: wpt
# Install chrome, chromedriver and headless shell is required to keep them cached.
- name: Install all chrome binaries if needed
uses: ./.github/actions/setup-chrome-binaries
- name: Run WPT tests
timeout-minutes: 60
run: >
xvfb-run --auto-servernum
npm run wpt -- "webdriver/tests/bidi/${{ github.event.inputs.tests }}"
env:
CHROMEDRIVER: ${{ matrix.kind == 'cd' }}
HEADLESS: ${{ matrix.head!='headful' }}
# TODO: Fix tests and don't rerun them.
# https://github.com/GoogleChromeLabs/chromium-bidi/issues/3412
RETRY_UNEXPECTED: 2
THIS_CHUNK: ${{ matrix.this_chunk }}
TOTAL_CHUNKS: ${{ matrix.total_chunks }}
UPDATE_EXPECTATIONS: false
VERBOSE: ${{ github.event.inputs.verbose }}
WPT_REPORT: out/wptreport.${{ matrix.kind }}-${{ matrix.head }}-${{ matrix.this_chunk }}.${{ matrix.total_chunks }}.json
- name: Run WPT interop tests
if: ${{matrix.kind == 'cd'}}
run: >
xvfb-run --auto-servernum
npm run wpt -- "webdriver/tests/interop/${{ github.event.inputs.tests }}"
env:
CHROMEDRIVER: ${{ matrix.kind == 'cd' }}
CHROMEDRIVER_LOG_NAME: 'chromedriver-interop'
# TODO: Fix tests and don't rerun them.
# https://github.com/GoogleChromeLabs/chromium-bidi/issues/3412
RETRY_UNEXPECTED: 2
THIS_CHUNK: ${{ matrix.this_chunk }}
TOTAL_CHUNKS: ${{ matrix.total_chunks }}
UPDATE_EXPECTATIONS: false
VERBOSE: ${{ github.event.inputs.verbose }}
WPT_REPORT: out/wptreport-interop.${{ matrix.kind }}-${{ matrix.head }}-${{ matrix.this_chunk }}.${{ matrix.total_chunks }}.json
FAIL_NO_TEST: false
- name: Upload artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ matrix.kind }}-${{ matrix.head }}-${{ matrix.this_chunk }}.${{ matrix.total_chunks }}-artifacts
path: |
logs
out
update_expectations:
# The job gets all the sharded reports for a given configuration and updates the
# expectations for the configuration. It uploads the results to the artifacts.
name: Update WPT expectations (if required)
strategy:
matrix:
# Should be in sync with `wpt` job.
kind: [cd, node]
head: [headless, headful]
exclude:
# Don't run headful node, as it takes too long.
- kind: node
head: headful
runs-on: ubuntu-latest
needs: [wpt-required]
# Only update expectations if the tests were failed and either `auto-commit`
# checkbox is set or `update-expectations` label is present.
if: ${{ failure() && (github.event.inputs.auto-commit == 'true' || contains(github.event.pull_request.labels.*.name, 'update-expectations')) }}
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- name: Set up Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: '.nvmrc'
cache: npm
- uses: google/wireit@f21db1f3a6a4db31f42787a958cf2a18308effed # setup-github-actions-caching/v2.0.3
- name: Install and build npm dependencies
run: npm ci
- name: Setup dirs
run: mkdir -p out
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.11'
cache: 'pip'
- name: Set up virtualenv
run: pip install virtualenv
- name: Download Artifact
# Get all the artifacts from the previous WPT run in order to get all the
# test reports.
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
path: wpt_artifacts
# Merge the artifacts from all jobs in the same file.
merge-multiple: true
- name: Update expectations
timeout-minutes: 60
env:
CHROMEDRIVER: ${{ matrix.kind == 'cd' }}
HEADLESS: ${{ matrix.head!='headful' }}
# Do not run tests, only update expectations.
RUN_TESTS: false
UPDATE_EXPECTATIONS: true
VERBOSE: true
# Find all the reports for the given configuration and update the
# expectations with each report one-by-one.
run: >
find ./wpt_artifacts/
-name "wptreport.${{ matrix.kind }}-${{ matrix.head }}*.json"
-exec npm run wpt -- --wpt-report {} \;
- name: Update interop expectations
if: ${{ matrix.kind == 'cd' }}
env:
CHROMEDRIVER: ${{ matrix.kind == 'cd' }}
HEADLESS: ${{ matrix.head!='headful' }}
# Do not run tests, only update expectations.
RUN_TESTS: false
UPDATE_EXPECTATIONS: true
VERBOSE: true
# Find all the reports for the given configuration and update the
# expectations with each report one-by-one.
run: >
find ./wpt_artifacts/
-name "wptreport-interop.${{ matrix.kind }}-${{ matrix.head }}*.json"
-exec npm run wpt -- --wpt-report {} \;
- name: Determine source metadata directory name
id: paths
run: |
if [[ "${{ matrix.kind }}" == "cd" ]]; then
echo "src_dir_name=chromedriver/${{ matrix.head }}" >> $GITHUB_OUTPUT
else
echo "src_dir_name=mapper/${{ matrix.head }}" >> $GITHUB_OUTPUT
fi
- name:
Move updated expectations
# Move the expectations from the current config to a separate directory to
# upload them to artifacts.
run: |
mkdir -p ./artifacts/updated-wpt-metadata/${{ steps.paths.outputs.src_dir_name }}
mv ./wpt-metadata/${{ steps.paths.outputs.src_dir_name }}/* ./artifacts/updated-wpt-metadata/${{ steps.paths.outputs.src_dir_name }}/
- name: Upload artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: updated-wpt-metadata-${{ matrix.kind }}-${{ matrix.head }}
path: ./artifacts
commit_updated_expectations:
# Gets updated wpt expectations for all configurations and commits them in a
# single commit.
name: Commit updated expectations
runs-on: ubuntu-latest
needs: [update_expectations]
if: ${{ !cancelled() && needs.update_expectations.result == 'success' }}
steps:
# Just checkout the repo. No need in setting up Node.js or Python.
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
token: ${{ secrets.BROWSER_AUTOMATION_BOT_TOKEN || secrets.GITHUB_TOKEN }}
- name: Download Artifact
# There is no way to download artifacts by wildcard, so we need to download
# all of them. The `updated-wpt-metadata` directory should contain all the
# updated expectations from the `update_expectations` matrix.
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
path: all-artifacts
merge-multiple: true
- name: Replace expectations with the updated ones.
# Remove the actual expectations and replace them with the updated ones.
run: |
rm -rf wpt-metadata/chromedriver wpt-metadata/mapper
mv all-artifacts/updated-wpt-metadata/* ./wpt-metadata/
- name: Commit updated expectations
uses: stefanzweifel/[email protected]
with:
commit_message: Update WPT expectations
commit_options: -n --signoff
commit_user_name: Browser Automation Bot
commit_user_email: [email protected]
commit_author: Browser Automation Bot <[email protected]>
file_pattern: wpt-metadata/**/*.ini
update_report:
name: WPT report
needs: wpt
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: '.nvmrc'
cache: npm
- uses: google/wireit@f21db1f3a6a4db31f42787a958cf2a18308effed # setup-github-actions-caching/v2.0.3
- name: Install and build npm dependencies
run: npm ci
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
pattern: cd-headful-*
merge-multiple: true
- name: Generate HTML test report
run: >
mkdir -p wpt-report;
node tools/wpt-report-builder/builder.mjs \
--bidi $(ls out/wptreport.*.json) \
--interop $(ls out/wptreport-interop.*.json) \
--out wpt-report/index.html \
--out-label-2023 wpt-report/wptreport-2023.html
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Push to `gh-pages` branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: wpt-report
branch: gh-pages
target-folder: wpt