Chromium Code Reviews| Index: build/android/buildbot/bb_device_steps.py |
| diff --git a/build/android/buildbot/bb_device_steps.py b/build/android/buildbot/bb_device_steps.py |
| index 64f9e09218144fbd8647ede7574d920fb09b7498..84fd6262f6dbe5ccc407ae9e1865d2190cf21a55 100755 |
| --- a/build/android/buildbot/bb_device_steps.py |
| +++ b/build/android/buildbot/bb_device_steps.py |
| @@ -6,6 +6,7 @@ |
| import collections |
| import glob |
| import hashlib |
| +import json |
| import multiprocessing |
| import os |
| import random |
| @@ -257,7 +258,29 @@ def RunWebkitLayoutTests(options): |
| cmd_args.extend( |
| ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)]) |
| - RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py'] + cmd_args) |
| + exit_code = RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py'] + |
| + cmd_args) |
| + if exit_code == 254: # AKA -1, internal error. |
| + bb_annotations.PrintMsg("?? (crashed or hung)") |
| + else: |
| + full_results_path = os.path.join('..', 'layout-test-results', |
| + 'full_results.json') |
| + if os.path.exists(full_results_path): |
| + full_results = json.load(open(full_results_path)) |
| + unexpected_failures, unexpected_flakes, unexpected_passes = \ |
|
Isaac (away)
2013/10/09 18:27:59
Extend lines using parens, not backslash, per goog
|
| + _ParseLayoutTestResults(full_results) |
| + if unexpected_failures: |
| + _PrintDashboardLink("failed", unexpected_failures, |
| + max_tests=25) |
| + elif unexpected_passes: |
| + _PrintDashboardLink("unexpected passes", unexpected_passes, |
| + max_tests=10) |
| + if unexpected_flakes: |
| + _PrintDashboardLink("unexpected flakes", unexpected_flakes, |
| + max_tests=10) |
| + else: |
| + bb_annotations.PrintMsg("?? (results missing)") |
| + |
| if options.factory_properties.get('archive_webkit_results', False): |
| bb_annotations.PrintNamedStep('archive_webkit_results') |
| @@ -279,6 +302,55 @@ def RunWebkitLayoutTests(options): |
| '--gs-bucket', gs_bucket]) |
| +def _ParseLayoutTestResults(results): |
| + # Cloned from third_party/WebKit/Tools/Scripts/print-json-test-results |
| + tests = _ConvertTrieToFlatPaths(results['tests']) |
| + failures = {} |
| + flakes = {} |
| + passes = {} |
| + for (test, result) in tests.iteritems(): |
| + if result.get('is_unexpected'): |
| + actual_result = result['actual'] |
| + if ' PASS' in actual_result: |
| + flakes[test] = actual_result |
| + elif actual_result == 'PASS': |
| + passes[test] = result |
| + else: |
| + failures[test] = actual_result |
| + |
| + return (passes, failures, flakes) |
| + |
| + |
| +def _ConvertTrieToFlatPaths(trie, prefix=None): |
| + # Cloned from third_party/WebKit/Tools/Scripts/print-json-test-results |
| + result = {} |
| + for name, data in trie.iteritems(): |
| + if prefix: |
| + name = prefix + "/" + name |
| + |
| + if len(data) and not "actual" in data and not "expected" in data: |
| + result.update(_ConvertTrieToFlatPaths(data, name)) |
| + else: |
| + result[name] = data |
| + |
| + return result |
| + |
| + |
| +def _PrintDashboardLink(link_text, tests, max_tests): |
| + if len(tests) > max_tests: |
| + test_list_text = ' '.join(tests[:max_tests]) + ' and more' |
| + else: |
| + test_list_text = ' '.join(tests) |
| + |
| + DASHBOARD_BASE = ("http://test-results.appspot.com" |
| + "/dashboards/flakiness_dashboard.html#" |
| + "master=ChromiumWebkit&tests=") |
| + |
| + bb_annotations.PrintLink('%d %s: %s' % |
| + (len(tests), link_text, test_list_text), |
| + DASHBOARD_BASE + ','.join(tests)) |
| + |
| + |
| def EscapeBuilderName(builder_name): |
| return re.sub('[ ()]', '_', builder_name) |