OLD | NEW |
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 """Runs perf tests. | 5 """Runs perf tests. |
6 | 6 |
7 Our buildbot infrastructure requires each slave to run steps serially. | 7 Our buildbot infrastructure requires each slave to run steps serially. |
8 This is sub-optimal for android, where these steps can run independently on | 8 This is sub-optimal for android, where these steps can run independently on |
9 multiple connected devices. | 9 multiple connected devices. |
10 | 10 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 (self._tests['steps'][test_name]['cmd'], | 266 (self._tests['steps'][test_name]['cmd'], |
267 self.device_serial)) | 267 self.device_serial)) |
268 | 268 |
269 if self._options.collect_chartjson_data: | 269 if self._options.collect_chartjson_data: |
270 self._output_dir = tempfile.mkdtemp() | 270 self._output_dir = tempfile.mkdtemp() |
271 cmd = cmd + ' --output-dir=%s' % self._output_dir | 271 cmd = cmd + ' --output-dir=%s' % self._output_dir |
272 | 272 |
273 logging.info( | 273 logging.info( |
274 'temperature: %s (0.1 C)', | 274 'temperature: %s (0.1 C)', |
275 str(self._device_battery.GetBatteryInfo().get('temperature'))) | 275 str(self._device_battery.GetBatteryInfo().get('temperature'))) |
| 276 if self._options.max_battery_temp: |
| 277 self._device_battery.LetBatteryCoolToTemperature( |
| 278 self._options.max_battery_temp) |
| 279 |
276 logging.info('%s : %s', test_name, cmd) | 280 logging.info('%s : %s', test_name, cmd) |
277 start_time = datetime.datetime.now() | 281 start_time = datetime.datetime.now() |
278 | 282 |
279 timeout = self._tests['steps'][test_name].get('timeout', 5400) | 283 timeout = self._tests['steps'][test_name].get('timeout', 5400) |
280 if self._options.no_timeout: | 284 if self._options.no_timeout: |
281 timeout = None | 285 timeout = None |
282 logging.info('Timeout for %s test: %s', test_name, timeout) | 286 logging.info('Timeout for %s test: %s', test_name, timeout) |
283 full_cmd = cmd | 287 full_cmd = cmd |
284 if self._options.dry_run: | 288 if self._options.dry_run: |
285 full_cmd = 'echo %s' % cmd | 289 full_cmd = 'echo %s' % cmd |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 Returns: | 359 Returns: |
356 A tuple of (TestRunResults, retry). | 360 A tuple of (TestRunResults, retry). |
357 """ | 361 """ |
358 _, result_type = self._LaunchPerfTest(test_name) | 362 _, result_type = self._LaunchPerfTest(test_name) |
359 results = base_test_result.TestRunResults() | 363 results = base_test_result.TestRunResults() |
360 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 364 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
361 retry = None | 365 retry = None |
362 if not results.DidRunPass(): | 366 if not results.DidRunPass(): |
363 retry = test_name | 367 retry = test_name |
364 return results, retry | 368 return results, retry |
OLD | NEW |