Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: scripts/slave/recipe_modules/bisect_tester/perf_test.py

Issue 2130833002: Handling the case when command paths start with ./src or .\src (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 def _rebase_path(api, file_path): 185 def _rebase_path(api, file_path):
186 """Attempts to make an absolute path for the command. 186 """Attempts to make an absolute path for the command.
187 187
188 We want to pass to runtest.py an absolute path if possible. 188 We want to pass to runtest.py an absolute path if possible.
189 """ 189 """
190 if file_path.startswith('src/'): 190 if (file_path.startswith('src/') or file_path.startswith('./src/')):
191 return api.m.path['checkout'].join(*file_path.split('/')[1:]) 191 return api.m.path['checkout'].join(
192 elif file_path.startswith('src\\'): # pragma: no cover 192 *file_path.split('src', 1)[1].split('/')[1:])
193 return api.m.path['checkout'].join(*file_path.split('\\')[1:]) 193 elif (file_path.startswith('src\\') or
194 file_path.startswith('.\\src\\')): # pragma: no cover
195 return api.m.path['checkout'].join(
196 *file_path.split('src', 1)[1].split('\\')[1:])
194 return file_path 197 return file_path
195 198
196 def _run_command(api, command, step_name): 199 def _run_command(api, command, step_name):
197 command_parts = command.split() 200 command_parts = command.split()
198 stdout = api.m.raw_io.output() 201 stdout = api.m.raw_io.output()
199 stderr = api.m.raw_io.output() 202 stderr = api.m.raw_io.output()
200 203
201 # TODO(prasadv): Remove this once bisect runs are no longer running 204 # TODO(prasadv): Remove this once bisect runs are no longer running
202 # against revisions from February 2016 or earlier. 205 # against revisions from February 2016 or earlier.
203 kwargs = {} 206 kwargs = {}
(...skipping 28 matching lines...) Expand all
232 step_result.presentation.logs['Captured Output'] = ( 235 step_result.presentation.logs['Captured Output'] = (
233 step_result.stdout or '').splitlines() 236 step_result.stdout or '').splitlines()
234 except api.m.step.StepFailure as sf: 237 except api.m.step.StepFailure as sf:
235 sf.result.presentation.logs['Failure Output'] = ( 238 sf.result.presentation.logs['Failure Output'] = (
236 sf.result.stdout or '').splitlines() 239 sf.result.stdout or '').splitlines()
237 if sf.result.stderr: # pragma: no cover 240 if sf.result.stderr: # pragma: no cover
238 sf.result.presentation.logs['stderr'] = ( 241 sf.result.presentation.logs['stderr'] = (
239 sf.result.stderr).splitlines() 242 sf.result.stderr).splitlines()
240 return sf.result.stdout, sf.result.stderr, sf.result.retcode 243 return sf.result.stdout, sf.result.stderr, sf.result.retcode
241 return step_result.stdout, step_result.stderr, step_result.retcode 244 return step_result.stdout, step_result.stderr, step_result.retcode
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698