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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 import json | 50 import json |
51 import logging | 51 import logging |
52 import os | 52 import os |
53 import pickle | 53 import pickle |
54 import shutil | 54 import shutil |
55 import sys | 55 import sys |
56 import tempfile | 56 import tempfile |
57 import threading | 57 import threading |
58 import time | 58 import time |
59 | 59 |
60 from pylib import cmd_helper | 60 from devil.android import battery_utils |
| 61 from devil.android import device_errors |
| 62 from devil.utils import cmd_helper |
61 from pylib import constants | 63 from pylib import constants |
62 from pylib import forwarder | 64 from pylib import forwarder |
63 from pylib.base import base_test_result | 65 from pylib.base import base_test_result |
64 from pylib.base import base_test_runner | 66 from pylib.base import base_test_runner |
65 from pylib.device import battery_utils | |
66 from pylib.device import device_errors | |
67 | 67 |
68 | 68 |
69 def GetPersistedResult(test_name): | 69 def GetPersistedResult(test_name): |
70 file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name) | 70 file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name) |
71 if not os.path.exists(file_name): | 71 if not os.path.exists(file_name): |
72 logging.error('File not found %s', file_name) | 72 logging.error('File not found %s', file_name) |
73 return None | 73 return None |
74 | 74 |
75 with file(file_name, 'r') as f: | 75 with file(file_name, 'r') as f: |
76 return pickle.loads(f.read()) | 76 return pickle.loads(f.read()) |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 Returns: | 366 Returns: |
367 A tuple of (TestRunResults, retry). | 367 A tuple of (TestRunResults, retry). |
368 """ | 368 """ |
369 _, result_type = self._LaunchPerfTest(test_name) | 369 _, result_type = self._LaunchPerfTest(test_name) |
370 results = base_test_result.TestRunResults() | 370 results = base_test_result.TestRunResults() |
371 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 371 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
372 retry = None | 372 retry = None |
373 if not results.DidRunPass(): | 373 if not results.DidRunPass(): |
374 retry = test_name | 374 retry = test_name |
375 return results, retry | 375 return results, retry |
OLD | NEW |