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

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

Issue 2743873003: [Android] Add support for external sharding to the test runner. (Closed)
Patch Set: borked rebase Created 3 years, 9 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
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/instrumentation_test_instance.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 HTMLParser 5 import HTMLParser
6 import logging 6 import logging
7 import os 7 import os
8 import re 8 import re
9 import tempfile 9 import tempfile
10 import threading 10 import threading
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 return test_name 255 return test_name
256 256
257 class GtestTestInstance(test_instance.TestInstance): 257 class GtestTestInstance(test_instance.TestInstance):
258 258
259 def __init__(self, args, data_deps_delegate, error_func): 259 def __init__(self, args, data_deps_delegate, error_func):
260 super(GtestTestInstance, self).__init__() 260 super(GtestTestInstance, self).__init__()
261 # TODO(jbudorick): Support multiple test suites. 261 # TODO(jbudorick): Support multiple test suites.
262 if len(args.suite_name) > 1: 262 if len(args.suite_name) > 1:
263 raise ValueError('Platform mode currently supports only 1 gtest suite') 263 raise ValueError('Platform mode currently supports only 1 gtest suite')
264 self._exe_dist_dir = None 264 self._exe_dist_dir = None
265 self._external_shard_index = args.test_launcher_shard_index
265 self._extract_test_list_from_filter = args.extract_test_list_from_filter 266 self._extract_test_list_from_filter = args.extract_test_list_from_filter
267 self._filter_tests_lock = threading.Lock()
266 self._shard_timeout = args.shard_timeout 268 self._shard_timeout = args.shard_timeout
267 self._store_tombstones = args.store_tombstones 269 self._store_tombstones = args.store_tombstones
270 self._total_external_shards = args.test_launcher_total_shards
268 self._suite = args.suite_name[0] 271 self._suite = args.suite_name[0]
269 self._filter_tests_lock = threading.Lock()
270 272
271 # GYP: 273 # GYP:
272 if args.executable_dist_dir: 274 if args.executable_dist_dir:
273 self._exe_dist_dir = os.path.abspath(args.executable_dist_dir) 275 self._exe_dist_dir = os.path.abspath(args.executable_dist_dir)
274 else: 276 else:
275 # TODO(agrieve): Remove auto-detection once recipes pass flag explicitly. 277 # TODO(agrieve): Remove auto-detection once recipes pass flag explicitly.
276 exe_dist_dir = os.path.join(constants.GetOutDirectory(), 278 exe_dist_dir = os.path.join(constants.GetOutDirectory(),
277 '%s__dist' % self._suite) 279 '%s__dist' % self._suite)
278 280
279 if os.path.exists(exe_dist_dir): 281 if os.path.exists(exe_dist_dir):
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 361
360 @property 362 @property
361 def enable_xml_result_parsing(self): 363 def enable_xml_result_parsing(self):
362 return self._enable_xml_result_parsing 364 return self._enable_xml_result_parsing
363 365
364 @property 366 @property
365 def exe_dist_dir(self): 367 def exe_dist_dir(self):
366 return self._exe_dist_dir 368 return self._exe_dist_dir
367 369
368 @property 370 @property
371 def external_shard_index(self):
372 return self._external_shard_index
373
374 @property
375 def extract_test_list_from_filter(self):
376 return self._extract_test_list_from_filter
377
378 @property
369 def extras(self): 379 def extras(self):
370 return self._extras 380 return self._extras
371 381
372 @property 382 @property
373 def gtest_also_run_disabled_tests(self): 383 def gtest_also_run_disabled_tests(self):
374 return self._run_disabled 384 return self._run_disabled
375 385
376 @property 386 @property
377 def gtest_filter(self): 387 def gtest_filter(self):
378 return self._gtest_filter 388 return self._gtest_filter
(...skipping 24 matching lines...) Expand all
403 413
404 @property 414 @property
405 def test_apk_incremental_install_script(self): 415 def test_apk_incremental_install_script(self):
406 return self._test_apk_incremental_install_script 416 return self._test_apk_incremental_install_script
407 417
408 @property 418 @property
409 def test_arguments(self): 419 def test_arguments(self):
410 return self._test_arguments 420 return self._test_arguments
411 421
412 @property 422 @property
413 def extract_test_list_from_filter(self): 423 def total_external_shards(self):
414 return self._extract_test_list_from_filter 424 return self._total_external_shards
415 425
416 #override 426 #override
417 def TestType(self): 427 def TestType(self):
418 return 'gtest' 428 return 'gtest'
419 429
420 #override 430 #override
421 def SetUp(self): 431 def SetUp(self):
422 """Map data dependencies via isolate.""" 432 """Map data dependencies via isolate."""
423 self._data_deps.extend( 433 self._data_deps.extend(
424 self._data_deps_delegate(self._runtime_deps_path)) 434 self._data_deps_delegate(self._runtime_deps_path))
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 '%s' % l for l in (line.strip() for line in disabled_tests_file) 495 '%s' % l for l in (line.strip() for line in disabled_tests_file)
486 if l and not l.startswith('#')] 496 if l and not l.startswith('#')]
487 497
488 return '*-%s' % ':'.join(disabled_filter_items) 498 return '*-%s' % ':'.join(disabled_filter_items)
489 499
490 #override 500 #override
491 def TearDown(self): 501 def TearDown(self):
492 """Do nothing.""" 502 """Do nothing."""
493 pass 503 pass
494 504
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/instrumentation_test_instance.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698