Bug 1506928 - [raptor] "get()" defaults to None by default if key isn't found. r=davehunt
☠☠ backed out by f478c61c1bc9 ☠ ☠
authorHenrik Skupin <mail@hskupin.info>
Tue, 16 Apr 2019 00:04:44 +0200
changeset 469765 097b31242a5abad203858c7c0f3a2ea96e09ad8c
parent 469764 120d7d8970e5ad9a891adf7ff0516f5aaed67d6c
child 469766 98c7524647ae009fc69e434ef8dddd2c3fb72e81
push id112819
push userhskupin@mozilla.com
push dateWed, 17 Apr 2019 11:09:58 +0000
treeherdermozilla-inbound@98c7524647ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavehunt
bugs1506928
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 1506928 - [raptor] "get()" defaults to None by default if key isn't found. r=davehunt Differential Revision: https://phabricator.services.mozilla.com/D27640
testing/raptor/raptor/raptor.py
--- a/testing/raptor/raptor/raptor.py
+++ b/testing/raptor/raptor/raptor.py
@@ -20,17 +20,17 @@ from mozdevice import ADBDevice
 from mozlog import commandline, get_default_logger
 from mozprofile import create_profile
 from mozproxy import get_playback
 from mozrunner import runners
 
 # need this so raptor imports work both from /raptor and via mach
 here = os.path.abspath(os.path.dirname(__file__))
 paths = [here]
-if os.environ.get('SCRIPTSPATH', None) is not None:
+if os.environ.get('SCRIPTSPATH') is not None:
     # in production it is env SCRIPTS_PATH
     paths.append(os.environ['SCRIPTSPATH'])
 else:
     # locally it's in source tree
     paths.append(os.path.join(here, '..', '..', 'mozharness'))
 
 webext_dir = os.path.join(here, '..', 'webext')
 paths.append(webext_dir)
@@ -141,21 +141,21 @@ class Raptor(object):
             host=self.config['host'],
             b_port=self.benchmark_port,
             debug_mode=1 if self.debug_mode else 0,
             browser_cycle=test.get('browser_cycle', 1),
             )
 
         self.install_raptor_webext()
 
-        if test.get("preferences", None) is not None:
+        if test.get("preferences") is not None:
             self.set_browser_test_prefs(test['preferences'])
 
         # if 'alert_on' was provided in the test INI, add to our config for results/output
-        self.config['subtest_alert_on'] = test.get('alert_on', None)
+        self.config['subtest_alert_on'] = test.get('alert_on')
 
     def run_test_teardown(self):
         self.check_for_crashes()
 
         if self.playback is not None:
             self.playback.stop()
 
         self.remove_raptor_webext()
@@ -372,17 +372,17 @@ class RaptorDesktop(Raptor):
         self.output_handler.proc = proc
 
         # give our control server the browser process so it can shut it down later
         self.control_server.browser_proc = proc
 
     def run_test(self, test, timeout=None):
         self.run_test_setup(test)
 
-        if test.get('playback', None) is not None:
+        if test.get('playback') is not None:
             self.start_playback(test)
 
         if self.config['host'] not in ('localhost', '127.0.0.1'):
             self.delete_proxy_settings_from_profile()
 
         # now start the browser/app under test
         self.launch_desktop_browser(test)
 
@@ -435,17 +435,17 @@ class RaptorDesktopFirefox(RaptorDesktop
             self.disable_non_local_connections()
 
         # if running debug-mode, tell Firefox to open the browser console on startup
         if self.debug_mode:
             self.runner.cmdargs.extend(['-jsconsole'])
 
         self.start_runner_proc()
 
-        if self.config['is_release_build'] and test.get('playback', None) is not None:
+        if self.config['is_release_build'] and test.get('playback') is not None:
             self.enable_non_local_connections()
 
         # if geckoProfile is enabled, initialize it
         if self.config['gecko_profile'] is True:
             self._init_gecko_profiling(test)
             # tell the control server the gecko_profile dir; the control server will
             # receive the actual gecko profiles from the web ext and will write them
             # to disk; then profiles are picked up by gecko_profile.symbolicate
@@ -477,17 +477,17 @@ class RaptorDesktopChrome(RaptorDesktop)
         self.log.info("starting %s" % self.config['app'])
         # some chromium-specfic cmd line opts required
         self.runner.cmdargs.extend(['--use-mock-keychain', '--no-default-browser-check'])
 
         # if running in debug-mode, open the devtools on the raptor test tab
         if self.debug_mode:
             self.runner.cmdargs.extend(['--auto-open-devtools-for-tabs'])
 
-        if test.get('playback', None) is not None:
+        if test.get('playback') is not None:
             self.setup_chrome_desktop_for_playback()
 
         self.start_runner_proc()
 
 
 class RaptorAndroid(Raptor):
     def __init__(self, app, binary, activity=None, **kwargs):
         super(RaptorAndroid, self).__init__(app, binary, **kwargs)
@@ -668,17 +668,17 @@ class RaptorAndroid(Raptor):
             self.log.info("begin browser cycle %d of %d for test %s"
                           % (test['browser_cycle'], test['expected_browser_cycles'], test['name']))
 
             self.run_test_setup(test)
 
             if test['browser_cycle'] == 1:
                 self.create_raptor_sdcard_folder()
 
-                if test.get('playback', None) is not None:
+                if test.get('playback') is not None:
                     self.start_playback(test)
 
                     # an ssl cert db has now been created in the profile; copy it out so we
                     # can use the same cert db in future test cycles / browser restarts
                     local_cert_db_dir = tempfile.mkdtemp()
                     self.log.info("backing up browser ssl cert db that was created via certutil")
                     self.copy_cert_db(self.config['local_profile_dir'], local_cert_db_dir)
 
@@ -698,17 +698,17 @@ class RaptorAndroid(Raptor):
 
                 # get cert db from previous cycle profile and copy into new clean profile
                 # this saves us from having to start playback again / recreate cert db etc.
                 self.log.info("copying existing ssl cert db into new browser profile")
                 self.copy_cert_db(local_cert_db_dir, self.config['local_profile_dir'])
 
                 self.run_test_setup(test)
 
-            if test.get('playback', None) is not None:
+            if test.get('playback') is not None:
                 self.turn_on_android_app_proxy()
 
             self.copy_profile_onto_device()
 
             # now start the browser/app under test
             self.launch_firefox_android_app(test['name'])
 
             # set our control server flag to indicate we are running the browser/app
@@ -730,23 +730,23 @@ class RaptorAndroid(Raptor):
         self.log.info("test %s is running in warm mode; browser will NOT be restarted between "
                       "page cycles" % test['name'])
         if self.config['power_test']:
             init_android_power_test(self)
 
         self.run_test_setup(test)
         self.create_raptor_sdcard_folder()
 
-        if test.get('playback', None) is not None:
+        if test.get('playback') is not None:
             self.start_playback(test)
 
         if self.config['host'] not in ('localhost', '127.0.0.1'):
             self.delete_proxy_settings_from_profile()
 
-        if test.get('playback', None) is not None:
+        if test.get('playback') is not None:
             self.turn_on_android_app_proxy()
 
         self.copy_profile_onto_device()
 
         # now start the browser/app under test
         self.launch_firefox_android_app(test['name'])
 
         # set our control server flag to indicate we are running the browser/app