Clone this repo:

Branches

  1. 478d4e3 Add meet-pip-note CUJ (9p and 9p-5tabs variants) by Charles William Dick · 2 hours ago main
  2. 8522152 [runner] Fix web-tests runner on Windows hosts by Stefano Galarraga · 2 days ago
  3. 7c6c3c3 Roll third_party/crossbench/ c3c1ad7d3..07cefeaf1 (50 commits) by Stefano Galarraga · 2 days ago
  4. 6f7ef93 Record per-test status, timing, and failure log tail in web_tests_results.json by Kameron Lutes · 3 days ago
  5. 9689248 Migrate Crossbench CUJs to GCS WPR URI and remove wpr-setup.sh by Kameron Lutes · 3 days ago

web-tests

web-tests contains:

  • Definitions for CUJs implemented using crossbench's loading benchmark
  • Configuration files for running benchmarks that are built in to crossbench (such as speedometer)
  • Metric definitions and queries for CUJs and benchmarks.

Setup

Install golang (required for WPR and presubmit upload checks)

sudo apt-get install golang

Google Cloud SDK

You need to have gcloud storage installed and authenticated to download WPR archives used in benchmarks.

  1. Install Google Cloud SDK.
  2. Authenticate your account:
gcloud auth login

Do not git clone web-tests. Use the fetch command included with depot_tools.

mkdir src
cd src
gcloud auth login
fetch web-tests
cd web-tests

Don't forget to run gclient sync every time you pull new changes from origin.

Running Tests

Python dependencies are managed automatically using vpython3 (included with depot_tools).

Android

Before running a test against an android target, make sure your device is connected through adb:

adb devices
> List of devices attached
> 192.168.20.194:5555     device

Replace <DEVICE ID> below with the actual device ID from adb devices:

cd cuj/crossbench/runner
vpython3 run.py --platform adb --device <DEVICE ID>

ChromeOS

Before running a test against a ChromeOS target, make sure passwordless SSH is available to the device. Either an IP address or a SSH host is supported as the device id.

Replace <DEVICE> below with the IP address or hostname of your device:

cd cuj/crossbench/runner
vpython3 run.py --platform cros --device <DEVICE>

Local

Running against a local browser on linux is minimally supported, but may require manual changes to test configuration.

cd cuj/crossbench/runner
vpython3 run.py --platform local

Windows

Windows is supported through the local platform. Run the same command from a Windows shell (PowerShell or cmd):

cd cuj\crossbench\runner
vpython3 run.py --platform local

chrome resolves to the installed Chrome stable; use --browser <path to chrome.exe> for other channels. Crossbench result symlinks are disabled on Windows, and the results/latest symlink is only created if Windows Developer Mode is enabled.

Specifying Tests and Variants

The minimal invocation of the runner will attempt to run all benchmarks, CUJs, and corresponding variants in series.

To run a subset of tests, use the --tests flag. --tests supports Python regex format for matching the test names.

vpython3 run.py --platform adb --device <DEVICE ID> --tests speedometer.*

To specify only certain variants of a test, you can use the --variants flag. --variants also supports Python regex format for matching variants.

vpython3 run.py --platform adb --device <DEVICE ID> --tests local-conference --variants 16p

Specifying Browsers

By default the runner will use ‘Chrome’ if the --browser flag is not specified. The format accepted by the --browser flag depends on the platform. For Android, use the package name of the installed browser. For ChromeOS or local, use the path to the browser executable.

Secrets

Some CUJs require secrets to perform privileged actions (such as a test account username/password, or auth tokens for the Google Meet Bond API). Place your secrets in secrets.hjson and pass the file to the runner:

vpython3 run.py --platform adb --device <DEVICE ID> --secrets /home/me/secrets.hjson --tests docs

Looping Tests

Tests can be repeated for a number of iterations or for a specified amount of time using the --playback flag. This flag is supported by crossbench and will iterate the post-setup sections of a CUJ and collect metrics for the entire invocation (instead of splitting metrics by iteration).

vpython3 run.py --platform adb --device <DEVICE ID> --tests tab-stress --variants blank-tab --playback 50x
vpython3 run.py --platform adb --device <DEVICE ID> --tests tab-stress --variants blank-tab --playback 2h

Field Trials (Finch)

By default crossbench runs Chrome with --disable-field-trial-config. To run with a realistic, deterministic Finch configuration instead, use the test seeds that Chrome's variations smoke tests use (CIPD package chromium/chrome/test/data/variations/cipd). Each study in those seeds is reduced to its largest group.

Set "checkout_variations_seed": True in your .gclient custom_vars and run gclient sync.

Then pass --variations-seed to the runner:

vpython3 run.py --platform adb --device <DEVICE ID> --tests meet --variants 4p --variations-seed new

See vpython3 run.py --help for details. For unbranded builds, also add --fake-variations-channel to the browser flags so that channel-filtered studies apply.

Contributing

To get started contributing to web-tests, refer to the docs.