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

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

Issue 1779943002: Fix path error in getting depot dir. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « tools/auto_bisect/bisect_perf_regression.py ('k') | 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 # 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 re 6 import re
7 import shutil 7 import shutil
8 import sys 8 import sys
9 import unittest 9 import unittest
10 10
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 self.assertIsNone(results.error) 363 self.assertIsNone(results.error)
364 364
365 @mock.patch('urllib2.urlopen') 365 @mock.patch('urllib2.urlopen')
366 def testBisectResultsPosted(self, mock_urlopen): 366 def testBisectResultsPosted(self, mock_urlopen):
367 options_dict = dict(DEFAULT_OPTIONS) 367 options_dict = dict(DEFAULT_OPTIONS)
368 options_dict.update({ 368 options_dict.update({
369 'bisect_mode': bisect_utils.BISECT_MODE_MEAN, 369 'bisect_mode': bisect_utils.BISECT_MODE_MEAN,
370 'try_job_id': 1234, 370 'try_job_id': 1234,
371 }) 371 })
372 opts = bisect_perf_regression.BisectOptions.FromDict(options_dict) 372 opts = bisect_perf_regression.BisectOptions.FromDict(options_dict)
373 bisect_instance = _GetBisectPerformanceMetricsInstance(options_dict)
373 results = _SampleBisecResult(opts) 374 results = _SampleBisecResult(opts)
374 bisect_perf_regression._PostBisectResults(results, opts, os.getcwd()) 375 bisect_instance.PostBisectResults(results)
375 376
376 call_args = _GetMockCallArg(mock_urlopen, 0) 377 call_args = _GetMockCallArg(mock_urlopen, 0)
377 self.assertIsNotNone(call_args) 378 self.assertIsNotNone(call_args)
378 self.assertIn('"try_job_id": 1234', call_args[1]) 379 self.assertIn('"try_job_id": 1234', call_args[1])
379 380
380 def _CheckAbortsEarly(self, results, **extra_opts): 381 def _CheckAbortsEarly(self, results, **extra_opts):
381 """Returns True if the bisect job would abort early.""" 382 """Returns True if the bisect job would abort early."""
382 global _MockResultsGenerator 383 global _MockResultsGenerator
383 _MockResultsGenerator = (r for r in results) 384 _MockResultsGenerator = (r for r in results)
384 bisect_class = bisect_perf_regression.BisectPerformanceMetrics 385 bisect_class = bisect_perf_regression.BisectPerformanceMetrics
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 (None, 0)), 746 (None, 0)),
746 ] 747 ]
747 self._SetupRunGitMock(try_cmd) 748 self._SetupRunGitMock(try_cmd)
748 bisect_perf_regression._StartBuilderTryJob( 749 bisect_perf_regression._StartBuilderTryJob(
749 fetch_build.PERF_BUILDER, git_revision, bot_name, bisect_job_name, 750 fetch_build.PERF_BUILDER, git_revision, bot_name, bisect_job_name,
750 patch) 751 patch)
751 752
752 753
753 if __name__ == '__main__': 754 if __name__ == '__main__':
754 unittest.main() 755 unittest.main()
OLDNEW
« no previous file with comments | « tools/auto_bisect/bisect_perf_regression.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698