telemetry-tests-client 编辑

Overview

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.

TestMainTabScalars

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.

See test_main_tab_scalars.py

TestSearchCounts

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

Running the tests locally

You can run the tests on your local machine using mach:

./mach telemetry-tests-client

Running the tests on try

You can run the tests across all platforms on the try server using mach:

./mach try fuzzy -q "'telemetry-tests-client"

Disabling an individual failing test

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

Who to contact for help

  • the test cases are owned by Chris Hutten-Czapski (chutten on IRC) from the Firefox Telemetry team (#telemetry on IRC)
  • the test harness is owned by Raphael Pierzina (raphael on IRC) from the Firefox Test Engineering team (#fx-test on IRC)

Bugzilla

Bugs can be filed under the Toolkit product for the Telemetry component.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:79 次

字数:4597

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文