The aim of the telemetry-tests-client suite is to verify Firefox collects telemetry probes, aggregates that data, and submits telemetry pings containing the data to a HTTP server. The integration tests try to make no assumptions about the internal workings of Firefox and use automation to mimic user behavior.
The integration test suite for Firefox Client Telemetry runs on CI tier 2 with treeherder symbol tt(c)
and is checked in to version control at mozilla-central under toolkit/components/telemetry/tests/marionette/.
It currently features the following two integration tests.
A test that opens and closes a number of browser tabs, restarts the browser in a new session and then verifies the correctness of scalar data in the resulting main ping.
A test that performs a search in a new tab, restarts Firefox in a new session and verifies the correctness of client, session and subsession IDs, as well as scalar and keyed histogram data in the shutdown ping, installs an addon, verifies the environment-change ping, and performs three additional search actions before restarting and verifying the new main ping.
See test_search_counts_across_sessions.py
You can run the tests on your local machine using mach:
./mach telemetry-tests-client
You can run the tests across all platforms on the try server using mach:
./mach try fuzzy -q "'telemetry-tests-client"
The telemetry-tests-client suite is implemented in Python and uses Marionette for browser automation and wptserve for the HTTP ping server. The integration tests are based on Python's unittest testing library and can be disabled by calling self.skipTest("reason") in a test method.
The example below demonstrates how to disable test_main_ping2
:
import unittest from telemetry_harness.testcase import TelemetryTestCase class TestMainPingExample(TelemetryTestCase): """Example tests for the telemetry main ping.""" def test_main_ping1(self): """Example test that we want to run.""" self.search_in_new_tab("mozilla firefox") def test_main_ping2(self): """Example test that we want to skip.""" self.skipTest("demonstrating skipping") self.search_in_new_tab("firefox telemetry")
Bugs can be filed under the Toolkit product for the Telemetry component.