Bug 1509256 - Clarify where to add preferences for geckodriver and Marionette. r=ato
authorHenrik Skupin <mail@hskupin.info>
Tue, 27 Nov 2018 20:12:04 +0000
changeset 505030 50ff40cd5813e399775dfe026353a9407fd0c053
parent 505029 162db3b0344a7342e41f1ad67946e92ac9cafc2a
child 505031 0ed1cec73c666a422436ed04879fb8b5229fb9ca
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1509256
milestone65.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 1509256 - Clarify where to add preferences for geckodriver and Marionette. r=ato It should be made clear that only those preferences should be added to marionette.js which have an immediate effect. All others which eg. require a restart, or have to be set before the application starts the first time, must be added to the appropriate client's profile generation code. Differential Revision: https://phabricator.services.mozilla.com/D13059
testing/geckodriver/src/prefs.rs
testing/marionette/client/marionette_driver/geckoinstance.py
testing/marionette/components/marionette.js
--- a/testing/geckodriver/src/prefs.rs
+++ b/testing/geckodriver/src/prefs.rs
@@ -1,17 +1,22 @@
 use mozprofile::preferences::Pref;
 
 // ALL CHANGES TO THIS FILE MUST HAVE REVIEW FROM A GECKODRIVER PEER!
 //
-// geckodriver is used out-of-tree with release channel builds of Firefox.
+// All preferences in this file are not immediately effective, and
+// require a restart of Firefox, or have to be set in the profile before
+// Firefox gets started the first time. If a preference has to be added,
+// which is immediately effective, it needs to be done in Marionette
+// (marionette.js).
+//
+// Note: geckodriver is used out-of-tree with various builds of Firefox.
 // Removing a preference from this file will cause regressions,
 // so please be careful and get review from a Testing :: geckodriver peer
 // before you make any changes to this file.
-
 lazy_static! {
     pub static ref DEFAULT: Vec<(&'static str, Pref)> = vec![
         // Make sure Shield doesn't hit the network.
         ("app.normandy.api_url", Pref::new("")),
 
         // Disable Firefox old build background check
         ("app.update.checkInstallTime", Pref::new(false)),
 
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -1,12 +1,19 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/
 
+# ALL CHANGES TO THIS FILE MUST HAVE REVIEW FROM A MARIONETTE PEER!
+#
+# The Marionette Python client is used out-of-tree with various builds of
+# Firefox. Removing a preference from this file will cause regressions,
+# so please be careful and get review from a Testing :: Marionette peer
+# before you make any changes to this file.
+
 from __future__ import absolute_import
 
 import os
 import sys
 import tempfile
 import time
 import traceback
 
@@ -16,24 +23,16 @@ import mozversion
 
 from mozprofile import Profile
 from mozrunner import Runner, FennecEmulatorRunner
 from six import reraise
 
 from . import errors
 
 
-# ALL CHANGES TO THIS FILE MUST HAVE REVIEW FROM A MARIONETTE PEER!
-#
-# The Marionette Python client is used out-of-tree with release
-# channel builds of Firefox.  Removing a preference from this file
-# will cause regressions, so please be careful and get review from
-# a Testing :: Marionette peer before you make any changes to this file.
-
-
 class GeckoInstance(object):
     required_prefs = {
         # Make sure Shield doesn't hit the network.
         "app.normandy.api_url": "",
 
         # Increase the APZ content response timeout in tests to 1 minute.
         # This is to accommodate the fact that test environments tends to be slower
         # than production environments (with the b2g emulator being the slowest of them
--- a/testing/marionette/components/marionette.js
+++ b/testing/marionette/components/marionette.js
@@ -41,21 +41,29 @@ const PREF_ENABLED = "marionette.enabled
 // a different profile in order to test things like Firefox refresh.
 // The environment variable itself, if present, is interpreted as a
 // JSON structure, with the keys mapping to preference names in the
 // "marionette." branch, and the values to the values of those prefs. So
 // something like {"port": 4444} would result in the marionette.port
 // pref being set to 4444.
 const ENV_PRESERVE_PREFS = "MOZ_MARIONETTE_PREF_STATE_ACROSS_RESTARTS";
 
+// ALL CHANGES TO THIS LIST MUST HAVE REVIEW FROM A MARIONETTE PEER!
+//
 // Marionette sets preferences recommended for automation when it starts,
 // unless marionette.prefs.recommended has been set to false.
-// Where noted, some prefs should also be set in the profile passed to
-// Marionette to prevent them from affecting startup, since some of these
-// are checked before Marionette initialises.
+//
+// All prefs as added here have immediate effect, and don't require a restart
+// nor have to be set in the profile before the application starts. If such a
+// latter preference has to be added, it needs to be done for the client like
+// Marionette client (geckoinstance.py), or geckodriver (prefs.rs).
+//
+// Note: Clients do not always use the latest version of the application. As
+// such backward compatibility has to be ensured at least for the last three
+// releases.
 const RECOMMENDED_PREFS = new Map([
 
   // Make sure Shield doesn't hit the network.
   ["app.normandy.api_url", ""],
 
   // Disable automatically upgrading Firefox.
   //
   // This should also be set in the profile prior to starting Firefox,