OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import json | 5 import json |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import pickle | 8 import pickle |
9 import re | 9 import re |
10 | 10 |
11 from devil import base_error | 11 from devil import base_error |
12 from devil.utils import cmd_helper | 12 from devil.utils import cmd_helper |
13 from pylib import constants | 13 from pylib import constants |
14 from pylib.base import base_test_result | 14 from pylib.base import base_test_result |
15 from pylib.base import test_instance | 15 from pylib.base import test_instance |
16 from pylib.constants import host_paths | 16 from pylib.constants import host_paths |
17 | 17 |
18 | 18 |
19 _GIT_CR_POS_RE = re.compile(r'^Cr-Commit-Position: refs/heads/master@{#(\d+)}$') | 19 _GIT_CR_POS_RE = re.compile(r'^Cr-Commit-Position: refs/heads/master@{#(\d+)}$') |
20 | 20 |
21 | 21 |
22 def _GetPersistedResult(test_name): | 22 def _GetPersistedResult(test_name): |
23 file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name) | 23 file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name) |
24 if not os.path.exists(file_name): | 24 if not os.path.exists(file_name): |
25 logging.error('File not found %s', file_name) | 25 logging.error('File not found %s', file_name) |
26 return None | 26 return None |
27 | 27 |
28 with file(file_name, 'r') as f: | 28 with file(file_name, 'r') as f: |
29 return pickle.loads(f.read()) | 29 return pickle.load(f) |
30 | 30 |
31 | 31 |
32 def _GetChromiumRevision(): | 32 def _GetChromiumRevision(): |
33 # pylint: disable=line-too-long | 33 # pylint: disable=line-too-long |
34 """Get the git hash and commit position of the chromium master branch. | 34 """Get the git hash and commit position of the chromium master branch. |
35 | 35 |
36 See: | 36 See: |
37 https://chromium.googlesource.com/chromium/tools/build/+/387e3cf3/scripts/slav
e/runtest.py#211 | 37 https://chromium.googlesource.com/chromium/tools/build/+/387e3cf3/scripts/slav
e/runtest.py#211 |
38 | 38 |
39 Returns: | 39 Returns: |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 @property | 264 @property |
265 def test_filter(self): | 265 def test_filter(self): |
266 return self._test_filter | 266 return self._test_filter |
267 | 267 |
268 | 268 |
269 class PersistentDataError(base_error.BaseError): | 269 class PersistentDataError(base_error.BaseError): |
270 def __init__(self, message): | 270 def __init__(self, message): |
271 super(PersistentDataError, self).__init__(message) | 271 super(PersistentDataError, self).__init__(message) |
272 self._is_infra_error = True | 272 self._is_infra_error = True |
OLD | NEW |