Changes

Jump to: navigation, search

TestEngineering/Performance/Raptor

46 bytes added, 13:31, 23 August 2019
Change all ./mach raptor-test calls to ./mach raptor and add a message about running locally at the top that also mentions the possibility of raptor-test being deprecated in the future.
* Good first bugs: https://codetribute.mozilla.org/projects/automation?project%3DRaptor
Raptor currently supports three test types: 1) page-load performance tests, 2) standard benchmark-performance tests, and 3) "scenario"-based tests, such as power, CPU, and memory-usage measurements on Android (and desktop?). Locally, raptor can be invoked with either of the following commands - raptor-test may be deprecated in the future: ./mach raptor ./mach raptor-test
=== Page-Load Tests ===
===== Fennec =====
./mach raptor-test --test raptor-scn-power-idle-fennec --app fennec --binary org.mozilla.firefox --power-test --host 10.252.27.96
===== Fenix =====
./mach raptor-test --test raptor-scn-power-idle-fenix --app fenix --binary org.mozilla.fenix.performancetest --power-test --host 10.252.27.96
===== GeckoView =====
./mach raptor-test --test raptor-scn-power-idle-geckoview --app geckoview --binary org.mozilla.geckoview_example --power-test --host 10.252.27.96
===== Reference Browser =====
./mach raptor-test --test raptor-scn-power-idle-refbrow --app refbrow --binary org.mozilla.reference.browser.raptor --power-test --host 10.252.27.96
'''NOTE:'''
To see which Raptor performance tests are currently available on all platforms, use the 'print-tests' option, e.g.:
$ ./mach raptor-test --print-tests
That will output all available tests on each supported app, as well as each subtest available in each suite (i.e. all the pages in a specific page-load tp6* suite).
To run Raptor locally, just build Firefox and then run:
$ ./mach raptor-test --test <raptor-test-name>
For example, to run the raptor-tp6 pageload test locally, just use:
$ ./mach raptor-test --test raptor-tp6-1
You can run individual subtests too (i.e. a single page in one of the tp6* suites). For example, to run the amazon page-load test on Firefox:
$ ./mach raptor-test --test raptor-tp6-amazon-firefox
Raptor test results will be found locally in <your-repo>/testing/mozharness/build/raptor.json.
Once your Android device is ready, and attached to local USB, from within your local mozilla repo use the following command line to run speedometer:
$ ./mach raptor-test --test raptor-speedometer --app=geckoview --binary="org.mozilla.geckoview_example"
Note: Speedometer on Android GeckoView is currently running on two devices in production - the Google Pixel 2 and the Moto G5 - therefore it is not guaranteed that it will run successfully on all/other untested android devices. There is an intermittent failure on the Moto G5 where speedometer just stalls ([https://bugzilla.mozilla.org/show_bug.cgi?id=1492222 Bug 1492222]).
To run a Raptor page-load test (i.e. tp6m-1) on the GeckoView Example app, use this command line:
$ ./mach raptor-test --test raptor-tp6m-1 --app=geckoview --binary="org.mozilla.geckoview_example"
A couple notes about debugging:
To run Raptor locally on Google Chrome, make sure you already have a local version of Google Chrome installed, and then from within your mozilla-repo run:
$ ./mach raptor-test --test <raptor-test-name> --app=chrome --binary="<path to google chrome binary>"
For example, to run the raptor-speedometer benchmark on Google Chrome use:
$ ./mach raptor-test --test raptor-speedometer --app=chrome --binary="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Raptor test results will be found locally in <your-repo>/testing/mozharness/build/raptor.json.
You can override the default page-timeout by using the --page-timeout command-line arg. In this example, each test page in tp6-1 will be given two minutes to load during each page-cycle:
./mach raptor-test --test raptor-tp6-1 --page-timeout 120000
If an iteration of a benchmark test is not finishing within the allocated time, increase it by:
./mach raptor-test --test raptor-speedometer --page-timeout 600000
==== Page-Cycles ====
You can override the default page-cycles by using the --page-cycles command-line arg. In this example, the test page will only be loaded twice:
./mach raptor-test --test raptor-tp6-google-firefox --page-cycles 2
==== Running Page-Load Tests on Live Sites ====
To tell Raptor to create Gecko profiles during a performance test, just add the '--gecko-profile' flag to the command line, i.e.:
$ ./mach raptor-test --test raptor-sunspider --gecko-profile
When the Raptor test is finished, you will be able to find the resulting gecko profiles (ZIP) located locally in:
mozilla-central/testing/mozharness/build/blobber_upload_dir/
Note: While profiling is turned on, Raptor will automatically reduce the number of pagecycles to 3. If you wish to override this, add the --page-cycles argument to the raptor-test command line.
Raptor will automatically launch Firefox and load the latest Gecko profile in [https://perf-html.io perfhtml.io]. To turn this feature off, just set the DISABLE_PROFILE_LAUNCH=1 env var.
All the pages in a test suite an be run by calling the top-level test name, i.e.:
./mach raptor-test --test raptor-tp6-1
Individual test pages can be ran by calling the subtest, i.e.:
./mach raptor-test --test raptor-tp6-google-firefox
Some of the page recordings contain [[https://wiki.mozilla.org/Performance_sheriffing/Raptor/Mitmproxy#Adding_Hero_Elements hero elements]]. When hero elements are measured, the value is the time until the hero element appears on the page (in MS).
The easiest way to debug the Raptor web extension is to run the Raptor test locally and invoke debug mode, i.e. for Firefox:
./mach raptor-test --test raptor-tp6-amazon-firefox --debug-mode
Or on Chrome, for example:
./mach raptor-test --test raptor-tp6-amazon-chrome --app=chrome --binary="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --debug-mode
Running Raptor with debug mode will:
In order to retrieve the console.log() output from the Raptor runner, do the following:
# Invoke Raptor locally via ./mach raptor-test
# During the 30 second Raptor pause which happens right after Firefox has started up, in the ALREADY OPEN current tab, type "about:debugging" for the URL.
# On the debugging page that appears, make sure "Add-ons" is selected on the left (default).
When running Raptor tests on Firefox on Android (i.e. geckoview), to see the console.log() output from the Raptor web extension, do the following:
# With your android device (i.e. Google Pixel 2) all set up and connected to USB, invoke the Raptor test normally via ./mach raptor-test
# Start up a local copy of the Firefox Nightly Desktop browser
# In Firefox Desktop choose "Tools => Web Developer => WebIDE"
83
edits

Navigation menu