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

Unified Diff: tools/auto_bisect/bisect_perf_regression_test.py

Issue 661803003: Revert of Refactor source_control.py and add a test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/auto_bisect/bisect_perf_regression.py ('k') | tools/auto_bisect/bisect_results.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/auto_bisect/bisect_perf_regression_test.py
diff --git a/tools/auto_bisect/bisect_perf_regression_test.py b/tools/auto_bisect/bisect_perf_regression_test.py
index a4ba38984571be69f262544743ab66e13beb6708..0e56e443e1afe033effa13f89faf2d72cf4a64f1 100644
--- a/tools/auto_bisect/bisect_perf_regression_test.py
+++ b/tools/auto_bisect/bisect_perf_regression_test.py
@@ -14,7 +14,7 @@
import bisect_perf_regression
import bisect_results
import mock
-import source_control
+import source_control as source_control_module
def _GetBisectPerformanceMetricsInstance():
@@ -29,8 +29,10 @@
'bad_revision': 280005,
}
bisect_options = bisect_perf_regression.BisectOptions.FromDict(options_dict)
+ source_control = source_control_module.DetermineAndCreateSourceControl(
+ bisect_options)
bisect_instance = bisect_perf_regression.BisectPerformanceMetrics(
- bisect_options)
+ source_control, bisect_options)
return bisect_instance
@@ -205,10 +207,12 @@
"""
bisect_options = bisect_perf_regression.BisectOptions()
bisect_options.output_buildbot_annotations = None
+ source_control = source_control_module.DetermineAndCreateSourceControl(
+ bisect_options)
bisect_instance = bisect_perf_regression.BisectPerformanceMetrics(
- bisect_options)
+ source_control, bisect_options)
bisect_instance.opts.target_platform = target_platform
- git_revision = source_control.ResolveToRevision(
+ git_revision = bisect_instance.source_control.ResolveToRevision(
revision, 'chromium', bisect_perf_regression.DEPOT_DEPS_NAME, 100)
depot = 'chromium'
command = bisect_instance.GetCompatibleCommand(
@@ -271,25 +275,30 @@
shutil.rmtree = old_rmtree
def testGetCommitPosition(self):
+ bisect_instance = _GetBisectPerformanceMetricsInstance()
cp_git_rev = '7017a81991de983e12ab50dfc071c70e06979531'
- self.assertEqual(291765, source_control.GetCommitPosition(cp_git_rev))
+ self.assertEqual(
+ 291765, bisect_instance.source_control.GetCommitPosition(cp_git_rev))
svn_git_rev = 'e6db23a037cad47299a94b155b95eebd1ee61a58'
- self.assertEqual(291467, source_control.GetCommitPosition(svn_git_rev))
+ self.assertEqual(
+ 291467, bisect_instance.source_control.GetCommitPosition(svn_git_rev))
def testGetCommitPositionForV8(self):
bisect_instance = _GetBisectPerformanceMetricsInstance()
v8_rev = '21d700eedcdd6570eff22ece724b63a5eefe78cb'
depot_path = os.path.join(bisect_instance.src_cwd, 'v8')
self.assertEqual(
- 23634, source_control.GetCommitPosition(v8_rev, depot_path))
+ 23634,
+ bisect_instance.source_control.GetCommitPosition(v8_rev, depot_path))
def testGetCommitPositionForWebKit(self):
bisect_instance = _GetBisectPerformanceMetricsInstance()
wk_rev = 'a94d028e0f2c77f159b3dac95eb90c3b4cf48c61'
depot_path = os.path.join(bisect_instance.src_cwd, 'third_party', 'WebKit')
self.assertEqual(
- 181660, source_control.GetCommitPosition(wk_rev, depot_path))
+ 181660,
+ bisect_instance.source_control.GetCommitPosition(wk_rev, depot_path))
def testUpdateDepsContent(self):
bisect_instance = _GetBisectPerformanceMetricsInstance()
« no previous file with comments | « tools/auto_bisect/bisect_perf_regression.py ('k') | tools/auto_bisect/bisect_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698