Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1702)

Unified Diff: telemetry/telemetry/testing/browser_test_case.py

Issue 2074183002: [telemetry] Try to print browser logs and capture a screenshot upon story failure (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: Add DumpStateUponFailure to _FakeBrowser Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « telemetry/telemetry/story/shared_state.py ('k') | telemetry/telemetry/testing/fakes/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/testing/browser_test_case.py
diff --git a/telemetry/telemetry/testing/browser_test_case.py b/telemetry/telemetry/testing/browser_test_case.py
index 710904b07ef7c31110f1ba308c35888d7561272c..eb728804004036b1cb50a5dad0cf3eb3ce62e6d6 100644
--- a/telemetry/telemetry/testing/browser_test_case.py
+++ b/telemetry/telemetry/testing/browser_test_case.py
@@ -42,23 +42,14 @@ class _MetaBrowserTestCase(type):
except Exception:
exc_info = sys.exc_info()
- logging.info('*************** BROWSER STANDARD OUTPUT ***************')
- try: # pylint: disable=broad-except
- logging.info(self._browser.GetStandardOutput())
- except Exception:
- logging.exception('Failed to get browser standard output:')
- logging.info('*********** END OF BROWSER STANDARD OUTPUT ************')
-
- logging.info('********************* BROWSER LOG *********************')
- try: # pylint: disable=broad-except
- logging.info(self._browser.GetLogFileContents())
- except Exception:
- logging.exception('Failed to get browser log:')
- logging.info('***************** END OF BROWSER LOG ******************')
+ if self._browser:
+ self._browser.DumpStateUponFailure()
+ else:
+ logging.warning('Cannot dump browser state: No browser.')
# Re-raise the original exception. Note that we can't just use 'raise'
# without any arguments because an exception might have been thrown when
- # the browser standard output was retrieved.
+ # dumping the state of the browser.
raise exc_info[0], exc_info[1], exc_info[2]
return WrappedMethod
« no previous file with comments | « telemetry/telemetry/story/shared_state.py ('k') | telemetry/telemetry/testing/fakes/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698