Bug 1545207 - Mock the Search Service region test in Telemetry Client Tests r=raphael
authorChris H-C <chutten@mozilla.com>
Thu, 18 Apr 2019 16:38:16 +0000
changeset 470132 2f36aca8e78bd627f3a006b2582819489a675ad0
parent 470131 8fb2f7ca9d1dd3cf27cd2ce8dbf4702ed7a94350
child 470133 d15a1a637b666008ecaa68509ea4b3c48b0b164d
push id83541
push userchutten@mozilla.com
push dateFri, 19 Apr 2019 00:00:53 +0000
treeherderautoland@2f36aca8e78b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersraphael
bugs1545207
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1545207 - Mock the Search Service region test in Telemetry Client Tests r=raphael We don't want spurious net connections, so we should mock the result. In addition, we need to mock it to a specific non-North-American region to ensure we don't cause an extra change to browser.search.region which may split the subsession in the middle of our tests. Differential Revision: https://phabricator.services.mozilla.com/D28059
toolkit/components/telemetry/tests/marionette/harness/telemetry_harness/runner.py
--- a/toolkit/components/telemetry/tests/marionette/harness/telemetry_harness/runner.py
+++ b/toolkit/components/telemetry/tests/marionette/harness/telemetry_harness/runner.py
@@ -20,16 +20,20 @@ class TelemetryTestRunner(BaseMarionette
         # Select the appropriate GeckoInstance
         kwargs["app"] = "fxdesktop"
 
         prefs = kwargs.pop("prefs", {})
 
         # Set Firefox Client Telemetry specific preferences
         prefs.update(
             {
+                # Fake the geoip lookup to always return Germany to:
+                #   * avoid net access in tests
+                #   * stabilize browser.search.region to avoid an extra subsession (bug 1545207)
+                "browser.search.geoip.url": "data:application/json,{\"country_code\": \"DE\"}",
                 "toolkit.telemetry.server": "{}/pings".format(SERVER_URL),
                 "toolkit.telemetry.initDelay": 1,
                 "toolkit.telemetry.minSubsessionLength": 0,
                 "datareporting.healthreport.uploadEnabled": True,
                 "datareporting.policy.dataSubmissionEnabled": True,
                 "datareporting.policy.dataSubmissionPolicyBypassNotification": True,
                 "toolkit.telemetry.log.level": "Trace",
                 "toolkit.telemetry.log.dump": True,