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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 metric = test_config.get('metric') | 84 metric = test_config.get('metric') |
| 85 retcodes = [] | 85 retcodes = [] |
| 86 output_for_all_runs = [] | 86 output_for_all_runs = [] |
| 87 temp_dir = None | 87 temp_dir = None |
| 88 repeat_cnt = test_config['repeat_count'] | 88 repeat_cnt = test_config['repeat_count'] |
| 89 | 89 |
| 90 command = test_config['command'] | 90 command = test_config['command'] |
| 91 use_chartjson = bool('chartjson' in command) | 91 use_chartjson = bool('chartjson' in command) |
| 92 is_telemetry = _is_telemetry_command(command) | 92 is_telemetry = _is_telemetry_command(command) |
| 93 start_time = time.time() | 93 start_time = time.time() |
| 94 | |
| 95 if api.m.chromium.c.TARGET_PLATFORM == 'android' and is_telemetry: | |
| 96 device_serial_number = api.device_to_test; | |
| 97 if device_serial_number: | |
| 98 command += '--device ' + device_serial_number # pragma: no cover | |
|
RobertoCN
2016/06/22 21:34:40
shouldn't it be ' --device ' ?
Ziqi Xiong
2016/06/22 21:52:25
Nice catch, thanks!
| |
| 99 | |
| 94 for i in range(repeat_cnt): | 100 for i in range(repeat_cnt): |
| 95 elapsed_minutes = (time.time() - start_time) / 60.0 | 101 elapsed_minutes = (time.time() - start_time) / 60.0 |
| 96 # A limit of 0 means 'no timeout set'. | 102 # A limit of 0 means 'no timeout set'. |
| 97 if limit and elapsed_minutes >= limit: # pragma: no cover | 103 if limit and elapsed_minutes >= limit: # pragma: no cover |
| 98 break | 104 break |
| 99 if is_telemetry: | 105 if is_telemetry: |
| 100 if i == 0 and kwargs.get('reset_on_first_run'): | 106 if i == 0 and kwargs.get('reset_on_first_run'): |
| 101 command += ' --reset-results' | 107 command += ' --reset-results' |
| 102 if i == repeat_cnt - 1 and kwargs.get('upload_on_last_run'): | 108 if i == repeat_cnt - 1 and kwargs.get('upload_on_last_run'): |
| 103 command += ' --upload-results' | 109 command += ' --upload-results' |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 step_result.presentation.logs['Captured Output'] = ( | 238 step_result.presentation.logs['Captured Output'] = ( |
| 233 step_result.stdout or '').splitlines() | 239 step_result.stdout or '').splitlines() |
| 234 except api.m.step.StepFailure as sf: | 240 except api.m.step.StepFailure as sf: |
| 235 sf.result.presentation.logs['Failure Output'] = ( | 241 sf.result.presentation.logs['Failure Output'] = ( |
| 236 sf.result.stdout or '').splitlines() | 242 sf.result.stdout or '').splitlines() |
| 237 if sf.result.stderr: # pragma: no cover | 243 if sf.result.stderr: # pragma: no cover |
| 238 sf.result.presentation.logs['stderr'] = ( | 244 sf.result.presentation.logs['stderr'] = ( |
| 239 sf.result.stderr).splitlines() | 245 sf.result.stderr).splitlines() |
| 240 return sf.result.stdout, sf.result.stderr, sf.result.retcode | 246 return sf.result.stdout, sf.result.stderr, sf.result.retcode |
| 241 return step_result.stdout, step_result.stderr, step_result.retcode | 247 return step_result.stdout, step_result.stderr, step_result.retcode |
| OLD | NEW |