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
--- 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,