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

Side by Side Diff: tools/bisect-perf-regression.py

Issue 298743002: Prevent modifying path separator on Windows by shlex.split() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Performance Test Bisect Tool 6 """Performance Test Bisect Tool
7 7
8 This script bisects a series of changelists using binary search. It starts at 8 This script bisects a series of changelists using binary search. It starts at
9 a bad revision where a performance metric has regressed, and asks for a last 9 a bad revision where a performance metric has regressed, and asks for a last
10 known-good revision. It will then binary search across this revision range by 10 known-good revision. It will then binary search across this revision range by
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after
2087 2087
2088 if self.opts.debug_ignore_perf_test: 2088 if self.opts.debug_ignore_perf_test:
2089 fake_results = { 2089 fake_results = {
2090 'mean': 0.0, 2090 'mean': 0.0,
2091 'std_err': 0.0, 2091 'std_err': 0.0,
2092 'std_dev': 0.0, 2092 'std_dev': 0.0,
2093 'values': [0.0] 2093 'values': [0.0]
2094 } 2094 }
2095 return (fake_results, success_code) 2095 return (fake_results, success_code)
2096 2096
2097 args = shlex.split(command_to_run) 2097 # For Windows platform set posix=False, to parse windows paths correctly.
2098 # On Windows, path separators '\' or '\\' are replace by '' when posix=True,
2099 # refer to http://bugs.python.org/issue1724822. By default posix=True.
2100 args = shlex.split(command_to_run, posix=not IsWindows())
2098 2101
2099 if not self._GenerateProfileIfNecessary(args): 2102 if not self._GenerateProfileIfNecessary(args):
2100 err_text = 'Failed to generate profile for performance test.' 2103 err_text = 'Failed to generate profile for performance test.'
2101 return (err_text, failure_code) 2104 return (err_text, failure_code)
2102 2105
2103 # If running a Telemetry test for Chrome OS, insert the remote IP and 2106 # If running a Telemetry test for Chrome OS, insert the remote IP and
2104 # identity parameters. 2107 # identity parameters.
2105 is_telemetry = bisect_utils.IsTelemetryCommand(command_to_run) 2108 is_telemetry = bisect_utils.IsTelemetryCommand(command_to_run)
2106 if self.opts.target_platform == 'cros' and is_telemetry: 2109 if self.opts.target_platform == 'cros' and is_telemetry:
2107 args.append('--remote=%s' % self.opts.cros_remote_ip) 2110 args.append('--remote=%s' % self.opts.cros_remote_ip)
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
3905 # The perf dashboard scrapes the "results" step in order to comment on 3908 # The perf dashboard scrapes the "results" step in order to comment on
3906 # bugs. If you change this, please update the perf dashboard as well. 3909 # bugs. If you change this, please update the perf dashboard as well.
3907 bisect_utils.OutputAnnotationStepStart('Results') 3910 bisect_utils.OutputAnnotationStepStart('Results')
3908 print 'Error: %s' % e.message 3911 print 'Error: %s' % e.message
3909 if opts.output_buildbot_annotations: 3912 if opts.output_buildbot_annotations:
3910 bisect_utils.OutputAnnotationStepClosed() 3913 bisect_utils.OutputAnnotationStepClosed()
3911 return 1 3914 return 1
3912 3915
3913 if __name__ == '__main__': 3916 if __name__ == '__main__':
3914 sys.exit(main()) 3917 sys.exit(main())
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