summaryrefslogtreecommitdiffstats
path: root/testing/chromoting/browser_tests_launcher.py
diff options
context:
space:
mode:
authoranandc <anandc@chromium.org>2015-03-23 16:49:46 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-23 23:50:59 +0000
commite4c54fe6041397016df320b61efe0ae34122c894 (patch)
tree7ad6f1591e3549055c17c3a18006286cc7cdee0c /testing/chromoting/browser_tests_launcher.py
parent494ac721bd269f17cd56451e66eb7c9d2fd338c2 (diff)
downloadchromium_src-e4c54fe6041397016df320b61efe0ae34122c894.zip
chromium_src-e4c54fe6041397016df320b61efe0ae34122c894.tar.gz
chromium_src-e4c54fe6041397016df320b61efe0ae34122c894.tar.bz2
Include host-logs in browser-test results even if all tests pass.
This should help with diff-ing the contents of the host-logs when tests fail. BUG= Review URL: https://codereview.chromium.org/1016273004 Cr-Commit-Position: refs/heads/master@{#321901}
Diffstat (limited to 'testing/chromoting/browser_tests_launcher.py')
-rw-r--r--testing/chromoting/browser_tests_launcher.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/testing/chromoting/browser_tests_launcher.py b/testing/chromoting/browser_tests_launcher.py
index a265f56..ee1fe38 100644
--- a/testing/chromoting/browser_tests_launcher.py
+++ b/testing/chromoting/browser_tests_launcher.py
@@ -164,16 +164,18 @@ def main():
line = line.replace(PROD_DIR_ID, args.prod_dir)
LaunchBTCommand(line)
+ # All tests completed. Include host-logs in the test results.
+ host_log_contents = ''
+ # There should be only 1 log file, as we delete logs on test completion.
+ # Loop through matching files, just in case there are more.
+ for log_file in glob.glob('/tmp/chrome_remote_desktop_*'):
+ with open(log_file, 'r') as log:
+ host_log_contents += '\nHOST LOG %s\n CONTENTS:\n%s' % (
+ log_file, log.read())
+ print host_log_contents
+
# Was there any test failure?
if TEST_FAILURE:
- # Obtain contents of Chromoting host logs.
- log_contents = ''
- # There should be only 1 log file, as we delete logs on test completion.
- # Loop through matching files, just in case there are more.
- for log_file in glob.glob('/tmp/chrome_remote_desktop_*'):
- with open(log_file, 'r') as log:
- log_contents += '\nHOST LOG %s\n CONTENTS:\n%s' % (log_file, log.read())
- print log_contents
raise Exception('At least one test failed.')
# Now, stop host, and cleanup user-profile-dir