Commit 469ac374 authored by prasadv@chromium.org's avatar prasadv@chromium.org

Check for chromium revision instead of dependency module revision.

GetCompatibleCommand checks chromium revision to set appropriate browser type.
While processing 3rd party repositories by bisect, it was trying to compare dependency module
revision instead of chromium revision.

BUG=388411
NOTRY=true

Review URL: https://codereview.chromium.org/414893002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285103 0039d316-1c4b-4281-b951-d872f2087c98
parent 51766bfd
...@@ -2236,14 +2236,19 @@ class BisectPerformanceMetrics(object): ...@@ -2236,14 +2236,19 @@ class BisectPerformanceMetrics(object):
def _IsBisectModeStandardDeviation(self): def _IsBisectModeStandardDeviation(self):
return self.opts.bisect_mode in [BISECT_MODE_STD_DEV] return self.opts.bisect_mode in [BISECT_MODE_STD_DEV]
def GetCompatibleCommand(self, command_to_run, revision): def GetCompatibleCommand(self, command_to_run, revision, depot):
# Prior to crrev.com/274857 *only* android-chromium-testshell # Prior to crrev.com/274857 *only* android-chromium-testshell
# Then until crrev.com/276628 *both* (android-chromium-testshell and # Then until crrev.com/276628 *both* (android-chromium-testshell and
# android-chrome-shell) work. After that rev 276628 *only* # android-chrome-shell) work. After that rev 276628 *only*
# android-chrome-shell works. bisect-perf-reggresion.py script should # android-chrome-shell works. bisect-perf-reggresion.py script should
# handle these cases and set appropriate browser type based on revision. # handle these cases and set appropriate browser type based on revision.
if self.opts.target_platform in ['android', 'android-chrome']: if self.opts.target_platform in ['android']:
svn_revision = self.source_control.SVNFindRev(revision) # When its a third_party depot, get the chromium revision.
if depot != 'chromium':
revision = CheckRunGit(['rev-parse', 'HEAD'], cwd=self.src_cwd).strip()
svn_revision = self.source_control.SVNFindRev(revision, cwd=self.src_cwd)
if not svn_revision:
return command_to_run
cmd_re = re.compile('--browser=(?P<browser_type>\S+)') cmd_re = re.compile('--browser=(?P<browser_type>\S+)')
matches = cmd_re.search(command_to_run) matches = cmd_re.search(command_to_run)
if IsStringInt(svn_revision) and matches: if IsStringInt(svn_revision) and matches:
...@@ -2639,7 +2644,8 @@ class BisectPerformanceMetrics(object): ...@@ -2639,7 +2644,8 @@ class BisectPerformanceMetrics(object):
if self.BuildCurrentRevision(depot, revision): if self.BuildCurrentRevision(depot, revision):
after_build_time = time.time() after_build_time = time.time()
# Hack to support things that got changed. # Hack to support things that got changed.
command_to_run = self.GetCompatibleCommand(command_to_run, revision) command_to_run = self.GetCompatibleCommand(
command_to_run, revision, depot)
results = self.RunPerformanceTestAndParseResults(command_to_run, results = self.RunPerformanceTestAndParseResults(command_to_run,
metric) metric)
# Restore build output directory once the tests are done, to avoid # Restore build output directory once the tests are done, to avoid
......
...@@ -247,6 +247,7 @@ vars = { ...@@ -247,6 +247,7 @@ vars = {
bisect_instance = bisect_perf_module.BisectPerformanceMetrics( bisect_instance = bisect_perf_module.BisectPerformanceMetrics(
source_control, bisect_options) source_control, bisect_options)
bisect_instance.opts.target_platform = 'android' bisect_instance.opts.target_platform = 'android'
depot = 'chromium'
# android-chrome-shell -> android-chromium-testshell # android-chrome-shell -> android-chromium-testshell
revision = 274857 revision = 274857
git_revision = bisect_instance.source_control.ResolveToRevision( git_revision = bisect_instance.source_control.ResolveToRevision(
...@@ -256,7 +257,7 @@ vars = { ...@@ -256,7 +257,7 @@ vars = {
expected_command = ('tools/perf/run_benchmark -v --browser=' expected_command = ('tools/perf/run_benchmark -v --browser='
'android-chromium-testshell page_cycler.intl_ja_zh') 'android-chromium-testshell page_cycler.intl_ja_zh')
self.assertEqual( self.assertEqual(
bisect_instance.GetCompatibleCommand(command, git_revision), bisect_instance.GetCompatibleCommand(command, git_revision, depot),
expected_command) expected_command)
# android-chromium-testshell -> android-chromium-testshell # android-chromium-testshell -> android-chromium-testshell
...@@ -268,7 +269,7 @@ vars = { ...@@ -268,7 +269,7 @@ vars = {
expected_command = ('tools/perf/run_benchmark -v --browser=' expected_command = ('tools/perf/run_benchmark -v --browser='
'android-chromium-testshell page_cycler.intl_ja_zh') 'android-chromium-testshell page_cycler.intl_ja_zh')
self.assertEqual( self.assertEqual(
bisect_instance.GetCompatibleCommand(command, git_revision), bisect_instance.GetCompatibleCommand(command, git_revision, depot),
expected_command) expected_command)
# android-chromium-testshell -> android-chrome-shell # android-chromium-testshell -> android-chrome-shell
...@@ -280,7 +281,7 @@ vars = { ...@@ -280,7 +281,7 @@ vars = {
expected_command = ('tools/perf/run_benchmark -v --browser=' expected_command = ('tools/perf/run_benchmark -v --browser='
'android-chrome-shell page_cycler.intl_ja_zh') 'android-chrome-shell page_cycler.intl_ja_zh')
self.assertEqual( self.assertEqual(
bisect_instance.GetCompatibleCommand(command, git_revision), bisect_instance.GetCompatibleCommand(command, git_revision, depot),
expected_command) expected_command)
# android-chrome-shell -> android-chrome-shell # android-chrome-shell -> android-chrome-shell
command = ('tools/perf/run_benchmark -v ' command = ('tools/perf/run_benchmark -v '
...@@ -288,7 +289,7 @@ vars = { ...@@ -288,7 +289,7 @@ vars = {
expected_command = ('tools/perf/run_benchmark -v --browser=' expected_command = ('tools/perf/run_benchmark -v --browser='
'android-chrome-shell page_cycler.intl_ja_zh') 'android-chrome-shell page_cycler.intl_ja_zh')
self.assertEqual( self.assertEqual(
bisect_instance.GetCompatibleCommand(command, git_revision), bisect_instance.GetCompatibleCommand(command, git_revision, depot),
expected_command) expected_command)
# Not android platform # Not android platform
bisect_instance.opts.target_platform = 'chromium' bisect_instance.opts.target_platform = 'chromium'
...@@ -297,7 +298,7 @@ vars = { ...@@ -297,7 +298,7 @@ vars = {
expected_command = ('tools/perf/run_benchmark -v --browser=' expected_command = ('tools/perf/run_benchmark -v --browser='
'release page_cycler.intl_ja_zh') 'release page_cycler.intl_ja_zh')
self.assertEqual( self.assertEqual(
bisect_instance.GetCompatibleCommand(command, git_revision), bisect_instance.GetCompatibleCommand(command, git_revision, depot),
expected_command) expected_command)
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment