OLD | NEW |
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 tests: list of tests to run. | 269 tests: list of tests to run. |
270 build_type: either 'Debug' or 'Release'. | 270 build_type: either 'Debug' or 'Release'. |
271 test_timeout: watchdog timeout in seconds for running tests, defaults to the | 271 test_timeout: watchdog timeout in seconds for running tests, defaults to the |
272 default timeout. | 272 default timeout. |
273 setup_timeout: watchdog timeout in seconds for creating and cleaning up | 273 setup_timeout: watchdog timeout in seconds for creating and cleaning up |
274 test runners, defaults to the default timeout. | 274 test runners, defaults to the default timeout. |
275 | 275 |
276 Returns: | 276 Returns: |
277 A base_test_result.TestRunResults object. | 277 A base_test_result.TestRunResults object. |
278 """ | 278 """ |
| 279 logging.info('Will run %d tests: %s', len(tests), str(tests)) |
279 forwarder.Forwarder.KillHost(build_type) | 280 forwarder.Forwarder.KillHost(build_type) |
280 runners = _CreateRunners(runner_factory, devices, setup_timeout) | 281 runners = _CreateRunners(runner_factory, devices, setup_timeout) |
281 try: | 282 try: |
282 return _RunAllTests(runners, tests, test_timeout) | 283 return _RunAllTests(runners, tests, test_timeout) |
283 finally: | 284 finally: |
284 try: | 285 try: |
285 _TearDownRunners(runners, setup_timeout) | 286 _TearDownRunners(runners, setup_timeout) |
286 except android_commands.errors.DeviceUnresponsiveError as e: | 287 except android_commands.errors.DeviceUnresponsiveError as e: |
287 logging.warning('Device unresponsive during TearDown: [%s]', e) | 288 logging.warning('Device unresponsive during TearDown: [%s]', e) |
288 finally: | 289 finally: |
289 forwarder.Forwarder.KillHost(build_type) | 290 forwarder.Forwarder.KillHost(build_type) |
OLD | NEW |