| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 from pylib import forwarder | 67 from pylib import forwarder |
| 68 from pylib.base import base_test_result | 68 from pylib.base import base_test_result |
| 69 from pylib.base import base_test_runner | 69 from pylib.base import base_test_runner |
| 70 | 70 |
| 71 | 71 |
| 72 # Regex for the master branch commit position. | 72 # Regex for the master branch commit position. |
| 73 _GIT_CR_POS_RE = re.compile(r'^Cr-Commit-Position: refs/heads/master@{#(\d+)}$') | 73 _GIT_CR_POS_RE = re.compile(r'^Cr-Commit-Position: refs/heads/master@{#(\d+)}$') |
| 74 | 74 |
| 75 | 75 |
| 76 def _GetChromiumRevision(): | 76 def _GetChromiumRevision(): |
| 77 # pylint: disable=line-too-long | |
| 78 """Get the git hash and commit position of the chromium master branch. | 77 """Get the git hash and commit position of the chromium master branch. |
| 79 | 78 |
| 80 See: https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/s
lave/runtest.py#212 | 79 See: https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/s
lave/runtest.py#212 |
| 81 | 80 |
| 82 Returns: | 81 Returns: |
| 83 A dictionary with 'revision' and 'commit_pos' keys. | 82 A dictionary with 'revision' and 'commit_pos' keys. |
| 84 """ | 83 """ |
| 85 # pylint: enable=line-too-long | |
| 86 status, output = cmd_helper.GetCmdStatusAndOutput( | 84 status, output = cmd_helper.GetCmdStatusAndOutput( |
| 87 ['git', 'log', '-n', '1', '--pretty=format:%H%n%B', 'HEAD'], | 85 ['git', 'log', '-n', '1', '--pretty=format:%H%n%B', 'HEAD'], |
| 88 constants.DIR_SOURCE_ROOT) | 86 constants.DIR_SOURCE_ROOT) |
| 89 revision = None | 87 revision = None |
| 90 commit_pos = None | 88 commit_pos = None |
| 91 if not status: | 89 if not status: |
| 92 lines = output.splitlines() | 90 lines = output.splitlines() |
| 93 revision = lines[0] | 91 revision = lines[0] |
| 94 for line in reversed(lines): | 92 for line in reversed(lines): |
| 95 m = _GIT_CR_POS_RE.match(line.strip()) | 93 m = _GIT_CR_POS_RE.match(line.strip()) |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 Returns: | 439 Returns: |
| 442 A tuple of (TestRunResults, retry). | 440 A tuple of (TestRunResults, retry). |
| 443 """ | 441 """ |
| 444 _, result_type = self._LaunchPerfTest(test_name) | 442 _, result_type = self._LaunchPerfTest(test_name) |
| 445 results = base_test_result.TestRunResults() | 443 results = base_test_result.TestRunResults() |
| 446 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 444 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
| 447 retry = None | 445 retry = None |
| 448 if not results.DidRunPass(): | 446 if not results.DidRunPass(): |
| 449 retry = test_name | 447 retry = test_name |
| 450 return results, retry | 448 return results, retry |
| OLD | NEW |