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

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/bisector.py

Issue 1610203003: Iteratively increase sample size for good/bad classification. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Fixing multiple problems Created 4 years, 11 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
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 json 5 import json
6 import re 6 import re
7 7
8 from . import bisect_results 8 from . import bisect_results
9 from . import depot_config 9 from . import depot_config
10 from . import revision_state 10 from . import revision_state
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 self.good_rev.good = True 107 self.good_rev.good = True
108 self.good_rev.read_deps(self.get_perf_tester_name()) 108 self.good_rev.read_deps(self.get_perf_tester_name())
109 api.m.step.active_result.presentation.logs['Debug Good Revision DEPS'] = [ 109 api.m.step.active_result.presentation.logs['Debug Good Revision DEPS'] = [
110 '%s: %s' % (key, value) for key, value in 110 '%s: %s' % (key, value) for key, value in
111 self.good_rev.deps.iteritems()] 111 self.good_rev.deps.iteritems()]
112 self.good_rev.deps = {} 112 self.good_rev.deps = {}
113 self.lkgr = self.good_rev 113 self.lkgr = self.good_rev
114 if init_revisions: 114 if init_revisions:
115 self._expand_chromium_revision_range() 115 self._expand_chromium_revision_range()
116 116
117 def significantly_different(self, list_a, list_b,
118 significance_level=0.05): # pragma: no cover
119 step_result = self.api.m.python(
120 'Checking sample difference',
121 self.api.resource('significantly_different.py'),
122 [json.dumps(list_a), json.dumps(list_b), str(significance_level)],
123 stdout=self.api.m.json.output())
124 results = step_result.stdout
125 if results is None:
126 assert self.dummy_builds
127 return True
128 significantly_different = results['significantly_different']
129 step_result.presentation.logs[str(significantly_different)] = [
130 'See json.output for details']
qyearsley 2016/01/26 19:26:00 How will this show up on the build page? Will ther
RobertoCN 2016/02/01 17:29:50 https://goo.gl/photos/E9AuQkm9C8Mpjyvw7
131 return significantly_different
132
117 def config_step(self): 133 def config_step(self):
118 """Yields a simple echo step that outputs the bisect config.""" 134 """Yields a simple echo step that outputs the bisect config."""
119 api = self.api 135 api = self.api
120 # bisect_config may come as a FrozenDict (which is not serializable). 136 # bisect_config may come as a FrozenDict (which is not serializable).
121 bisect_config = dict(self.bisect_config) 137 bisect_config = dict(self.bisect_config)
122 138
123 def fix_windows_backslashes(s): 139 def fix_windows_backslashes(s):
124 backslash_regex = re.compile(r'(?<!\\)\\(?!\\)') 140 backslash_regex = re.compile(r'(?<!\\)\\(?!\\)')
125 return backslash_regex.sub(r'\\', s) 141 return backslash_regex.sub(r'\\', s)
126 142
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 def surface_result(self, result_string): 801 def surface_result(self, result_string):
786 assert result_string in VALID_RESULT_CODES 802 assert result_string in VALID_RESULT_CODES
787 prefix = 'B4T_' # To avoid collision. Stands for bisect (abbr. `a la i18n). 803 prefix = 'B4T_' # To avoid collision. Stands for bisect (abbr. `a la i18n).
788 result_code = prefix + result_string 804 result_code = prefix + result_string
789 assert len(result_code) <= 20 805 assert len(result_code) <= 20
790 if result_code not in self.result_codes: 806 if result_code not in self.result_codes:
791 self.result_codes.add(result_code) 807 self.result_codes.add(result_code)
792 properties = self.api.m.step.active_result.presentation.properties 808 properties = self.api.m.step.active_result.presentation.properties
793 properties['extra_result_code'] = sorted(self.result_codes) 809 properties['extra_result_code'] = sorted(self.result_codes)
794 810
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698