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

Side by Side Diff: tools/auto_bisect/bisect_results_test.py

Issue 850013004: Obtain confidence score based off last known good and first known bad revision results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 unittest 6 import unittest
7 7
8 from bisect_results import BisectResults 8 from bisect_results import BisectResults
9 import source_control 9 import source_control
10 10
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 self.assertEqual(1, len(results.warnings)) 220 self.assertEqual(1, len(results.warnings))
221 221
222 def testWarningForTooLowRetryLimit(self): 222 def testWarningForTooLowRetryLimit(self):
223 self.mock_opts.repeat_test_count = 1 223 self.mock_opts.repeat_test_count = 1
224 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, 224 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry,
225 self.mock_opts, self.mock_warnings) 225 self.mock_opts, self.mock_warnings)
226 self.assertEqual(1, len(results.warnings)) 226 self.assertEqual(1, len(results.warnings))
227 227
228 def testWarningForTooLowConfidence(self): 228 def testWarningForTooLowConfidence(self):
229 revision_states = self.mock_bisect_state.mock_revision_states 229 revision_states = self.mock_bisect_state.mock_revision_states
230 revision_states[2].value = {'values': [95, 100, 90]} 230 revision_states[2].value = {'values': [95, 90, 90]}
RobertoCN 2015/01/14 18:50:47 Because of the new way of obtaining the confidence
RobertoCN 2015/01/30 21:23:32 Done.
231 revision_states[3].value = {'values': [95, 100, 90]} 231 revision_states[3].value = {'values': [95, 90, 90]}
232 revision_states[4].value = {'values': [95, 100, 90]} 232 revision_states[4].value = {'values': [95, 90, 90]}
233 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, 233 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry,
234 self.mock_opts, self.mock_warnings) 234 self.mock_opts, self.mock_warnings)
235 self.assertGreater(results.confidence, 0) 235 self.assertGreater(results.confidence, 0)
236 self.assertEqual(1, len(results.warnings)) 236 self.assertEqual(1, len(results.warnings))
237 237
238 def testWarningForZeroConfidence(self): 238 def testWarningForZeroConfidence(self):
239 revision_states = self.mock_bisect_state.mock_revision_states 239 revision_states = self.mock_bisect_state.mock_revision_states
240 revision_states[2].value = {'values': [100, 105, 95]} 240 revision_states[2].value = {'values': [100, 105, 95]}
241 revision_states[3].value = {'values': [100, 105, 95]} 241 revision_states[3].value = {'values': [100, 105, 95]}
242 revision_states[4].value = {'values': [100, 105, 95]} 242 revision_states[4].value = {'values': [100, 105, 95]}
243 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, 243 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry,
244 self.mock_opts, self.mock_warnings) 244 self.mock_opts, self.mock_warnings)
245 self.assertEqual(0, results.confidence) 245 self.assertEqual(0, results.confidence)
246 self.assertEqual(1, len(results.warnings)) 246 self.assertEqual(1, len(results.warnings))
247 247
248 248
249 if __name__ == '__main__': 249 if __name__ == '__main__':
250 unittest.main() 250 unittest.main()
OLDNEW
« tools/auto_bisect/bisect_results.py ('K') | « tools/auto_bisect/bisect_results.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698