Buildbot/Talos/Running: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "= Running Talos Tests = == I have a patch for Talos, what tests to I run? == If you are making changes to talos obviously running the tests locally will be the first step. The...")
 
 
(43 intermediate revisions by 13 users not shown)
Line 1: Line 1:
#REDIRECT [[TestEngineering/Performance/Talos/Running]]
= Running Talos Tests =
= Running Talos Tests =


== I have a patch for Talos, what tests to I run? ==
== Locally ==
 
Prerequisite: Firefox has already been built successfully locally.
 
[https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/mach Mach] is used to run the [https://wiki.mozilla.org/Buildbot/Talos/Tests Talos tests] locally. You can run suites of tests or individual tests on their own.
 
For example, to run the 'chromez' test suite:
 
    ./mach talos-test --suite chromez
 
To run a single test (the 'tart' test):
 
    ./mach talos-test --activeTests tart
 
To run two single tests, use the ':' to separate the test list:
 
    ./mach talos-test --activeTests tart:damp
 
Certain talos suites/tests require external pagesets to be downloaded. If pagesets are required, they will be downloaded and extracted automatically when running talos via mach. To disable this automatic pageset downloading, add the 'no-download' argument:


If you are making changes to talos obviously running the tests locally will be the first step.  The next logical step is to run the tests on Try server (try: -b o -p all -u none -t all).
    ./mach talos-test --suite g1 --no-download


=== Testing Locally ===
To see a list of available talos suites:


Testing locally involves running some subset of the Talos tests on
    ./mach talos-test --print-suites
desktop and possibly mobile.  Obviously not all permutations of tests
 
and the ways of running them can be tried, so common sense should be
To see a list of available talos tests:
used as to what is run. You may also want to run Talos' internal
 
unittests: http://hg.mozilla.org/build/talos/file/tip/tests
    ./mach talos-test --print-tests


You should tailor your choice of tests to pick those that cover what
Further help running talos via mach:
you've changed programmatically, but in general you should probably
run at least one startup test and one pageloader test.  A good
baseline might be:


  # refer to [https://wiki.mozilla.org/Buildbot/Talos#Running_locally_-_Source_Code running locally] for more details
    ./mach talos-test --help
  talos -n -d -a ts:tsvg -e `which firefox` --develop --datazilla-url output.json --mozAfterPaint


=== Testing on Try Server ===
'''Tip:''' Clear the operating system cache between runs, in order to significantly improve the consistency of the results. For example, on linux:


To speed up your development time and everybody else who uses Try server, there is no need to run all tests on all platforms unless this is a major change. Here are some guidelines to follow for testing patches to talos (or dependent modules):
    find . | xargs touch


* If you patch touches one file and is very minor, get minimal testing on it (1 mobile test, 1 windows test, local testing): try: -b o -p win32,android -u none -t svgr,remote-tsvg
== Try Server ==
* If you patch affects setup of the tests (config or profile) or launching of the process and is very minimal, get minimal testing on it (1 mobile test, 1 windows test, local testing): try: -b o -p win32,android -u none -t svgr,remote-tsvg
* If your patch changes a test (add or edit), test that test locally (remember a new test will need graph server changes and buildbot changes)
* If your patch changes mobile testing, test all mobile tests and 1 desktop test: (There is no good current way of doing this with try;  I recommend two try runs:


try: -b o -p win32 -u none -t svgr
To run talos tests on the try server, you just simply push to try as normal, specifying that you want to run Talos tests. It is highly recommended that you use [http://trychooser.pub.build.mozilla.org/ trychooser] to build your try server syntax (helpful hint for using trychooser: in the list of talos suites available you can hover over any one of the suites, and a list of tests included in that suite will be displayed).


try: -b o -p android -u none -t all
To run all of the talos tests as part of your try push, just add "-t all" to the end of your try syntax. To run a single talos suite as part of your try push, just add "-t <name of suite>" to your try syntax (i.e. "-t g1").


)
To turn on [https://wiki.mozilla.org/Buildbot/Talos/Profiling profiling] as part of your talos tests on try, add "mozharness: --spsProfile" to the end of the try syntax (i.e. "-t g1 mozharness: --spsProfile"). There is an option to do this in trychooser.
* If your patch changes results or output processing, run ts, tp5 on mobile, windows and locally: try: -b o -p win32,android -u none -t tpn,chromez,remote-ts,remote-tp4m_nochrome
* If your patch changes any import statement (or code referenced in the import), please test on windows, linux, and mobile as these all run different versions of python: try: -b o -p linux,win32,android -u none -t all
* If your patch changes a lot of stuff around, if you are not sure, or if you are going to deploy a new talos.zip, it is strongly recommended to run all talos tests: try: -b o -p all -u none -t all


If you are reviewing a talos patch, it is your responsibility to recommend the proper testing approach.  If you think it needs more than these guidelines, call it out.  If it needs less, call it out also.
When viewing your talos try server results on Treeherder, look for the group names 'T' and 'T-e10s'. Click on the green symbol corresponding to the talos suite name, and then click on the 'Performance' tab below to see the test results.


== Are my numbers ok ==
If you're curious about the hardware we use, here is a [https://wiki.mozilla.org/Buildbot/Talos/Misc#Hardware_Profile_of_machines_used_in_automation description of the specs].  You can also refer to the [https://wiki.mozilla.org/ReferencePlatforms#Build_Reference_Platforms test reference platforms] documentation.


The best way to answer this question is to push to try server and compare the reported numbers from the logs (use tbpl as a log parser) and compare that with the [[http://graphs.mozilla.org/ graph server]].  I recommend using tbpl to open the link to the graphs. 
== Are my Talos Results OK? ==


If you are planning on landing on mozilla-central, look at tests from mozilla-central. Be aware of PGO vs Non PGO and Chrome vs Non Chrome.  TBPL makes this a moderately pain free process (i.e. about 30 minutes). This is one of the big problems we are solving with datazilla.
The best way to answer this question is to push to try server and compare the performance of your push against a baseline, using Perfherder (it is recommended hitting retrigger a few times to get at least 5 data points for each test). After pushing to try with talos tests enabled, you will receive an email with a link to Perfherder where you can compare your results. Be aware of the options: e.g. pgo vs non-pgo or e10s vs non-e10s.


== Using try server ==
= Hacking on Talos Itself =


If you have access to generate try builds you can also have performance tests run against a custom version of talos. The performance results will be generated on the same machines that generate the talos results for all check-ins on all branches. This involves a few steps:
== Dev Environment ==


* Run create_talos_zip.py from the root of your talos directory and upload the file somewhere that the build system can find it (e.g. http://people.mozilla.org/~wlachance/talos.zip)
Prerequisites:
* Check out a copy of Mozilla central
* Modify the file "testing/talos/talos.json" to point to the copy of talos you uploaded earlier
* [https://wiki.mozilla.org/ReleaseEngineering/TryServer#How_to_push_to_try Push] this change to try server using the right syntax (you can use TryChooser to help with this: recommended is to test talos thoroughly, but standard unit tests can be skipped)


A bit more information can be found in this blog post from armenzg: http://armenzg.blogspot.com/2011/12/taloszip-talosjson-and-you.html
Local clone of mozilla-central and a successful [https://developer.mozilla.org/en-US/docs/Simple_Firefox_build mozilla-central Firefox build] completed.


== Running locally - Source Code ==
On Linux, setuptools installed:


'''http://hg.mozilla.org/build/talos/archive/tip.tar.gz may be installed in the usual manner for a python package (easy_install, etc).  However, `pip` on windows fails due to the pywin32 dependency.  See {{bug|787496}}'''
    apt-get install python-setuptools


For the majority of the tests, we include test files and tools out of the box.  We need to do these things:
Not required on Windows. For other operating systems see [https://pypi.python.org/pypi/setuptools Setuptools].
   
On Linux, virtualenv installed:


* '''clone talos:'''
    pip install virtualenv
hg clone http://hg.mozilla.org/build/talos


* '''run the [http://hg.mozilla.org/build/talos/file/tip/INSTALL.py install script]''' which
Not required on Windows. For other operating systems see [http://www.virtualenv.org/en/latest/virtualenv.html#installation Virtualenv].
cd talos
python INSTALL.py
# (Ignore errors like "fatal error: 'yaml.h' file not found. To get rid of this error message you can download and install PyYAML from http://pyyaml.org/wiki/PyYAML but it is not necessary.


** creates a [https://developer.mozilla.org/en/Python/Virtualenv Virtualenv] in the same directory as 'INSTALL.py'
Setup talos (linux):
** installs the talos [https://developer.mozilla.org/en/Python#Python_packaging python package] into the virtualenv, including its [https://wiki.mozilla.org/Auto-tools/Projects/MozBase MozBase dependencies] via 'python setup.py develop'
** ''(alternatively, you can perform these steps yourself)''
* '''activate the virtualenv:'''
''(on windows):''
Scripts\activate.bat


''(on osx/linux)'':
    cd mozilla-central/testing/talos
. bin/activate
    virtualenv .
    . bin/activate
    python setup.py develop


* unpack a copy of firefox somewhere (for this example, we'll use `which firefox` as if firefox was on your path)
Setup talos (Windows with mozilla-build):
* '''setup a webserver''' if you're not using the '--develop' flag (WE STRONGLY RECOMMEND USING THE --develop FLAG)
** setup apache or similar webserver to have http://localhost -> the talos subdirectory of the talos checkout
** alternatively you can use the --develop flag to PerfConfigurator which configures to use a python webserver, [https://github.com/mozilla/mozbase/tree/master/mozhttpd mozhttpd], as shown below


* '''run tests:'''
    cd mozilla-central/testing/talos
  talos -n -d --develop --executablePath pathtofirefox --activeTests ts --results_url ts.txt --datazilla-url ts.json --output ts_desktop.yml --mozAfterPaint
    python INSTALL.py # only required once or after updating mozilla-build
** --develop indicates to run in develop mode and to set up a webserver for you
    source Scripts/activate  # you can also use '.' (dot) instead of 'source'
** --executablePath tells Talos where the firefox installation we want to run is located
*** we have pathtofirefox as an example, you can use '~/mozilla/objdir/dist/bin/firefox' or whatever the full path is to your firefox executable that will be running the tests.
** --activeTests is a list of tests we want to run separated by ':'.  In this example, we are running the startup test, ts.
** --results_url indicates a HTTP URL to POST results to or a file to append to
** --output is the new config file we want to generate
You can use `talos --help` to get a complete list of options


If you're looking to run remote talos, instructions are at: https://wiki.mozilla.org/Mobile/Fennec/Android#talos
== Testing your Talos Patch Locally ==


We do not include the tp5 or similar pagesets for legal restrictions.
Testing locally involves running some subset of the Talos tests on
desktop and possibly mobile.  Obviously not all permutations of tests
and the ways of running them can be tried, so common sense should be
used as to what is run.  You may also want to run Talos' internal
unittests: http://hg.mozilla.org/build/talos/file/tip/tests


Talos will refuse to run if you have an open browser.
You should tailor your choice of tests to pick those that cover what
you've changed programmatically, but in general you should probably
run at least one startup test and one pageloader test.  A good
baseline might be the 'tresize' and 'tsvgx' test suites.


If you want to load an extension while running Talos, you want a few more command line arguments:
Run the tests from mozilla-central/testing/talos (with the venv activated, as noted above):


  talos -n -d --executablePath=../firefox/firefox --sampleConfig=sample.config --activeTests=ts --extension=mozmill-1.5.2-sb+tb+fx+sm.xpi --addonID=mozmill@mozilla.com --output=my.config
talos --develop --executablePath pathtofirefox --activeTests tart


* --extension is the file of the XPI we want to install in the profile
The '--develop' option indicates to run in develop mode and store the results in local.json + local.out.
* --addonID is the ID of the addon to install


== How Talos is Run in Production ==
The '--executablePath' option tells Talos where the firefox installation we want to run is located (i.e. '~/mozilla/objdir/dist/bin/firefox' or whatever the full path is to your firefox executable that will be running the tests).


* buildbot constructs commands to launch [http://hg.mozilla.org/build/talos/file/tip/talos/PerfConfigurator.py PerfConfigurator] from a config file: http://hg.mozilla.org/build/buildbot-configs/raw-file/tip/mozilla-tests/config.py ; there are a number of suites, each of which may contain multiple tests
The '--activeTests' argument provides is a list of tests we want to run (if running multiple tests, separate each test name with ':').


* a slave invokes [http://hg.mozilla.org/build/talos/file/tip/talos/run_tests.py run_tests.py] on the generated [http://www.yaml.org/ YAML] Talos configuration
For a list of complete options:


* Talos will run the tests and measured results which are uploaded to [http://graphs.mozilla.org/ graphserver] (after being suitably averaged per-page for Pageloader tests)
    talos --help
** (Talos also uploads raw results to [https://github.com/mozilla/datazilla datazilla])


* the graphserver performs averaging across the pageset (for Pageloader tests) or across cycles (for Startup tests) and returns a number via HTTP to Talos which is then printed to the log
== Testing your Talos Patch on Try Server ==


* [https://tbpl.mozilla.org/ TBPL] receives the name of the suite from buildbot.  These are correlated to TBPL letters via http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/file/tip/js/Config.js . The computed results from graphserver are scraped from the log and displayed when a TBPL suite letter is clicked on in the lower right corner
Just push your talos patch to the try server. See [https://wiki.mozilla.org/Buildbot/Talos/Running#Try_Server the Try Server section] above.

Latest revision as of 13:02, 6 August 2019

Running Talos Tests

Locally

Prerequisite: Firefox has already been built successfully locally.

Mach is used to run the Talos tests locally. You can run suites of tests or individual tests on their own.

For example, to run the 'chromez' test suite:

   ./mach talos-test --suite chromez

To run a single test (the 'tart' test):

   ./mach talos-test --activeTests tart

To run two single tests, use the ':' to separate the test list:

   ./mach talos-test --activeTests tart:damp

Certain talos suites/tests require external pagesets to be downloaded. If pagesets are required, they will be downloaded and extracted automatically when running talos via mach. To disable this automatic pageset downloading, add the 'no-download' argument:

   ./mach talos-test --suite g1 --no-download

To see a list of available talos suites:

   ./mach talos-test --print-suites

To see a list of available talos tests:

   ./mach talos-test --print-tests

Further help running talos via mach:

   ./mach talos-test --help

Tip: Clear the operating system cache between runs, in order to significantly improve the consistency of the results. For example, on linux:

    find . | xargs touch

Try Server

To run talos tests on the try server, you just simply push to try as normal, specifying that you want to run Talos tests. It is highly recommended that you use trychooser to build your try server syntax (helpful hint for using trychooser: in the list of talos suites available you can hover over any one of the suites, and a list of tests included in that suite will be displayed).

To run all of the talos tests as part of your try push, just add "-t all" to the end of your try syntax. To run a single talos suite as part of your try push, just add "-t <name of suite>" to your try syntax (i.e. "-t g1").

To turn on profiling as part of your talos tests on try, add "mozharness: --spsProfile" to the end of the try syntax (i.e. "-t g1 mozharness: --spsProfile"). There is an option to do this in trychooser.

When viewing your talos try server results on Treeherder, look for the group names 'T' and 'T-e10s'. Click on the green symbol corresponding to the talos suite name, and then click on the 'Performance' tab below to see the test results.

If you're curious about the hardware we use, here is a description of the specs. You can also refer to the test reference platforms documentation.

Are my Talos Results OK?

The best way to answer this question is to push to try server and compare the performance of your push against a baseline, using Perfherder (it is recommended hitting retrigger a few times to get at least 5 data points for each test). After pushing to try with talos tests enabled, you will receive an email with a link to Perfherder where you can compare your results. Be aware of the options: e.g. pgo vs non-pgo or e10s vs non-e10s.

Hacking on Talos Itself

Dev Environment

Prerequisites:

Local clone of mozilla-central and a successful mozilla-central Firefox build completed.

On Linux, setuptools installed:

    apt-get install python-setuptools

Not required on Windows. For other operating systems see Setuptools.

On Linux, virtualenv installed:

    pip install virtualenv

Not required on Windows. For other operating systems see Virtualenv.

Setup talos (linux):

    cd mozilla-central/testing/talos
    virtualenv .
    . bin/activate
    python setup.py develop

Setup talos (Windows with mozilla-build):

    cd mozilla-central/testing/talos
    python INSTALL.py  # only required once or after updating mozilla-build
    source Scripts/activate  # you can also use '.' (dot) instead of 'source'

Testing your Talos Patch Locally

Testing locally involves running some subset of the Talos tests on desktop and possibly mobile. Obviously not all permutations of tests and the ways of running them can be tried, so common sense should be used as to what is run. You may also want to run Talos' internal unittests: http://hg.mozilla.org/build/talos/file/tip/tests

You should tailor your choice of tests to pick those that cover what you've changed programmatically, but in general you should probably run at least one startup test and one pageloader test. A good baseline might be the 'tresize' and 'tsvgx' test suites.

Run the tests from mozilla-central/testing/talos (with the venv activated, as noted above):

talos --develop --executablePath pathtofirefox --activeTests tart

The '--develop' option indicates to run in develop mode and store the results in local.json + local.out.

The '--executablePath' option tells Talos where the firefox installation we want to run is located (i.e. '~/mozilla/objdir/dist/bin/firefox' or whatever the full path is to your firefox executable that will be running the tests).

The '--activeTests' argument provides is a list of tests we want to run (if running multiple tests, separate each test name with ':').

For a list of complete options:

    talos --help

Testing your Talos Patch on Try Server

Just push your talos patch to the try server. See the Try Server section above.