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

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

Issue 16682003: [Android] Add a check in sharder for an empty test list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit test Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | build/android/pylib/base/shard_unittest.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 (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 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 """Implements test sharding logic.""" 5 """Implements test sharding logic."""
6 6
7 import logging 7 import logging
8 import threading 8 import threading
9 9
10 from pylib import android_commands 10 from pylib import android_commands
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 build_type: either 'Debug' or 'Release'. 275 build_type: either 'Debug' or 'Release'.
276 test_timeout: watchdog timeout in seconds for running tests, defaults to the 276 test_timeout: watchdog timeout in seconds for running tests, defaults to the
277 default timeout. 277 default timeout.
278 setup_timeout: watchdog timeout in seconds for creating and cleaning up 278 setup_timeout: watchdog timeout in seconds for creating and cleaning up
279 test runners, defaults to the default timeout. 279 test runners, defaults to the default timeout.
280 num_retries: number of retries for a test. 280 num_retries: number of retries for a test.
281 281
282 Returns: 282 Returns:
283 A base_test_result.TestRunResults object. 283 A base_test_result.TestRunResults object.
284 """ 284 """
285 if not tests:
286 logging.warning('No tests to run.')
287 return base_test_result.TestRunResults()
288
285 logging.info('Will run %d tests: %s', len(tests), str(tests)) 289 logging.info('Will run %d tests: %s', len(tests), str(tests))
286 forwarder.Forwarder.KillHost(build_type) 290 forwarder.Forwarder.KillHost(build_type)
287 runners = _CreateRunners(runner_factory, devices, setup_timeout) 291 runners = _CreateRunners(runner_factory, devices, setup_timeout)
288 try: 292 try:
289 return _RunAllTests(runners, tests, num_retries, test_timeout) 293 return _RunAllTests(runners, tests, num_retries, test_timeout)
290 finally: 294 finally:
291 try: 295 try:
292 _TearDownRunners(runners, setup_timeout) 296 _TearDownRunners(runners, setup_timeout)
293 except android_commands.errors.DeviceUnresponsiveError as e: 297 except android_commands.errors.DeviceUnresponsiveError as e:
294 logging.warning('Device unresponsive during TearDown: [%s]', e) 298 logging.warning('Device unresponsive during TearDown: [%s]', e)
295 finally: 299 finally:
296 forwarder.Forwarder.KillHost(build_type) 300 forwarder.Forwarder.KillHost(build_type)
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/base/shard_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698