Bug 1334925 - Driveby update firefox_media_test scripts to use format() interpolation. r?maja_zf draft
authorBryce Van Dyk <bvandyk@mozilla.com>
Fri, 27 Jan 2017 04:46:55 +1300
changeset 467957 64f89244b01912647153e9d4b6fc4390dbd30b92
parent 466286 24d9eb148461bb4789848b9880867c63c783a2ca
child 467958 d5e233f4837973c099575a8e80420ef3e343b48d
push id43317
push userbvandyk@mozilla.com
push dateMon, 30 Jan 2017 13:37:50 +0000
reviewersmaja_zf
bugs1334925
milestone54.0a1
Bug 1334925 - Driveby update firefox_media_test scripts to use format() interpolation. r?maja_zf Change instances of old style python string interpolation in media test files to the newer, format() style. format() appears to be the more common style in the harness code, and this makes the media test code more consistent in that regard. MozReview-Commit-ID: JX59EB2EjXH
testing/mozharness/configs/mediatests/buildbot_posix_config.py
testing/mozharness/configs/mediatests/buildbot_windows_config.py
testing/mozharness/configs/mediatests/jenkins_config.py
testing/mozharness/configs/mediatests/taskcluster_posix_config.py
testing/mozharness/configs/mediatests/taskcluster_windows_config.py
testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
--- a/testing/mozharness/configs/mediatests/buildbot_posix_config.py
+++ b/testing/mozharness/configs/mediatests/buildbot_posix_config.py
@@ -38,13 +38,13 @@ config = {
     "download_symbols": "ondemand",
 
     "suite_definitions": {
         "media-tests": {
             "options": [],
         },
         "media-youtube-tests": {
             "options": [
-                "%(test_manifest)s"
+                "{test_manifest}"
             ],
         },
     },
 }
--- a/testing/mozharness/configs/mediatests/buildbot_windows_config.py
+++ b/testing/mozharness/configs/mediatests/buildbot_windows_config.py
@@ -9,18 +9,18 @@ external_tools_path = os.path.join(
 
 config = {
     "virtualenv_python_dll": 'c:/mozilla-build/python27/python27.dll',
     "virtualenv_path": 'venv',
     "exes": {
         'python': 'c:/mozilla-build/python27/python',
         'virtualenv': ['c:/mozilla-build/python27/python', 'c:/mozilla-build/buildbotve/virtualenv.py'],
         'hg': 'c:/mozilla-build/hg/hg',
-        'mozinstall': ['%s/build/venv/scripts/python' % os.getcwd(),
-                       '%s/build/venv/scripts/mozinstall-script.py' % os.getcwd()],
+        'mozinstall': ['{}/build/venv/scripts/python'.format(os.getcwd()),
+                       '{}/build/venv/scripts/mozinstall-script.py'.format(os.getcwd())],
         'tooltool.py': [sys.executable, 'C:/mozilla-build/tooltool.py'],
     },
 
     "find_links": [
         "http://pypi.pvt.build.mozilla.org/pub",
         "http://pypi.pub.build.mozilla.org/pub",
     ],
     "pip_index": False,
@@ -44,13 +44,13 @@ config = {
     "download_symbols": "ondemand",
 
     "suite_definitions": {
         "media-tests": {
             "options": [],
         },
         "media-youtube-tests": {
             "options": [
-                "%(test_manifest)s"
+                "{test_manifest}"
             ],
         },
     },
 }
--- a/testing/mozharness/configs/mediatests/jenkins_config.py
+++ b/testing/mozharness/configs/mediatests/jenkins_config.py
@@ -26,17 +26,17 @@ config = {
     'test_suite': 'media-tests',
 
     'suite_definitions': {
         'media-tests': {
             'options': [],
         },
         'media-youtube-tests': {
             'options': [
-                '%(test_manifest)s'
+                '{test_manifest}'
             ],
         },
     },
 
     'default_actions': [
         'clobber',
         'download-and-extract',
         'create-virtualenv',
--- a/testing/mozharness/configs/mediatests/taskcluster_posix_config.py
+++ b/testing/mozharness/configs/mediatests/taskcluster_posix_config.py
@@ -35,13 +35,13 @@ config = {
     ],
 
     "suite_definitions": {
         "media-tests": {
             "options": [],
         },
         "media-youtube-tests": {
             "options": [
-                "%(test_manifest)s"
+                "{test_manifest}"
             ],
         },
     },
 }
--- a/testing/mozharness/configs/mediatests/taskcluster_windows_config.py
+++ b/testing/mozharness/configs/mediatests/taskcluster_windows_config.py
@@ -38,13 +38,13 @@ config = {
     ],
 
     "suite_definitions": {
         "media-tests": {
             "options": [],
         },
         "media-youtube-tests": {
             "options": [
-                "%(test_manifest)s"
+                "{test_manifest}"
             ],
         },
     },
 }
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
@@ -219,28 +219,28 @@ class FirefoxMediaTestsBase(TestingMixin
             cmd.append('--disable-e10s')
         if self.browsermob_script:
             cmd += ['--browsermob-script', self.browsermob_script]
         if self.browsermob_port:
             cmd += ['--browsermob-port', self.browsermob_port]
 
         test_suite = self.config.get('test_suite')
         if test_suite not in self.config["suite_definitions"]:
-            self.fatal("%s is not defined in the config!" % test_suite)
+            self.fatal("{} is not defined in the config!".format(test_suite))
 
         test_manifest = None if test_suite != 'media-youtube-tests' else \
             os.path.join(dirs['external-media-tests'],
                          'external_media_tests',
                          'playback', 'youtube', 'manifest.ini')
         config_fmt_args = {
             'test_manifest': test_manifest,
         }
 
         for s in self.config["suite_definitions"][test_suite]["options"]:
-            cmd.append(s % config_fmt_args)
+            cmd.append(s.format(**config_fmt_args))
 
         return cmd
 
     def query_minidump_stackwalk(self):
         """We don't have an extracted test package available to get the manifest file.
 
         So we have to explicitely download the latest version of the manifest from the
         mozilla-central repository and feed it into the query_minidump_stackwalk() method.
@@ -255,17 +255,17 @@ class FirefoxMediaTestsBase(TestingMixin
             url_base = 'https://hg.mozilla.org/mozilla-central/raw-file/default/testing/'
 
             dirs = self.query_abs_dirs()
             manifest_path = os.path.join(dirs['abs_work_dir'], 'releng.manifest')
             try:
                 self.download_file(urlparse.urljoin(url_base, tooltool_manifest),
                                    manifest_path)
             except Exception as e:
-                self.fatal('Download of tooltool manifest file failed: %s' % e.message)
+                self.fatal('Download of tooltool manifest file failed: {}'.format(e.message))
 
         return super(FirefoxMediaTestsBase, self).query_minidump_stackwalk(manifest=manifest_path)
 
     def run_media_tests(self):
         cmd = self._query_cmd()
         self.job_result_parser = JobResultParser(
             config=self.config,
             log_obj=self.log_obj,