| 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 |
| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 step_result.presentation.logs['Captured Output'] = ( | 241 step_result.presentation.logs['Captured Output'] = ( |
| 236 step_result.stdout or '').splitlines() | 242 step_result.stdout or '').splitlines() |
| 237 except api.m.step.StepFailure as sf: | 243 except api.m.step.StepFailure as sf: |
| 238 sf.result.presentation.logs['Failure Output'] = ( | 244 sf.result.presentation.logs['Failure Output'] = ( |
| 239 sf.result.stdout or '').splitlines() | 245 sf.result.stdout or '').splitlines() |
| 240 if sf.result.stderr: # pragma: no cover | 246 if sf.result.stderr: # pragma: no cover |
| 241 sf.result.presentation.logs['stderr'] = ( | 247 sf.result.presentation.logs['stderr'] = ( |
| 242 sf.result.stderr).splitlines() | 248 sf.result.stderr).splitlines() |
| 243 return sf.result.stdout, sf.result.stderr, sf.result.retcode | 249 return sf.result.stdout, sf.result.stderr, sf.result.retcode |
| 244 return step_result.stdout, step_result.stderr, step_result.retcode | 250 return step_result.stdout, step_result.stderr, step_result.retcode |
| OLD | NEW |