зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1298771 - Attach last-update.log to update results for Firefox UI update tests r=maja_zf
MozReview-Commit-ID: DtNwBbPuHPy --HG-- extra : rebase_source : 4d9a232932d0bf2d327bc828407e362c72c6d2b7
This commit is contained in:
Родитель
6ad1df1763
Коммит
f638861410
|
@ -2,6 +2,7 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import os
|
||||
import pprint
|
||||
from datetime import datetime
|
||||
|
||||
|
@ -114,10 +115,12 @@ class UpdateTestCase(FirefoxTestCase):
|
|||
try:
|
||||
self.browser.tabbar.close_all_tabs([self.browser.tabbar.selected_tab])
|
||||
|
||||
# Add content of the update log file for detailed failures when applying an update
|
||||
self.updates[self.current_update_index]['update_log'] = self.read_update_log()
|
||||
|
||||
# Print results for now until we have treeherder integration
|
||||
output = pprint.pformat(self.updates)
|
||||
self.logger.info('Update test results: \n{}'.format(output))
|
||||
|
||||
finally:
|
||||
super(UpdateTestCase, self).tearDown()
|
||||
|
||||
|
@ -355,11 +358,25 @@ class UpdateTestCase(FirefoxTestCase):
|
|||
# Restart Firefox to apply the update
|
||||
self.restart()
|
||||
|
||||
def read_update_log(self):
|
||||
"""Read the content of the update log file for the last update attempt."""
|
||||
path = os.path.join(os.path.dirname(self.software_update.staging_directory),
|
||||
'last-update.log')
|
||||
try:
|
||||
with open(path, 'rb') as f:
|
||||
return f.read().splitlines()
|
||||
except IOError as exc:
|
||||
self.logger.warning(str(exc))
|
||||
return None
|
||||
|
||||
def remove_downloaded_update(self):
|
||||
"""Remove an already downloaded update from the update staging directory."""
|
||||
self.logger.info('Clean-up update staging directory: {}'.format(
|
||||
self.software_update.staging_directory))
|
||||
mozfile.remove(self.software_update.staging_directory)
|
||||
"""Remove an already downloaded update from the update staging directory.
|
||||
|
||||
Hereby not only remove the update subdir but everything below 'updates'.
|
||||
"""
|
||||
path = os.path.dirname(self.software_update.staging_directory)
|
||||
self.logger.info('Clean-up update staging directory: {}'.format(path))
|
||||
mozfile.remove(path)
|
||||
|
||||
def restore_config_files(self):
|
||||
# Reset channel-prefs.js file if modified
|
||||
|
|
Загрузка…
Ссылка в новой задаче