From 1d2dd72f60a44cf6e42fe21c7a602c721c81c542 Mon Sep 17 00:00:00 2001 From: prasadv Date: Thu, 16 Jul 2015 17:45:22 -0700 Subject: [PATCH] Make sure ChromePublic.apk is to run benchmarks for perf bisects, CQ and pert tryjobs.. This change ensures that the test command will use --browser=android-chromium (ChromePublic.apk) on android platform, benchmarks are not longer uses andorid-chrome-shell (ChromeShell.apk). BUG=503171 Review URL: https://codereview.chromium.org/1226273003 Cr-Commit-Position: refs/heads/master@{#339190} --- tools/auto_bisect/bisect_perf_regression.py | 34 ------------- tools/auto_bisect/bisect_perf_regression_test.py | 59 ---------------------- tools/auto_bisect/builder.py | 9 +++- .../configs/android.perf_test.sunspider.cfg | 2 +- tools/auto_bisect/configs/try.py | 2 - tools/run-bisect-perf-regression.py | 17 +++++-- .../backends/remote/trybot_browser_finder.py | 2 +- .../remote/trybot_browser_finder_unittest.py | 2 +- 8 files changed, 24 insertions(+), 103 deletions(-) diff --git a/tools/auto_bisect/bisect_perf_regression.py b/tools/auto_bisect/bisect_perf_regression.py index 9539b68b9827..7fc16db51218 100755 --- a/tools/auto_bisect/bisect_perf_regression.py +++ b/tools/auto_bisect/bisect_perf_regression.py @@ -1238,37 +1238,6 @@ class BisectPerformanceMetrics(object): def _IsBisectModeStandardDeviation(self): return self.opts.bisect_mode in [bisect_utils.BISECT_MODE_STD_DEV] - def GetCompatibleCommand(self, command_to_run, revision, depot): - """Return a possibly modified test command depending on the revision. - - Prior to crrev.com/274857 *only* android-chromium-testshell - Then until crrev.com/276628 *both* (android-chromium-testshell and - android-chrome-shell) work. After that rev 276628 *only* - android-chrome-shell works. The bisect_perf_regression.py script should - handle these cases and set appropriate browser type based on revision. - """ - if self.opts.target_platform in ['android']: - # When its a third_party depot, get the chromium revision. - if depot != 'chromium': - revision = bisect_utils.CheckRunGit( - ['rev-parse', 'HEAD'], cwd=self.src_cwd).strip() - commit_position = source_control.GetCommitPosition(revision, - cwd=self.src_cwd) - if not commit_position: - return command_to_run - cmd_re = re.compile(r'--browser=(?P\S+)') - matches = cmd_re.search(command_to_run) - if bisect_utils.IsStringInt(commit_position) and matches: - cmd_browser = matches.group('browser_type') - if commit_position <= 274857 and cmd_browser == 'android-chrome-shell': - return command_to_run.replace(cmd_browser, - 'android-chromium-testshell') - elif (commit_position >= 276628 and - cmd_browser == 'android-chromium-testshell'): - return command_to_run.replace(cmd_browser, - 'android-chrome-shell') - return command_to_run - def RunPerformanceTestAndParseResults( self, command_to_run, metric, reset_on_first_run=False, upload_on_last_run=False, results_label=None, test_run_multiplier=1, @@ -1542,9 +1511,6 @@ class BisectPerformanceMetrics(object): BUILD_RESULT_FAIL) after_build_time = time.time() - # Possibly alter the command. - command = self.GetCompatibleCommand(command, revision, depot) - # Run the command and get the results. results = self.RunPerformanceTestAndParseResults( command, metric, test_run_multiplier=test_run_multiplier) diff --git a/tools/auto_bisect/bisect_perf_regression_test.py b/tools/auto_bisect/bisect_perf_regression_test.py index 6d96d817e69b..15c6833e0469 100644 --- a/tools/auto_bisect/bisect_perf_regression_test.py +++ b/tools/auto_bisect/bisect_perf_regression_test.py @@ -285,65 +285,6 @@ class BisectPerfRegressionTest(unittest.TestCase): self._AssertParseResult([], '{}kb') self._AssertParseResult([], '{XYZ}kb') - def _AssertCompatibleCommand( - self, expected_command, original_command, revision, target_platform): - """Tests the modification of the command that might be done. - - This modification to the command is done in order to get a Telemetry - command that works; before some revisions, the browser name that Telemetry - expects is different in some cases, but we want it to work anyway. - - Specifically, only for android: - After r276628, only android-chrome-shell works. - Prior to r274857, only android-chromium-testshell works. - In the range [274857, 276628], both work. - """ - bisect_options = bisect_perf_regression.BisectOptions() - bisect_options.output_buildbot_annotations = None - bisect_instance = bisect_perf_regression.BisectPerformanceMetrics( - bisect_options, os.getcwd()) - bisect_instance.opts.target_platform = target_platform - git_revision = source_control.ResolveToRevision( - revision, 'chromium', bisect_utils.DEPOT_DEPS_NAME, 100) - depot = 'chromium' - command = bisect_instance.GetCompatibleCommand( - original_command, git_revision, depot) - self.assertEqual(expected_command, command) - - def testGetCompatibleCommand_ChangeToTestShell(self): - # For revisions <= r274857, only android-chromium-testshell is used. - self._AssertCompatibleCommand( - 'tools/perf/run_benchmark -v --browser=android-chromium-testshell foo', - 'tools/perf/run_benchmark -v --browser=android-chrome-shell foo', - 274857, 'android') - - def testGetCompatibleCommand_ChangeToShell(self): - # For revisions >= r276728, only android-chrome-shell can be used. - self._AssertCompatibleCommand( - 'tools/perf/run_benchmark -v --browser=android-chrome-shell foo', - 'tools/perf/run_benchmark -v --browser=android-chromium-testshell foo', - 276628, 'android') - - def testGetCompatibleCommand_NoChange(self): - # For revisions < r276728, android-chromium-testshell can be used. - self._AssertCompatibleCommand( - 'tools/perf/run_benchmark -v --browser=android-chromium-testshell foo', - 'tools/perf/run_benchmark -v --browser=android-chromium-testshell foo', - 274858, 'android') - # For revisions > r274857, android-chrome-shell can be used. - self._AssertCompatibleCommand( - 'tools/perf/run_benchmark -v --browser=android-chrome-shell foo', - 'tools/perf/run_benchmark -v --browser=android-chrome-shell foo', - 274858, 'android') - - def testGetCompatibleCommand_NonAndroidPlatform(self): - # In most cases, there's no need to change Telemetry command. - # For revisions >= r276728, only android-chrome-shell can be used. - self._AssertCompatibleCommand( - 'tools/perf/run_benchmark -v --browser=release foo', - 'tools/perf/run_benchmark -v --browser=release foo', - 276628, 'chromium') - # This method doesn't reference self; it fails if an error is thrown. # pylint: disable=R0201 def testDryRun(self): diff --git a/tools/auto_bisect/builder.py b/tools/auto_bisect/builder.py index 9a9308960872..97b01f7d82f7 100644 --- a/tools/auto_bisect/builder.py +++ b/tools/auto_bisect/builder.py @@ -145,10 +145,17 @@ class AndroidBuilder(Builder): # TODO(qyearsley): Make this a class method and verify that it works with # a unit test. + # TODO (prasadv): Remove android-chrome-shell target once we confirm there are + # no pending bisect jobs with this in command. # pylint: disable=R0201 def _GetTargets(self): """Returns a list of build targets.""" - return ['chrome_shell_apk', 'cc_perftests_apk', 'android_tools'] + return [ + 'chrome_public_apk', + 'chrome_shell_apk', + 'cc_perftests_apk', + 'android_tools' + ] def Build(self, depot, opts): """Builds the android content shell and other necessary tools. diff --git a/tools/auto_bisect/configs/android.perf_test.sunspider.cfg b/tools/auto_bisect/configs/android.perf_test.sunspider.cfg index 16c0ecef54cf..87238fcdf9be 100644 --- a/tools/auto_bisect/configs/android.perf_test.sunspider.cfg +++ b/tools/auto_bisect/configs/android.perf_test.sunspider.cfg @@ -2,7 +2,7 @@ # http://build.chromium.org/p/tryserver.chromium.perf/builders/linux_perf_bisect/builds/689 config = { - 'command': 'tools/perf/run_benchmark -v --browser=android-chrome-shell sunspider', + 'command': 'tools/perf/run_benchmark -v --browser=android-chromium sunspider', "max_time_minutes": "10", "repeat_count": "1", "truncate_percent": "0" diff --git a/tools/auto_bisect/configs/try.py b/tools/auto_bisect/configs/try.py index 0e2dd8de4b21..e34593fb7f33 100755 --- a/tools/auto_bisect/configs/try.py +++ b/tools/auto_bisect/configs/try.py @@ -33,11 +33,9 @@ PLATFORM_BOT_MAP = { 'win': ['win_perf_bisect', 'win_8_perf_bisect', 'win_xp_perf_bisect'], 'winx64': ['win_x64_perf_bisect'], 'android': [ - 'android_gn_perf_bisect', 'android_nexus4_perf_bisect', 'android_nexus5_perf_bisect', 'android_nexus7_perf_bisect', - 'android_nexus10_perf_bisect', ], } SVN_URL = 'svn://svn.chromium.org/chrome-try/try-perf' diff --git a/tools/run-bisect-perf-regression.py b/tools/run-bisect-perf-regression.py index b0fdf4c51962..27c0c7755d36 100755 --- a/tools/run-bisect-perf-regression.py +++ b/tools/run-bisect-perf-regression.py @@ -228,7 +228,10 @@ def _CreateBisectOptionsFromConfig(config): raise RuntimeError('CrOS build selected, but BISECT_CROS_IP or' 'BISECT_CROS_BOARD undefined.') elif 'android' in config['command']: - if 'android-chrome-shell' in config['command']: + # TODO (prasadv): Remove android-chrome-shell check once we confirm that + # there are no pending bisect jobs with this in command. + if any(item in config['command'] + for item in ['android-chrome-shell', 'android-chromium']): opts_dict['target_platform'] = 'android' elif 'android-chrome' in config['command']: opts_dict['target_platform'] = 'android-chrome' @@ -528,7 +531,10 @@ def _RunBisectionScript( # Possibly set the target platform name based on the browser name in a # Telemetry command. - if 'android-chrome-shell' in config['command']: + # TODO (prasadv): Remove android-chrome-shell check once we confirm there are + # no pending bisect jobs with this in command. + if any(item in config['command'] + for item in ['android-chrome-shell', 'android-chromium']): cmd.extend(['--target_platform', 'android']) elif 'android-chrome' in config['command']: cmd.extend(['--target_platform', 'android-chrome']) @@ -583,7 +589,7 @@ def _PrintConfigStep(config): def _GetBrowserType(bot_platform): """Gets the browser type to be used in the run benchmark command.""" if bot_platform == 'android': - return 'android-chrome-shell' + return 'android-chromium' elif 'x64' in bot_platform: return 'release_x64' @@ -621,7 +627,10 @@ def _GetConfigBasedOnPlatform(config, bot_name, test_name): opts_dict['use_goma'] = config['use_goma'] if 'goma_dir' in config: opts_dict['goma_dir'] = config['goma_dir'] - if 'android-chrome-shell' in opts_dict['command']: + # TODO (prasadv): Remove android-chrome-shell check once we confirm there are + # no pending bisect jobs with this in command. + if any(item in opts_dict['command'] + for item in ['android-chrome-shell', 'android-chromium']): opts_dict['target_platform'] = 'android' return bisect_perf_regression.BisectOptions.FromDict(opts_dict) diff --git a/tools/telemetry/telemetry/internal/backends/remote/trybot_browser_finder.py b/tools/telemetry/telemetry/internal/backends/remote/trybot_browser_finder.py index b68bd549108f..b9eeac65f68a 100644 --- a/tools/telemetry/telemetry/internal/backends/remote/trybot_browser_finder.py +++ b/tools/telemetry/telemetry/internal/backends/remote/trybot_browser_finder.py @@ -151,7 +151,7 @@ class PossibleTrybotBrowser(possible_browser.PossibleBrowser): for index, arg in enumerate(arguments): if arg.startswith('--browser='): if bot_platform == 'android': - arguments[index] = '--browser=android-chrome-shell' + arguments[index] = '--browser=android-chromium' elif any('x64' in bot for bot in self._builder_names[bot_platform]): arguments[index] = '--browser=release_x64' target_arch = 'x64' diff --git a/tools/telemetry/telemetry/internal/backends/remote/trybot_browser_finder_unittest.py b/tools/telemetry/telemetry/internal/backends/remote/trybot_browser_finder_unittest.py index e1f707acf064..bcec0feb384c 100644 --- a/tools/telemetry/telemetry/internal/backends/remote/trybot_browser_finder_unittest.py +++ b/tools/telemetry/telemetry/internal/backends/remote/trybot_browser_finder_unittest.py @@ -349,7 +349,7 @@ class TrybotBrowserFinderTest(unittest.TestCase): self.assertEquals( ('config = {\n' ' "command": "./tools/perf/run_benchmark ' - '--browser=android-chrome-shell sunspider",\n' + '--browser=android-chromium sunspider",\n' ' "max_time_minutes": "120",\n' ' "repeat_count": "1",\n' ' "target_arch": "ia32",\n' -- 2.11.4.GIT