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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 logging.info('%s : %s', test_name, cmd) | 134 logging.info('%s : %s', test_name, cmd) |
135 start_time = datetime.datetime.now() | 135 start_time = datetime.datetime.now() |
136 | 136 |
137 timeout = 1800 | 137 timeout = 1800 |
138 if self._options.no_timeout: | 138 if self._options.no_timeout: |
139 timeout = None | 139 timeout = None |
140 full_cmd = cmd | 140 full_cmd = cmd |
141 if self._options.dry_run: | 141 if self._options.dry_run: |
142 full_cmd = 'echo %s' % cmd | 142 full_cmd = 'echo %s' % cmd |
143 | 143 |
| 144 logfile = sys.stdout |
| 145 if self._options.single_step: |
| 146 logfile = None |
144 output, exit_code = pexpect.run( | 147 output, exit_code = pexpect.run( |
145 full_cmd, cwd=os.path.abspath(constants.DIR_SOURCE_ROOT), | 148 full_cmd, cwd=os.path.abspath(constants.DIR_SOURCE_ROOT), |
146 withexitstatus=True, logfile=sys.stdout, timeout=timeout, | 149 withexitstatus=True, logfile=logfile, timeout=timeout, |
147 env=os.environ) | 150 env=os.environ) |
148 end_time = datetime.datetime.now() | 151 end_time = datetime.datetime.now() |
149 if exit_code is None: | 152 if exit_code is None: |
150 exit_code = -1 | 153 exit_code = -1 |
151 logging.info('%s : exit_code=%d in %d secs at %s', | 154 logging.info('%s : exit_code=%d in %d secs at %s', |
152 test_name, exit_code, (end_time - start_time).seconds, | 155 test_name, exit_code, (end_time - start_time).seconds, |
153 self.device) | 156 self.device) |
154 result_type = base_test_result.ResultType.FAIL | 157 result_type = base_test_result.ResultType.FAIL |
155 if exit_code == 0: | 158 if exit_code == 0: |
156 result_type = base_test_result.ResultType.PASS | 159 result_type = base_test_result.ResultType.PASS |
(...skipping 28 matching lines...) Expand all Loading... |
185 Returns: | 188 Returns: |
186 A tuple of (TestRunResults, retry). | 189 A tuple of (TestRunResults, retry). |
187 """ | 190 """ |
188 output, result_type = self._LaunchPerfTest(test_name) | 191 output, result_type = self._LaunchPerfTest(test_name) |
189 results = base_test_result.TestRunResults() | 192 results = base_test_result.TestRunResults() |
190 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 193 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
191 retry = None | 194 retry = None |
192 if not results.DidRunPass(): | 195 if not results.DidRunPass(): |
193 retry = test_name | 196 retry = test_name |
194 return results, retry | 197 return results, retry |
OLD | NEW |