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

Side by Side Diff: build/android/pylib/gtest/gtest_test_instance.py

Issue 1703863003: Created separate shards for suspicious testcases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import os 6 import os
7 import re 7 import re
8 import tempfile 8 import tempfile
9 9
10 from devil.android import apk_helper 10 from devil.android import apk_helper
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 host_paths.DIR_SOURCE_ROOT, 'build', 'android', 'pylib', 'gtest', 336 host_paths.DIR_SOURCE_ROOT, 'build', 'android', 'pylib', 'gtest',
337 'filter', '%s_disabled' % self._suite) 337 'filter', '%s_disabled' % self._suite)
338 if disabled_tests_file_path and os.path.exists(disabled_tests_file_path): 338 if disabled_tests_file_path and os.path.exists(disabled_tests_file_path):
339 with open(disabled_tests_file_path) as disabled_tests_file: 339 with open(disabled_tests_file_path) as disabled_tests_file:
340 disabled_filter_items += [ 340 disabled_filter_items += [
341 '%s' % l for l in (line.strip() for line in disabled_tests_file) 341 '%s' % l for l in (line.strip() for line in disabled_tests_file)
342 if l and not l.startswith('#')] 342 if l and not l.startswith('#')]
343 343
344 return '*-%s' % ':'.join(disabled_filter_items) 344 return '*-%s' % ':'.join(disabled_filter_items)
345 345
346 def GetCrashedTestCase(self, output):
347 crash_happened = re.search(r'FAILURES!!! Tests run: \d+, Failures: \d+,' \
jbudorick 2016/02/27 00:31:37 all of the regexes in here should compiled into mo
348 ' Errors: 1', output[-1])
349 if not crash_happened:
350 return
351
352 #Crashes that will cause output like DCHECK(false).
jbudorick 2016/02/27 00:31:37 nit: # Crashes ...
353 has_crash = re.search(r'\[ERROR:.*?\] Currently running: ', output[-3])
jbudorick 2016/02/27 00:31:37 magical -3
354 if has_crash:
355 return output[-3][len(has_crash.group(0)):]
356
357 # Crashes that will cause output like null pointer dereference.
358 index = output.index('[ CRASHED ]')
359 if not index == -1:
360 run_info = re.search(r'(?<=\[ RUN \] ).*', output[index-1])
jbudorick 2016/02/27 00:31:37 Why is this doing a lookbehind if you're matching
361 if run_info:
362 return run_info.group(0)
363
346 # pylint: disable=no-self-use 364 # pylint: disable=no-self-use
347 def ParseGTestOutput(self, output): 365 def ParseGTestOutput(self, output):
348 """Parses raw gtest output and returns a list of results. 366 """Parses raw gtest output and returns a list of results.
349 367
350 Args: 368 Args:
351 output: A list of output lines. 369 output: A list of output lines.
352 Returns: 370 Returns:
353 A list of base_test_result.BaseTestResults. 371 A list of base_test_result.BaseTestResults.
354 """ 372 """
355 log = [] 373 log = []
(...skipping 23 matching lines...) Expand all
379 result_type = None 397 result_type = None
380 398
381 return results 399 return results
382 400
383 #override 401 #override
384 def TearDown(self): 402 def TearDown(self):
385 """Clear the mappings created by SetUp.""" 403 """Clear the mappings created by SetUp."""
386 if self._isolate_delegate: 404 if self._isolate_delegate:
387 self._isolate_delegate.Clear() 405 self._isolate_delegate.Clear()
388 406
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698