Merge "Don't fail integration tests if browser log couldn't be retrieved"

This commit is contained in:
Zuul 2021-03-22 10:32:39 +00:00 committed by Gerrit Code Review
commit 9ee7099927
1 changed files with 6 additions and 4 deletions

View File

@ -254,10 +254,12 @@ class BaseTestCase(testtools.TestCase):
def _attach_browser_log(self, exc_info=None):
browser_log_path = os.path.join(self._test_report_dir, 'browser.log')
with self.log_exception("Attach browser log"):
with open(browser_log_path, 'w') as f:
f.write(
self._unwrap_browser_log(self.driver.get_log('browser')))
try:
log = self._unwrap_browser_log(self.driver.get_log('browser'))
except Exception:
log = traceback.format_exc()
with open(browser_log_path, 'w') as f:
f.write(log)
def _attach_test_log(self, exc_info=None):
test_log_path = os.path.join(self._test_report_dir, 'test.log')