Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 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 """Chromium auto-bisect tool | 6 """Chromium auto-bisect tool |
| 7 | 7 |
| 8 This script bisects a range of commits using binary search. It starts by getting | 8 This script bisects a range of commits using binary search. It starts by getting |
| 9 reference values for the specified "good" and "bad" commits. Then, for revisions | 9 reference values for the specified "good" and "bad" commits. Then, for revisions |
| 10 in between, it will get builds, run tests and classify intermediate revisions as | 10 in between, it will get builds, run tests and classify intermediate revisions as |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1171 | 1171 |
| 1172 build_success = False | 1172 build_success = False |
| 1173 cwd = os.getcwd() | 1173 cwd = os.getcwd() |
| 1174 os.chdir(self.src_cwd) | 1174 os.chdir(self.src_cwd) |
| 1175 # Fetch build archive for the given revision from the cloud storage when | 1175 # Fetch build archive for the given revision from the cloud storage when |
| 1176 # the storage bucket is passed. | 1176 # the storage bucket is passed. |
| 1177 if self.IsDownloadable(depot) and revision: | 1177 if self.IsDownloadable(depot) and revision: |
| 1178 build_success = self._DownloadAndUnzipBuild( | 1178 build_success = self._DownloadAndUnzipBuild( |
| 1179 revision, depot, build_type='Release', create_patch=create_patch) | 1179 revision, depot, build_type='Release', create_patch=create_patch) |
| 1180 else: | 1180 else: |
| 1181 # Build locally. | 1181 # Print the current environment set on the machine. |
| 1182 print 'Full Environment:' | |
| 1183 for key, value in sorted(os.environ.items()): | |
| 1184 print '%s: %s' % (key, value) | |
|
qyearsley
2015/02/27 03:37:57
A possible alternative to using print would be usi
prasadv
2015/02/27 18:08:16
I tried using logging but output was delayed till
| |
| 1185 # Print the environment before proceeding with compile. | |
| 1186 sys.stdout.flush() | |
| 1182 build_success = self.builder.Build(depot, self.opts) | 1187 build_success = self.builder.Build(depot, self.opts) |
| 1183 os.chdir(cwd) | 1188 os.chdir(cwd) |
| 1184 return build_success | 1189 return build_success |
| 1185 | 1190 |
| 1186 def RunGClientHooks(self): | 1191 def RunGClientHooks(self): |
| 1187 """Runs gclient with runhooks command. | 1192 """Runs gclient with runhooks command. |
| 1188 | 1193 |
| 1189 Returns: | 1194 Returns: |
| 1190 True if gclient reports no errors. | 1195 True if gclient reports no errors. |
| 1191 """ | 1196 """ |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2724 for k, v in values.iteritems(): | 2729 for k, v in values.iteritems(): |
| 2725 assert hasattr(opts, k), 'Invalid %s attribute in BisectOptions.' % k | 2730 assert hasattr(opts, k), 'Invalid %s attribute in BisectOptions.' % k |
| 2726 setattr(opts, k, v) | 2731 setattr(opts, k, v) |
| 2727 | 2732 |
| 2728 if opts.metric and opts.bisect_mode != bisect_utils.BISECT_MODE_RETURN_CODE: | 2733 if opts.metric and opts.bisect_mode != bisect_utils.BISECT_MODE_RETURN_CODE: |
| 2729 metric_values = opts.metric.split('/') | 2734 metric_values = opts.metric.split('/') |
| 2730 if len(metric_values) != 2: | 2735 if len(metric_values) != 2: |
| 2731 raise RuntimeError('Invalid metric specified: [%s]' % opts.metric) | 2736 raise RuntimeError('Invalid metric specified: [%s]' % opts.metric) |
| 2732 opts.metric = metric_values | 2737 opts.metric = metric_values |
| 2733 | 2738 |
| 2739 if opts.target_arch == 'x64' and opts.target_build_type == 'Release': | |
| 2740 opts.target_build_type = 'Release_x64' | |
| 2734 opts.repeat_test_count = min(max(opts.repeat_test_count, 1), 100) | 2741 opts.repeat_test_count = min(max(opts.repeat_test_count, 1), 100) |
| 2735 opts.max_time_minutes = min(max(opts.max_time_minutes, 1), 60) | 2742 opts.max_time_minutes = min(max(opts.max_time_minutes, 1), 60) |
| 2736 opts.truncate_percent = min(max(opts.truncate_percent, 0), 25) | 2743 opts.truncate_percent = min(max(opts.truncate_percent, 0), 25) |
| 2737 opts.truncate_percent = opts.truncate_percent / 100.0 | 2744 opts.truncate_percent = opts.truncate_percent / 100.0 |
| 2738 | 2745 |
| 2739 return opts | 2746 return opts |
| 2740 | 2747 |
| 2741 | 2748 |
| 2742 def _ConfigureLogging(): | 2749 def _ConfigureLogging(): |
| 2743 """Trivial logging config. | 2750 """Trivial logging config. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2816 # bugs. If you change this, please update the perf dashboard as well. | 2823 # bugs. If you change this, please update the perf dashboard as well. |
| 2817 bisect_utils.OutputAnnotationStepStart('Results') | 2824 bisect_utils.OutputAnnotationStepStart('Results') |
| 2818 print 'Runtime Error: %s' % e | 2825 print 'Runtime Error: %s' % e |
| 2819 if opts.output_buildbot_annotations: | 2826 if opts.output_buildbot_annotations: |
| 2820 bisect_utils.OutputAnnotationStepClosed() | 2827 bisect_utils.OutputAnnotationStepClosed() |
| 2821 return 1 | 2828 return 1 |
| 2822 | 2829 |
| 2823 | 2830 |
| 2824 if __name__ == '__main__': | 2831 if __name__ == '__main__': |
| 2825 sys.exit(main()) | 2832 sys.exit(main()) |
| OLD | NEW |