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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 error = False | 496 error = False |
497 # Adding good and bad values to a parameter list. | 497 # Adding good and bad values to a parameter list. |
498 confidence_params = [] | 498 confidence_params = [] |
499 for l in [known_bad_value['values'], known_good_value['values']]: | 499 for l in [known_bad_value['values'], known_good_value['values']]: |
500 # Flatten if needed, by averaging the values in each nested list | 500 # Flatten if needed, by averaging the values in each nested list |
501 if isinstance(l, list) and all([isinstance(x, list) for x in l]): | 501 if isinstance(l, list) and all([isinstance(x, list) for x in l]): |
502 averages = map(math_utils.Mean, l) | 502 averages = map(math_utils.Mean, l) |
503 confidence_params.append(averages) | 503 confidence_params.append(averages) |
504 else: | 504 else: |
505 confidence_params.append(l) | 505 confidence_params.append(l) |
506 regression_confidence = BisectResults.ConfidenceScore(*confidence_params) | 506 regression_confidence = BisectResults.ConfidenceScore( |
| 507 *confidence_params, accept_single_bad_or_good=True) |
507 if regression_confidence < REGRESSION_CONFIDENCE: | 508 if regression_confidence < REGRESSION_CONFIDENCE: |
508 error = REGRESSION_CONFIDENCE_ERROR_TEMPLATE.format( | 509 error = REGRESSION_CONFIDENCE_ERROR_TEMPLATE.format( |
509 good_rev=good_revision, | 510 good_rev=good_revision, |
510 good_mean=known_good_value['mean'], | 511 good_mean=known_good_value['mean'], |
511 good_std_err=known_good_value['std_err'], | 512 good_std_err=known_good_value['std_err'], |
512 good_sample_size=len(known_good_value['values']), | 513 good_sample_size=len(known_good_value['values']), |
513 bad_rev=bad_revision, | 514 bad_rev=bad_revision, |
514 bad_mean=known_bad_value['mean'], | 515 bad_mean=known_bad_value['mean'], |
515 bad_std_err=known_bad_value['std_err'], | 516 bad_std_err=known_bad_value['std_err'], |
516 bad_sample_size=len(known_bad_value['values'])) | 517 bad_sample_size=len(known_bad_value['values'])) |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 return build_success | 1212 return build_success |
1212 | 1213 |
1213 def RunGClientHooks(self): | 1214 def RunGClientHooks(self): |
1214 """Runs gclient with runhooks command. | 1215 """Runs gclient with runhooks command. |
1215 | 1216 |
1216 Returns: | 1217 Returns: |
1217 True if gclient reports no errors. | 1218 True if gclient reports no errors. |
1218 """ | 1219 """ |
1219 if self.opts.debug_ignore_build: | 1220 if self.opts.debug_ignore_build: |
1220 return True | 1221 return True |
| 1222 # Some "runhooks" calls create symlinks that other (older?) versions |
| 1223 # do not handle correctly causing the build to fail. We want to avoid |
| 1224 # clearing the entire out/ directory so that changes close together will |
| 1225 # build faster so we just clear out all symlinks on the expectation that |
| 1226 # the next "runhooks" call will recreate everything properly. Ignore |
| 1227 # failures (like Windows that doesn't have "find"). |
| 1228 try: |
| 1229 bisect_utils.RunProcess( |
| 1230 ['find', 'out/', '-type', 'l', '-exec', 'rm', '-f', '{}', ';'], |
| 1231 cwd=self.src_cwd, shell=False) |
| 1232 except OSError: |
| 1233 pass |
1221 return not bisect_utils.RunGClient(['runhooks'], cwd=self.src_cwd) | 1234 return not bisect_utils.RunGClient(['runhooks'], cwd=self.src_cwd) |
1222 | 1235 |
1223 def _IsBisectModeUsingMetric(self): | 1236 def _IsBisectModeUsingMetric(self): |
1224 return self.opts.bisect_mode in [bisect_utils.BISECT_MODE_MEAN, | 1237 return self.opts.bisect_mode in [bisect_utils.BISECT_MODE_MEAN, |
1225 bisect_utils.BISECT_MODE_STD_DEV] | 1238 bisect_utils.BISECT_MODE_STD_DEV] |
1226 | 1239 |
1227 def _IsBisectModeReturnCode(self): | 1240 def _IsBisectModeReturnCode(self): |
1228 return self.opts.bisect_mode in [bisect_utils.BISECT_MODE_RETURN_CODE] | 1241 return self.opts.bisect_mode in [bisect_utils.BISECT_MODE_RETURN_CODE] |
1229 | 1242 |
1230 def _IsBisectModeStandardDeviation(self): | 1243 def _IsBisectModeStandardDeviation(self): |
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2879 # bugs. If you change this, please update the perf dashboard as well. | 2892 # bugs. If you change this, please update the perf dashboard as well. |
2880 bisect_utils.OutputAnnotationStepStart('Results') | 2893 bisect_utils.OutputAnnotationStepStart('Results') |
2881 print 'Runtime Error: %s' % e | 2894 print 'Runtime Error: %s' % e |
2882 if opts.output_buildbot_annotations: | 2895 if opts.output_buildbot_annotations: |
2883 bisect_utils.OutputAnnotationStepClosed() | 2896 bisect_utils.OutputAnnotationStepClosed() |
2884 return 1 | 2897 return 1 |
2885 | 2898 |
2886 | 2899 |
2887 if __name__ == '__main__': | 2900 if __name__ == '__main__': |
2888 sys.exit(main()) | 2901 sys.exit(main()) |
OLD | NEW |