Bug 1559975 - convert testing/tps to python3 r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D35328

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Edwin Gao 2019-07-02 18:04:40 +00:00
Родитель 1fd0b4e594
Коммит 6b9a6ec54c
5 изменённых файлов: 17 добавлений и 18 удалений

Просмотреть файл

@ -64,7 +64,7 @@ def setup_virtualenv(target, python_bin=None):
script_path = os.path.join(here, 'virtualenv-%s' % VERSION_VIRTUALENV,
'virtualenv.py')
print 'Downloading virtualenv %s' % VERSION_VIRTUALENV
print('Downloading virtualenv {}'.format(VERSION_VIRTUALENV))
zip_path = download(URL_VIRTUALENV + VERSION_VIRTUALENV,
os.path.join(here, 'virtualenv.zip'))
@ -72,7 +72,7 @@ def setup_virtualenv(target, python_bin=None):
with zipfile.ZipFile(zip_path, 'r') as f:
f.extractall(here)
print 'Creating new virtual environment'
print('Creating new virtual environment')
cmd_args = [sys.executable, script_path, target]
if python_bin:
@ -187,13 +187,13 @@ def main():
'__SYNC_ACCOUNT_PASSPHRASE__': options.sync_passphrase})
if not (options.username and options.password):
print '\nFirefox Account credentials not specified.'
print('\nFirefox Account credentials not specified.')
if not (options.sync_username and options.sync_password and options.passphrase):
print '\nFirefox Sync account credentials not specified.'
print('\nFirefox Sync account credentials not specified.')
# Print the user instructions
print usage_message.format(TARGET=target,
BIN_NAME=bin_name)
print(usage_message.format(TARGET=target,
BIN_NAME=bin_name))
if __name__ == "__main__":

Просмотреть файл

@ -93,7 +93,7 @@ def main():
rlock = RLock()
print 'using result file', options.resultfile
print('using result file', options.resultfile)
extensionDir = config.get('extensiondir')
if not extensionDir or extensionDir == '__EXTENSIONDIR__':

Просмотреть файл

@ -52,11 +52,11 @@ class TPSFirefoxRunner(object):
os.remove(pathToBuild)
# download the build
print 'downloading build'
print('downloading build')
self.download_url(self.url, pathToBuild)
# install the build
print 'installing %s' % pathToBuild
print('installing {}'.format(pathToBuild))
mozfile.remove(self.installdir, True)
binary = mozinstall.install(src=pathToBuild, dest=self.installdir)

Просмотреть файл

@ -152,7 +152,7 @@ class TPSTestRunner(object):
f.write(msg)
f.close()
if printToConsole:
print msg
print(msg)
def writeToResultFile(self, postdata, body=None,
sendTo=['crossweave@mozilla.com']):
@ -266,7 +266,7 @@ class TPSTestRunner(object):
break
for profilename in profiles:
print "### Cleanup Profile ", profilename
print("### Cleanup Profile ", profilename)
cleanup_phase = TPSTestPhase(
'cleanup-' + profilename,
profiles[profilename], testname,
@ -340,7 +340,7 @@ class TPSTestRunner(object):
self.log(logstr, True)
for phase in phaselist:
print "\t%s: %s" % (phase.phase, phase.status)
print("\t{}: {}".format(phase.phase, phase.status))
return resultdata
@ -421,9 +421,9 @@ class TPSTestRunner(object):
self.rlock.release()
# dump out a summary of test results
print 'Test Summary\n'
print('Test Summary\n')
for test in self.postdata.get('tests', {}):
print '%s | %s | %s' % (test['state'], test['name'], test['message'])
print('{} | {} | {}'.format(test['state'], test['name'], test['message']))
def run_test_group(self):
self.results = []
@ -446,7 +446,7 @@ class TPSTestRunner(object):
for (filename, meta) in testfiles['tests'].items():
skip_reason = meta.get("disabled")
if skip_reason:
print 'Skipping test %s - %s' % (filename, skip_reason)
print('Skipping test {} - {}'.format(filename, skip_reason))
else:
testlist.append(filename)
except ValueError:
@ -474,8 +474,8 @@ class TPSTestRunner(object):
else:
self.numfailed += 1
if self.stop_on_error:
print '\nTest failed with --stop-on-error specified; ' \
'not running any more tests.\n'
print('\nTest failed with --stop-on-error specified; '
'not running any more tests.\n')
break
self.mozhttpd.stop()

Просмотреть файл

@ -23,7 +23,6 @@ py3:
- testing/mochitest
- testing/mozharness
- testing/tools/iceserver
- testing/tps
- testing/web-platform
- toolkit
- tools/jprof