Chromium Code Reviews| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 return False, [] # Give up; no results found. | 177 return False, [] # Give up; no results found. |
| 178 interaction, chart = metric.chart_name.split(Metric.OLD_STYLE_DELIMITER, 1) | 178 interaction, chart = metric.chart_name.split(Metric.OLD_STYLE_DELIMITER, 1) |
| 179 metric.interaction_record_name = interaction | 179 metric.interaction_record_name = interaction |
| 180 metric.chart_name = chart | 180 metric.chart_name = chart |
| 181 has_valid_value, value, _ = parse_metric.parse_chartjson_metric( | 181 has_valid_value, value, _ = parse_metric.parse_chartjson_metric( |
| 182 results, metric.as_pair()) | 182 results, metric.as_pair()) |
| 183 return has_valid_value, value | 183 return has_valid_value, value |
| 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 | |
| 188 # tests and non-linux platforms. | |
| 189 if api.m.platform.is_linux and 'xvfb' not in command: | |
| 190 command = 'xvfb-run -a ' + command | |
| 191 command_parts = command.split() | 187 command_parts = command.split() |
| 192 stdout = api.m.raw_io.output() | 188 stdout = api.m.raw_io.output() |
| 193 stderr = api.m.raw_io.output() | 189 stderr = api.m.raw_io.output() |
| 194 try: | 190 try: |
| 195 step_result = api.m.step( | 191 step_result = api.m.chromium.runtest( |
| 196 step_name, | 192 test=command_parts[0], |
| 197 command_parts, | 193 args=command_parts[1:], |
| 194 xvfb=True, | |
|
prasadv
2016/04/11 22:30:53
"xvfb=True", should this be set for all platforms?
| |
| 195 name=step_name, | |
| 198 stdout=stdout, | 196 stdout=stdout, |
| 199 stderr=stderr) | 197 stderr=stderr) |
| 200 step_result.presentation.logs['Captured Output'] = ( | 198 step_result.presentation.logs['Captured Output'] = ( |
| 201 step_result.stdout or '').splitlines() | 199 step_result.stdout or '').splitlines() |
| 202 except api.m.step.StepFailure as sf: | 200 except api.m.step.StepFailure as sf: |
| 203 sf.result.presentation.logs['Failure Output'] = ( | 201 sf.result.presentation.logs['Failure Output'] = ( |
| 204 sf.result.stdout or '').splitlines() | 202 sf.result.stdout or '').splitlines() |
| 205 if sf.result.stderr: # pragma: no cover | 203 if sf.result.stderr: # pragma: no cover |
| 206 sf.result.presentation.logs['stderr'] = ( | 204 sf.result.presentation.logs['stderr'] = ( |
| 207 sf.result.stderr).splitlines() | 205 sf.result.stderr).splitlines() |
| 208 return sf.result.stdout, sf.result.stderr, sf.result.retcode | 206 return sf.result.stdout, sf.result.stderr, sf.result.retcode |
| 209 return step_result.stdout, step_result.stderr, step_result.retcode | 207 return step_result.stdout, step_result.stderr, step_result.retcode |
| OLD | NEW |