| Index: tools/auto_bisect/bisect_perf_regression_test.py
|
| diff --git a/tools/bisect-perf-regression_test.py b/tools/auto_bisect/bisect_perf_regression_test.py
|
| similarity index 92%
|
| rename from tools/bisect-perf-regression_test.py
|
| rename to tools/auto_bisect/bisect_perf_regression_test.py
|
| index b91179216293505e5d893d6fa4c0c8a238324a94..d25992d18adf04272348130d85d096b1b2374aa0 100644
|
| --- a/tools/bisect-perf-regression_test.py
|
| +++ b/tools/auto_bisect/bisect_perf_regression_test.py
|
| @@ -6,10 +6,9 @@ import os
|
| import re
|
| import unittest
|
|
|
| -from auto_bisect import source_control as source_control_module
|
| +import bisect_perf_regression
|
| +import source_control as source_control_module
|
|
|
| -# Special import necessary because filename contains dash characters.
|
| -bisect_perf_module = __import__('bisect-perf-regression')
|
|
|
| def _GetBisectPerformanceMetricsInstance():
|
| """Returns an instance of the BisectPerformanceMetrics class."""
|
| @@ -22,13 +21,11 @@ def _GetBisectPerformanceMetricsInstance():
|
| 'good_revision': 280000,
|
| 'bad_revision': 280005,
|
| }
|
| - bisect_options = bisect_perf_module.BisectOptions.FromDict(options_dict)
|
| + bisect_options = bisect_perf_regression.BisectOptions.FromDict(options_dict)
|
| source_control = source_control_module.DetermineAndCreateSourceControl(
|
| bisect_options)
|
| - bisect_instance = bisect_perf_module.BisectPerformanceMetrics(
|
| + bisect_instance = bisect_perf_regression.BisectPerformanceMetrics(
|
| source_control, bisect_options)
|
| - bisect_instance.src_cwd = os.path.abspath(
|
| - os.path.join(os.path.dirname(__file__), os.path.pardir))
|
| return bisect_instance
|
|
|
|
|
| @@ -49,7 +46,7 @@ class BisectPerfRegressionTest(unittest.TestCase):
|
| """
|
| # ConfidenceScore takes a list of lists but these lists are flattened
|
| # inside the function.
|
| - confidence = bisect_perf_module.ConfidenceScore(
|
| + confidence = bisect_perf_regression.ConfidenceScore(
|
| [[v] for v in bad_values],
|
| [[v] for v in good_values])
|
| self.assertEqual(score, confidence)
|
| @@ -128,7 +125,7 @@ class BisectPerfRegressionTest(unittest.TestCase):
|
| }
|
| # Testing private function.
|
| # pylint: disable=W0212
|
| - vars_dict = bisect_perf_module._ParseRevisionsFromDEPSFileManually(
|
| + vars_dict = bisect_perf_regression._ParseRevisionsFromDEPSFileManually(
|
| deps_file_contents)
|
| self.assertEqual(vars_dict, expected_vars_dict)
|
|
|
| @@ -140,7 +137,8 @@ class BisectPerfRegressionTest(unittest.TestCase):
|
| metric = ['my_chart', 'my_trace']
|
| # Testing private function.
|
| # pylint: disable=W0212
|
| - values = bisect_perf_module._TryParseResultValuesFromOutput(metric, results)
|
| + values = bisect_perf_regression._TryParseResultValuesFromOutput(
|
| + metric, results)
|
| self.assertEqual(expected_values, values)
|
|
|
| def testTryParseResultValuesFromOutput_WithSingleValue(self):
|
| @@ -192,15 +190,15 @@ class BisectPerfRegressionTest(unittest.TestCase):
|
| Prior to r274857, only android-chromium-testshell works.
|
| In the range [274857, 276628], both work.
|
| """
|
| - bisect_options = bisect_perf_module.BisectOptions()
|
| + bisect_options = bisect_perf_regression.BisectOptions()
|
| bisect_options.output_buildbot_annotations = None
|
| source_control = source_control_module.DetermineAndCreateSourceControl(
|
| bisect_options)
|
| - bisect_instance = bisect_perf_module.BisectPerformanceMetrics(
|
| + bisect_instance = bisect_perf_regression.BisectPerformanceMetrics(
|
| source_control, bisect_options)
|
| bisect_instance.opts.target_platform = target_platform
|
| git_revision = bisect_instance.source_control.ResolveToRevision(
|
| - revision, 'chromium', bisect_perf_module.DEPOT_DEPS_NAME, 100)
|
| + revision, 'chromium', bisect_perf_regression.DEPOT_DEPS_NAME, 100)
|
| depot = 'chromium'
|
| command = bisect_instance.GetCompatibleCommand(
|
| original_command, git_revision, depot)
|
| @@ -268,7 +266,7 @@ class BisectPerfRegressionTest(unittest.TestCase):
|
| def testGetCommitPositionForV8(self):
|
| bisect_instance = _GetBisectPerformanceMetricsInstance()
|
| v8_rev = '21d700eedcdd6570eff22ece724b63a5eefe78cb'
|
| - depot_path = os.path.join(bisect_instance.src_cwd, 'src', 'v8')
|
| + depot_path = os.path.join(bisect_perf_regression.SRC_DIR, 'v8')
|
| self.assertEqual(
|
| 23634,
|
| bisect_instance.source_control.GetCommitPosition(v8_rev, depot_path))
|
| @@ -276,7 +274,7 @@ class BisectPerfRegressionTest(unittest.TestCase):
|
| def testGetCommitPositionForWebKit(self):
|
| bisect_instance = _GetBisectPerformanceMetricsInstance()
|
| wk_rev = 'a94d028e0f2c77f159b3dac95eb90c3b4cf48c61'
|
| - depot_path = os.path.join(bisect_instance.src_cwd, 'src', 'third_party',
|
| + depot_path = os.path.join(bisect_perf_regression.SRC_DIR, 'third_party',
|
| 'WebKit')
|
| self.assertEqual(
|
| 181660,
|
| @@ -290,7 +288,7 @@ class BisectPerfRegressionTest(unittest.TestCase):
|
| # to search is not changed in DEPS content.
|
| # TODO (prasadv): Add a separate test to validate the DEPS contents with the
|
| # format that bisect script expects.
|
| - deps_contents = bisect_perf_module.ReadStringFromFile(deps_file)
|
| + deps_contents = bisect_perf_regression.ReadStringFromFile(deps_file)
|
| deps_key = 'v8_revision'
|
| depot = 'v8'
|
| git_revision = 'a12345789a23456789a123456789a123456789'
|
|
|