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

Unified Diff: tools/testing/run_selenium.py

Issue 11826023: Print exception information in run_selenium.py. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/run_selenium.py
diff --git a/tools/testing/run_selenium.py b/tools/testing/run_selenium.py
index 8cb0a2f9c7608b4008fed123f4c3e34cc2512c40..2ce71dbcc723618b56d593a968914c6cc6fcf778 100755
--- a/tools/testing/run_selenium.py
+++ b/tools/testing/run_selenium.py
@@ -285,45 +285,53 @@ def run_batch_tests():
signal.signal(signal.SIGTERM, lambda number, frame: close_browser(browser))
try:
- while True:
- line = sys.stdin.readline()
- if line == '--terminate\n':
- print("Terminating selenium driver")
- break
-
- (html_out, browser_name, executable_path,
- timeout, mode, refresh) = parse_args(line.split())
-
- # Sanity checks that test.dart is passing flags we can handle.
- if mode != 'correctness':
- print 'Batch test runner not compatible with perf testing'
- return 1
- if browser and current_browser_name != browser_name:
- print('Batch test runner got multiple browsers: %s and %s'
- % (current_browser_name, browser_name))
- return 1
-
- # Start the browser on the first run
- if browser is None:
- current_browser_name = browser_name
- browser = start_browser(browser_name, executable_path, html_out)
-
- source = run_test_in_browser(browser, html_out, timeout, mode, refresh)
-
- # Test is done. Write end token to stderr and flush.
- sys.stderr.write('>>> EOF STDERR\n')
- sys.stderr.flush()
-
- # print one of:
- # >>> TEST {PASS, FAIL, OK, CRASH, FAIL, TIMEOUT}
- status = report_results(mode, source, browser)
- if status == 0:
- print '>>> TEST PASS'
- elif source == TIMEOUT_ERROR_MSG:
- print '>>> TEST TIMEOUT'
- else:
- print '>>> TEST FAIL'
- sys.stdout.flush()
+ try:
+ while True:
+ line = sys.stdin.readline()
+ if line == '--terminate\n':
+ print("Terminating selenium driver")
+ break
+
+ (html_out, browser_name, executable_path,
+ timeout, mode, refresh) = parse_args(line.split())
+
+ # Sanity checks that test.dart is passing flags we can handle.
+ if mode != 'correctness':
+ print 'Batch test runner not compatible with perf testing'
+ return 1
+ if browser and current_browser_name != browser_name:
+ print('Batch test runner got multiple browsers: %s and %s'
+ % (current_browser_name, browser_name))
+ return 1
+
+ # Start the browser on the first run
+ if browser is None:
+ current_browser_name = browser_name
+ browser = start_browser(browser_name, executable_path, html_out)
+
+ source = run_test_in_browser(browser, html_out, timeout, mode, refresh)
+
+ # Test is done. Write end token to stderr and flush.
+ sys.stderr.write('>>> EOF STDERR\n')
+ sys.stderr.flush()
+
+ # print one of:
+ # >>> TEST {PASS, FAIL, OK, CRASH, FAIL, TIMEOUT}
+ status = report_results(mode, source, browser)
+ if status == 0:
+ print '>>> TEST PASS'
+ elif source == TIMEOUT_ERROR_MSG:
+ print '>>> TEST TIMEOUT'
+ else:
+ print '>>> TEST FAIL'
+ sys.stdout.flush()
+ except:
+ type, value, traceback = sys.exc_info()
+ print "run_selenium.py: Unexpected exception occured: "
+ print " type: ", type
+ print " value: ", value
+ print " traceback: ", traceback
+ raise
finally:
sys.stdin.close()
print("Closing browser");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698