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 source_control = source_control_module.DetermineAndCreateSourceControl( bisect_options) 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_regression.DEPOT_DEPS_NAME, 100) depot = 'chromium' command = bisect_instance.GetCompatibleCommand(original_command, git_revision, depot) self.assertEqual(expected_command, command)
def _GetBisectPerformanceMetricsInstance(): """Returns an instance of the BisectPerformanceMetrics class.""" options_dict = { 'debug_ignore_build': True, 'debug_ignore_sync': True, 'debug_ignore_perf_test': True, 'command': 'fake_command', 'metric': 'fake/metric', 'good_revision': 280000, '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( source_control, bisect_options) return bisect_instance
def _GetBisectPerformanceMetricsInstance(options_dict): """Returns an instance of the BisectPerformanceMetrics class.""" opts = bisect_perf_regression.BisectOptions.FromDict(options_dict) return bisect_perf_regression.BisectPerformanceMetrics(opts, os.getcwd())