servo/etc/ci/performance
2016-12-01 10:23:27 +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
gecko_driver.py Use resource manager in gecko_driver and nits 2016-11-16 17:53:55 +08: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 Add an option to submit test-perf result to perfherder 2016-12-01 10:23:27 +08:00
runner.py Use resource manager in gecko_driver and nits 2016-11-16 17:53:55 +08:00
submit_to_perfherder.py FIX TreeherderClient deprecated param 2016-08-27 13:43:43 +08:00
test_all.sh Add an option to submit test-perf result to perfherder 2016-12-01 10:23:27 +08:00
test_differ.py Making test-tidy happy. 2016-08-20 12:06:51 -05:00
test_perf.sh Add an option to submit test-perf result to perfherder 2016-12-01 10:23:27 +08:00
test_runner.py Use selenium to drive gecko test 2016-11-14 11:43:23 +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

./mach test-perf can be used to run a performance test on your servo build. The test result JSON will be saved to etc/ci/performance/output/. You can then run python test_differ.py to compare these two test results. Run python test_differ.py -h for instructions.

Setup for CI machine

CI for Servo

  • Setup your Treeherder client ID and secret as environment variables TREEHERDER_CLIENT_ID and TREEHERDER_CLIENT_SECRET
  • Run ./mach test-perf --submit to run and submit the result to Perfherder.

CI for Gecko

  • Install Firefox Nightly in your PATH
  • Download geckodriver and add it to the PATH
  • pip install selenium
  • Run python gecko_driver.py to test
  • Run test_all.sh --gecko --submit

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

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)