servo/etc/ci/performance
2016-11-07 15:20:37 +08:00
..
firefox/addon Bug 10452 - Page Load Time Test Runner 2016-08-08 16:08:13 +08:00
page_load_test/tp5n Disabled xunlei.com perf testcase. 2016-08-20 12:01:00 -05:00
user-agent-js Include document title in report. 2016-08-19 13:51:12 -05:00
.gitignore Added etc/ci/performance downloads to .gitignore. 2016-09-22 09:59:44 -05:00
git_log_to_json.sh Bug 10452 - Page Load Time Test Runner 2016-08-08 16:08:13 +08:00
prepare_manifest.sh Ooops, checked in a test version. 2016-08-19 16:29:34 -05:00
README.md Log and readme improvements 2016-11-07 15:20:37 +08:00
runner.py Log and readme improvements 2016-11-07 15:20:37 +08:00
submit_to_perfherder.py FIX TreeherderClient deprecated param 2016-08-27 13:43:43 +08:00
test_all.sh Create ./mach test-perf command 2016-09-25 14:49:51 +08:00
test_differ.py Making test-tidy happy. 2016-08-20 12:06:51 -05:00
test_perf.sh Cached tp5 zip downloading and unzipping 2016-11-07 15:20:34 +08:00
test_runner.py Bug 10452 - Page Load Time Test Runner 2016-08-08 16:08:13 +08:00
test_submit_to_perfherder.py Bug 10452 - Page Load Time Test Runner 2016-08-08 16:08:13 +08:00

Servo Page Load Time Test

Prerequisites

  • Python3

Basic Usage

Prepare the test runner

  • Clone this repo
  • Download tp5n.zip, extract it to page_load_test/tp5n
  • Run prepare_manifest.sh to transform the tp5n manifest to our format
  • Install the Python3 treeherder-client package. For example, to install it in a virtualenv: python3 -m virtualenv venv; source venv/bin/activate; pip install "treeherder-client>=3.0.0"
  • Setup your Treeherder client ID and secret as environment variables TREEHERDER_CLIENT_ID and TREEHERDER_CLIENT_SECRET

Build Servo

  • Clone the servo repo
  • Compile release build
  • Run git_log_to_json.sh in the servo repo, save the output as revision.json
  • Put your servo binary, revision.json and resources folder in etc/ci/performance/servo/

Run

  • Activate the virutalenv: source venv/bin/activate
  • Sync your system clock before running, the Perfherder API SSL check will fail if your system clock is not accurate. (e.g. sudo nptdate tw.pool.ntp.org)
  • Run test_all.sh [--servo|--gecko] [--submit]
    • choose servo or gecko as the testing engine
    • enable submit, if you want to submit to perfherder
  • Test results are submitted to https://treeherder.mozilla.org/#/jobs?repo=servo

How it works

  • The testcase is from tp5, every testcase will run 20 times, and we take the median.
  • Some of the tests will make Servo run forever, it's disabled right now. See https://github.com/servo/servo/issues/11087
  • Each testcase is a subtest on Perfherder, and their summary time is the geometric mean of all the subtests.
  • Notice that the test is different from the Talos TP5 test we run for Gecko. So you can NOT conclude that Servo is "faster" or "slower" than Gecko from this test.

Unit tests

You can run all unit tests (include 3rd-party libraries) with python -m pytest.

Individual test can be run by python -m pytest <filename>:

  • test_runner.py
  • test_submit_to_perfherder.py

Advanced Usage

Test Perfherder Locally

If you want to test the data submission code in submit_to_perfherder.py without getting a credential for the production server, you can setup a local treeherder VM. If you don't need to test submit_to_perfherder.py, you can skip this step.

  • Add 192.168.33.10 local.treeherder.mozilla.org to /etc/hosts
  • git clone https://github.com/mozilla/treeherder; cd treeherder
  • vagrant up
  • vagrant ssh
    • ./bin/run_gunicorn
  • Outside of vm, open http://local.treeherder.mozilla.org and login to create an account
  • vagrant ssh
    • ./manage.py create_credentials <username> <email> "description", the email has to match your logged in user. Remember to log-in through the Web UI once before you run this.
    • Setup your Treeherder client ID and secret as environment variables TREEHERDER_CLIENT_ID and TREEHERDER_CLIENT_SECRET

For Gecko

  • Install Firefox Nightly in your PATH
  • Install jpm
  • Run jpm xpi in the firefox/addon folder
  • Install the generated xpi file to your Firefox Nightly

Troubleshooting

If you saw this error message:

venv/bin/activate: line 8: _OLD_VIRTUAL_PATH: unbound variable

That means your virtualenv is too old, try run pip install -U virtualenv to upgrade (If you installed ubuntu's python-virtualenv package, uninstall it first then install it through pip)