Bug 1176358 - Log gecko output to stdout and use a different port for each locale when running firefox update tests. r=armenzg
--- a/scripts/firefox_ui_updates.py
+++ b/scripts/firefox_ui_updates.py
@@ -232,31 +232,34 @@ class FirefoxUIUpdates(FirefoxUITests):
@PreScriptAction('run-tests')
def _pre_run_tests(self, action):
if self.releases is None and not (self.installer_url or self.installer_path):
self.critical('You need to call --determine-testing-configuration as well.')
exit(1)
- def _run_test(self, installer_path, update_channel=None, cleanup=True):
+ def _run_test(self, installer_path, update_channel=None, cleanup=True,
+ marionette_port=2828):
'''
All required steps for running the tests against an installer.
'''
env = self.query_env()
dirs = self.query_abs_dirs()
bin_dir = os.path.dirname(self.query_python_path())
fx_ui_tests_bin = os.path.join(bin_dir, 'firefox-ui-update')
gecko_log=os.path.join(dirs['abs_work_dir'], 'gecko.log')
# Build the command
cmd = [
fx_ui_tests_bin,
'--installer', installer_path,
- '--gecko-log=%s' % gecko_log,
+ # Log to stdout until tests are stable.
+ '--gecko-log=-',
+ '--address=localhost:%s' % marionette_port,
]
for arg in self.harness_extra_args:
dest = arg[1]['dest']
if dest in self.config:
cmd += [' '.join(arg[0]), self.config[dest]]
if update_channel:
@@ -303,28 +306,33 @@ class FirefoxUIUpdates(FirefoxUITests):
rel_info['build_id'],
rel_info['from'],
len(rel_info['locales'])
))
if self.config['dry_run']:
continue
+ # Each locale gets a fresh port to avoid address in use errors in case of
+ # tests that time out unexpectedly.
+ marionette_port = 2827
for locale in rel_info['locales']:
# Determine from where to download the file
url = '%s/%s' % (
rel_info['ftp_server_from'],
urllib.quote(rel_info['from'].replace('%locale%', locale))
)
installer_path = self.download_file(
url=url,
parent_dir=dirs['abs_work_dir']
)
- retcode = self._run_test(installer_path, self.channel)
+ marionette_port += 1
+ retcode = self._run_test(installer_path, self.channel,
+ marionette_port=marionette_port)
if retcode != 0:
self.warning('FAIL: firefox-ui-update has failed.' )
self.info('You can run the following command on the same machine to reproduce the issue:')
self.info('python scripts/firefox_ui_updates.py --cfg generic_releng_config.py '
'--cfg update_tests/%s.py --tools-tag %s --installer-url %s '
'--determine-testing-configuration --run-tests '
% (self.firefox_ui_branch, self.tools_tag, url))
self.info('If you want to run this on your development machine:')