| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 os | 5 import os |
| 6 import re | 6 import re |
| 7 import time | 7 import time |
| 8 | 8 |
| 9 from . import parse_metric | 9 from . import parse_metric |
| 10 | 10 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 | 185 |
| 186 def _run_command(api, command, step_name): | 186 def _run_command(api, command, step_name): |
| 187 # TODO(robertocn): Reevaluate this approach when adding support for non-perf | 187 # TODO(robertocn): Reevaluate this approach when adding support for non-perf |
| 188 # tests and non-linux platforms. | 188 # tests and non-linux platforms. |
| 189 if api.m.platform.is_linux and 'xvfb' not in command: | 189 if api.m.platform.is_linux and 'xvfb' not in command: |
| 190 command = 'xvfb-run -a ' + command | 190 command = 'xvfb-run -a ' + command |
| 191 command_parts = command.split() | 191 command_parts = command.split() |
| 192 stdout = api.m.raw_io.output() | 192 stdout = api.m.raw_io.output() |
| 193 stderr = api.m.raw_io.output() | 193 stderr = api.m.raw_io.output() |
| 194 |
| 195 # TODO(prasadv): Remove this once bisect runs are no longer running |
| 196 # against revisions from February 2016 or earlier. |
| 197 kwargs = {} |
| 198 if 'android-chrome' in command: # pragma: no cover |
| 199 kwargs['env'] = {'CHROMIUM_OUTPUT_DIR': api.m.chromium.output_dir} |
| 200 |
| 194 try: | 201 try: |
| 195 step_result = api.m.step( | 202 step_result = api.m.step( |
| 196 step_name, | 203 step_name, |
| 197 command_parts, | 204 command_parts, |
| 198 stdout=stdout, | 205 stdout=stdout, |
| 199 stderr=stderr) | 206 stderr=stderr, |
| 207 **kwargs) |
| 200 step_result.presentation.logs['Captured Output'] = ( | 208 step_result.presentation.logs['Captured Output'] = ( |
| 201 step_result.stdout or '').splitlines() | 209 step_result.stdout or '').splitlines() |
| 202 except api.m.step.StepFailure as sf: | 210 except api.m.step.StepFailure as sf: |
| 203 sf.result.presentation.logs['Failure Output'] = ( | 211 sf.result.presentation.logs['Failure Output'] = ( |
| 204 sf.result.stdout or '').splitlines() | 212 sf.result.stdout or '').splitlines() |
| 205 if sf.result.stderr: # pragma: no cover | 213 if sf.result.stderr: # pragma: no cover |
| 206 sf.result.presentation.logs['stderr'] = ( | 214 sf.result.presentation.logs['stderr'] = ( |
| 207 sf.result.stderr).splitlines() | 215 sf.result.stderr).splitlines() |
| 208 return sf.result.stdout, sf.result.stderr, sf.result.retcode | 216 return sf.result.stdout, sf.result.stderr, sf.result.retcode |
| 209 return step_result.stdout, step_result.stderr, step_result.retcode | 217 return step_result.stdout, step_result.stderr, step_result.retcode |
| OLD | NEW |