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

Side by Side Diff: build/android/pylib/base/test_dispatcher.py

Issue 22267011: Temporary fix to make steps with no host-driven tests pass. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Dispatches tests, either sharding or replicating them. 5 """Dispatches tests, either sharding or replicating them.
6 6
7 To dispatch, performs the following steps: 7 To dispatch, performs the following steps:
8 * Create a test collection factory, using the given tests 8 * Create a test collection factory, using the given tests
9 - If sharding: test collection factory returns the same shared test collection 9 - If sharding: test collection factory returns the same shared test collection
10 to all test runners 10 to all test runners
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 test_timeout: Watchdog timeout in seconds for running tests. 356 test_timeout: Watchdog timeout in seconds for running tests.
357 setup_timeout: Watchdog timeout in seconds for creating and cleaning up 357 setup_timeout: Watchdog timeout in seconds for creating and cleaning up
358 test runners. 358 test runners.
359 num_retries: Number of retries for a test. 359 num_retries: Number of retries for a test.
360 360
361 Returns: 361 Returns:
362 A tuple of (base_test_result.TestRunResults object, exit code). 362 A tuple of (base_test_result.TestRunResults object, exit code).
363 """ 363 """
364 if not tests: 364 if not tests:
365 logging.error('No tests to run.') 365 logging.error('No tests to run.')
366 return (base_test_result.TestRunResults(), constants.ERROR_EXIT_CODE) 366 return (base_test_result.TestRunResults(), 0)
367 367
368 if shard: 368 if shard:
369 # Generate a shared _TestCollection object for all test runners, so they 369 # Generate a shared _TestCollection object for all test runners, so they
370 # draw from a common pool of tests. 370 # draw from a common pool of tests.
371 shared_test_collection = _TestCollection([_Test(t) for t in tests]) 371 shared_test_collection = _TestCollection([_Test(t) for t in tests])
372 test_collection_factory = lambda: shared_test_collection 372 test_collection_factory = lambda: shared_test_collection
373 tag_results_with_device = False 373 tag_results_with_device = False
374 log_string = 'sharded across devices' 374 log_string = 'sharded across devices'
375 else: 375 else:
376 # Generate a unique _TestCollection object for each test runner, but use 376 # Generate a unique _TestCollection object for each test runner, but use
377 # the same set of tests. 377 # the same set of tests.
378 test_collection_factory = lambda: _TestCollection([_Test(t) for t in tests]) 378 test_collection_factory = lambda: _TestCollection([_Test(t) for t in tests])
379 tag_results_with_device = True 379 tag_results_with_device = True
380 log_string = 'replicated on each device' 380 log_string = 'replicated on each device'
381 381
382 devices = _GetAttachedDevices(wait_for_debugger, test_device) 382 devices = _GetAttachedDevices(wait_for_debugger, test_device)
383 383
384 logging.info('Will run %d tests (%s): %s', len(tests), log_string, str(tests)) 384 logging.info('Will run %d tests (%s): %s', len(tests), log_string, str(tests))
385 runners = _CreateRunners(runner_factory, devices, setup_timeout) 385 runners = _CreateRunners(runner_factory, devices, setup_timeout)
386 try: 386 try:
387 return _RunAllTests(runners, test_collection_factory, 387 return _RunAllTests(runners, test_collection_factory,
388 num_retries, test_timeout, tag_results_with_device) 388 num_retries, test_timeout, tag_results_with_device)
389 finally: 389 finally:
390 try: 390 try:
391 _TearDownRunners(runners, setup_timeout) 391 _TearDownRunners(runners, setup_timeout)
392 except android_commands.errors.DeviceUnresponsiveError as e: 392 except android_commands.errors.DeviceUnresponsiveError as e:
393 logging.warning('Device unresponsive during TearDown: [%s]', e) 393 logging.warning('Device unresponsive during TearDown: [%s]', e)
OLDNEW
« 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