Adding Talos Tests
Contents
At a glance
Adding a new performance test or modifying an existing test is much easier than most people think. In general, we need to create a patch for Talos by:
- determining if this is a startup or pageloader test
- creating the appropriate folder for your test in testing/talos/talos/tests
- adding all files and resources for the test (make sure there is no external network accesses) to that folder
- file a bug in the Testing::Talos component with your patch
Naming convention
t is pre-pended to the names to represent test
- ts = test startup
- tp = test pageload
- tdhtml = test dhtml
What we need to know about tests
When adding a new test, we really need to understand what we are doing. Here are some questions that you should know the answer to before adding a new test:
- What does this test measure?
- Does this test overlap with any existing test?
- What is the unit of measurement that we are recording?
- What would constitute a regression?
- What is the expected range in the results over time?
- Are there variables or conditions which would affect this test?
- browser preferences, environment variables, etc?
- operating system, system resources, time of day, etc...?
- Indepenedent of observation? Will this test produce the same number regardless of what was run before it?
- What considerations are there for how this test should be run and what tools are required?
Please document your new test along with answers to these questions in the Firefox Source Docs
Pageloader tests
A pageloader test is the most common. Using the pageloader extension allows for most of the reporting and talos integration to be done for you. Here is what you need to do:
- Create a new directory in testing/talos/talos/tests
- Create a manifest file named
<testname>.manifest
file in your directory (example) - Add your tests. For self reporting tests, use [tpRecordTime]
- Add your test definition by adding a new class for your test to testing/talos/talos/test.py (example)
Startup tests
A startup test is designed to load the browser with a single page many times. This is useful for tests which shouldn't have any extensions, can handle all loading and measuring themselves, or require the measurement of the browser startup. Here is what you need to do:
- Create a new directory in testing/talos/talos/startup_test
- Add your tests to the folder, these will be accessed by a raw URL
- the tests need to report
__start_report<value>__end_report
so Talos can find it (example) - If you plan on doing shutdown times, you need to add in
__startTimestamp<value>__endTimestamp
. (example) - Include MozillaFileLogger.js and TalosPowersContent.js in your script (example)
- the tests need to report
- Add your test definition by adding a new class for your test to testing/talos/talos/test.py (example)
- Add an item for
cycles
, we recommend 20 - Add an item for
url
, this is relative to the Talos directory and what Firefox will load - Add
tpmozafterpaint
and set it toTrue
by default, orFalse
if your test does other internal measurements unrelated to rendering a page - Add an item for
filters
(example)
- Add an item for
Adding a test to production
- File a bug to add tests to testing/talos/talos/test.py (see bug 893071 for an example).
- For mozilla-central on desktop only - just land your new test to your in-tree commit (on inbound/autoland) and ensure that you adjust testing/talos/talos.json to run the test
- If you add a new suite, edit taskcluster/ci/test/talos.yml to add the testname to a new suite, then add it to taskcluster/ci/test/test-sets.yml for all the different Talos test-sets.
- If this is an update to an existing test that could change the numbers, this needs to be treated as a new test and run side by side for a week to get a new baseline.
- Document the test in Firefox Source Docs