| 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 |
| 77 """Get the git hash and commit position of the chromium master branch. | 78 """Get the git hash and commit position of the chromium master branch. |
| 78 | 79 |
| 79 See: https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/s
lave/runtest.py#212 | 80 See: https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/s
lave/runtest.py#212 |
| 80 | 81 |
| 81 Returns: | 82 Returns: |
| 82 A dictionary with 'revision' and 'commit_pos' keys. | 83 A dictionary with 'revision' and 'commit_pos' keys. |
| 83 """ | 84 """ |
| 85 # pylint: enable=line-too-long |
| 84 status, output = cmd_helper.GetCmdStatusAndOutput( | 86 status, output = cmd_helper.GetCmdStatusAndOutput( |
| 85 ['git', 'log', '-n', '1', '--pretty=format:%H%n%B', 'HEAD'], | 87 ['git', 'log', '-n', '1', '--pretty=format:%H%n%B', 'HEAD'], |
| 86 constants.DIR_SOURCE_ROOT) | 88 constants.DIR_SOURCE_ROOT) |
| 87 revision = None | 89 revision = None |
| 88 commit_pos = None | 90 commit_pos = None |
| 89 if not status: | 91 if not status: |
| 90 lines = output.splitlines() | 92 lines = output.splitlines() |
| 91 revision = lines[0] | 93 revision = lines[0] |
| 92 for line in reversed(lines): | 94 for line in reversed(lines): |
| 93 m = _GIT_CR_POS_RE.match(line.strip()) | 95 m = _GIT_CR_POS_RE.match(line.strip()) |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 Returns: | 456 Returns: |
| 455 A tuple of (TestRunResults, retry). | 457 A tuple of (TestRunResults, retry). |
| 456 """ | 458 """ |
| 457 _, result_type = self._LaunchPerfTest(test_name) | 459 _, result_type = self._LaunchPerfTest(test_name) |
| 458 results = base_test_result.TestRunResults() | 460 results = base_test_result.TestRunResults() |
| 459 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 461 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
| 460 retry = None | 462 retry = None |
| 461 if not results.DidRunPass(): | 463 if not results.DidRunPass(): |
| 462 retry = test_name | 464 retry = test_name |
| 463 return results, retry | 465 return results, retry |
| OLD | NEW |