Buildbot/Talos/Running: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
m (os cache clearing tip added)
Line 109: Line 109:
** --output is the new config file we want to generate
** --output is the new config file we want to generate
You can use `talos --help` to get a complete list of options
You can use `talos --help` to get a complete list of options
'''Tip: Run ''find . | xargs touch'' to clear operating system caches between talos runs. This significantly improves the consistency of the results.'''


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

Revision as of 19:54, 17 April 2014

Running Talos Tests

Using mach

First, make sure that firefox is already compiled. Then, execute the mach command in the top source directory. Let’s try running the chromez test suite. The list of valid suites are in the talos.json file.

   ./mach talos-test chromez

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 next logical step is to run the tests on Try server (try: -b o -p all -u none -t all).

Testing 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:

 # refer to running locally for more details
 talos -n -d -a ts:tsvg -e `which firefox` --develop --datazilla-url output.json --mozAfterPaint

Testing on Try Server

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):

  • 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
  • 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

try: -b o -p android -u none -t all

)

  • 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.

Are my numbers ok

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 [graph server]. I recommend using tbpl to open the link to the graphs.

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.

Using try server

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:

  • 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)
  • Check out a copy of Mozilla central
  • Modify the file "testing/talos/talos.json" to point to the copy of talos you uploaded earlier
  • 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

Running locally - Source Code

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

  • Note: you must first have setuptools installed on your system
* apt-get install python-setuptools # linux
* https://pypi.python.org/pypi/setuptools # download and install for all operating systems
  • you also need virtualenv installed on your system
* pip install virtualenv # http://www.virtualenv.org/en/latest/virtualenv.html#installation

For the majority of the tests, we include test files and tools out of the box. We need to do these things:

  • clone talos:
hg clone http://hg.mozilla.org/build/talos
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 Virtualenv in the same directory as 'INSTALL.py'
    • installs the talos python package into the virtualenv, including its 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):

. bin/activate
  • unpack a copy of firefox somewhere (for this example, we'll use `which firefox` as if firefox was on your path)
  • 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, mozhttpd, as shown below
  • run tests:
talos -n -d --develop --executablePath pathtofirefox --activeTests ts --results_url ts.txt --datazilla-url ts.json --output ts_desktop.yml --mozAfterPaint
    • --develop indicates to run in develop mode and to set up a webserver for you
    • --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

Tip: Run find . | xargs touch to clear operating system caches between talos runs. This significantly improves the consistency of the results.

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

talos --print-tests may be used to display the descriptions and run-time parameters of tests

We do not include the tp5 or similar pagesets for legal restrictions.

Talos will refuse to run if you have an open browser.

If you want to load an extension while running Talos, you want a few more command line arguments:

 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
  • --extension is the file of the XPI we want to install in the profile
  • --addonID is the ID of the addon to install

How Talos is Run in Production

  • (TODO: about mozbase dependencies and create_talos.zip (elsewhere in the wiki? if so, link to from here))
  • Talos will run the tests and measured results which are uploaded to graphserver (after being suitably averaged per-page for Pageloader tests)
    • (Talos also uploads raw results to 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

The Test Machines

All talos test are run on a pool of 2.26 Ghz Intel Core 2 Duo, 2Gb 1067 MHz DDR3 mac minis.

The machines are imaged to comply with the Test Reference Platforms.

Running Tp the Automation Way

In our automation, we run beneath many more restrictions than normal users. One of those restrictions is that our automation machines are walled off from the real-world networks. Because of this, and because we want to test pure page-loading and rendering time of Firefox, we serve the pages from localhost using Apache thus eliminating all network latency and uncertainty. You've probably noticed this if you looked at the talos/page_load_test/tp4.manifest.

To do this, we construct full downloads of sites in our manifest and they are placed on the automation slave at run time. Because we cannot at this time distribute our full page load test set, I'll walk through how these are set up and show you how to make your own. Note that our next version of the page load set will be distributable, so soon this won't be an issue.

In the meantime, here's the instructions:

  1. Use this script or, you use the following wget command to fetch a page and everything it links to in order to have a complete page for offline use:
     $> wget -p -k -H -E -erobots=off --no-check-certificate -U "Mozilla/5.0 (firefox)" --restrict-file-names=windows --restrict-file-names=nocontrol $URL -o outputlog.txt
  2. Once you have a cache of pages, install Apache:
     $> sudo apt-get install apache2
  3. Copy your page into the proper location for Apache to serve it. Note that I like to create a page_load_test directory to separate talos from anything else on the webserver. So with Apache defaults, that's something like:
     $> mkdir /var/www/page_load_test; cp -R <dir> /var/www/page_load_test/.
  4. Now, add the local URL into your manifest:
    http://localhost/page_load_test/<dir>
  5. Run the tp tests as above, pointing the config file at your manifest.