OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import math | 5 import math |
6 import unittest | 6 import unittest |
7 | 7 |
8 # Special import necessary because filename contains dash characters. | 8 # Special import necessary because filename contains dash characters. |
9 bisect_perf_module = __import__('bisect-perf-regression') | 9 bisect_perf_module = __import__('bisect-perf-regression') |
10 | 10 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 metrics, RESULTS_OUTPUT % {'value': '{XYZ}kb'})) | 240 metrics, RESULTS_OUTPUT % {'value': '{XYZ}kb'})) |
241 | 241 |
242 def testGetCompatibleCommand(self): | 242 def testGetCompatibleCommand(self): |
243 bisect_options = bisect_perf_module.BisectOptions() | 243 bisect_options = bisect_perf_module.BisectOptions() |
244 bisect_options.output_buildbot_annotations = None | 244 bisect_options.output_buildbot_annotations = None |
245 source_control = bisect_perf_module.DetermineAndCreateSourceControl( | 245 source_control = bisect_perf_module.DetermineAndCreateSourceControl( |
246 bisect_options) | 246 bisect_options) |
247 bisect_instance = bisect_perf_module.BisectPerformanceMetrics( | 247 bisect_instance = bisect_perf_module.BisectPerformanceMetrics( |
248 source_control, bisect_options) | 248 source_control, bisect_options) |
249 bisect_instance.opts.target_platform = 'android' | 249 bisect_instance.opts.target_platform = 'android' |
| 250 depot = 'chromium' |
250 # android-chrome-shell -> android-chromium-testshell | 251 # android-chrome-shell -> android-chromium-testshell |
251 revision = 274857 | 252 revision = 274857 |
252 git_revision = bisect_instance.source_control.ResolveToRevision( | 253 git_revision = bisect_instance.source_control.ResolveToRevision( |
253 revision, 'chromium', 100) | 254 revision, 'chromium', 100) |
254 command = ('tools/perf/run_benchmark -v ' | 255 command = ('tools/perf/run_benchmark -v ' |
255 '--browser=android-chrome-shell page_cycler.intl_ja_zh') | 256 '--browser=android-chrome-shell page_cycler.intl_ja_zh') |
256 expected_command = ('tools/perf/run_benchmark -v --browser=' | 257 expected_command = ('tools/perf/run_benchmark -v --browser=' |
257 'android-chromium-testshell page_cycler.intl_ja_zh') | 258 'android-chromium-testshell page_cycler.intl_ja_zh') |
258 self.assertEqual( | 259 self.assertEqual( |
259 bisect_instance.GetCompatibleCommand(command, git_revision), | 260 bisect_instance.GetCompatibleCommand(command, git_revision, depot), |
260 expected_command) | 261 expected_command) |
261 | 262 |
262 # android-chromium-testshell -> android-chromium-testshell | 263 # android-chromium-testshell -> android-chromium-testshell |
263 revision = 274858 | 264 revision = 274858 |
264 git_revision = bisect_instance.source_control.ResolveToRevision( | 265 git_revision = bisect_instance.source_control.ResolveToRevision( |
265 revision, 'chromium', 100) | 266 revision, 'chromium', 100) |
266 command = ('tools/perf/run_benchmark -v ' | 267 command = ('tools/perf/run_benchmark -v ' |
267 '--browser=android-chromium-testshell page_cycler.intl_ja_zh') | 268 '--browser=android-chromium-testshell page_cycler.intl_ja_zh') |
268 expected_command = ('tools/perf/run_benchmark -v --browser=' | 269 expected_command = ('tools/perf/run_benchmark -v --browser=' |
269 'android-chromium-testshell page_cycler.intl_ja_zh') | 270 'android-chromium-testshell page_cycler.intl_ja_zh') |
270 self.assertEqual( | 271 self.assertEqual( |
271 bisect_instance.GetCompatibleCommand(command, git_revision), | 272 bisect_instance.GetCompatibleCommand(command, git_revision, depot), |
272 expected_command) | 273 expected_command) |
273 | 274 |
274 # android-chromium-testshell -> android-chrome-shell | 275 # android-chromium-testshell -> android-chrome-shell |
275 revision = 276628 | 276 revision = 276628 |
276 git_revision = bisect_instance.source_control.ResolveToRevision( | 277 git_revision = bisect_instance.source_control.ResolveToRevision( |
277 revision, 'chromium', 100) | 278 revision, 'chromium', 100) |
278 command = ('tools/perf/run_benchmark -v ' | 279 command = ('tools/perf/run_benchmark -v ' |
279 '--browser=android-chromium-testshell page_cycler.intl_ja_zh') | 280 '--browser=android-chromium-testshell page_cycler.intl_ja_zh') |
280 expected_command = ('tools/perf/run_benchmark -v --browser=' | 281 expected_command = ('tools/perf/run_benchmark -v --browser=' |
281 'android-chrome-shell page_cycler.intl_ja_zh') | 282 'android-chrome-shell page_cycler.intl_ja_zh') |
282 self.assertEqual( | 283 self.assertEqual( |
283 bisect_instance.GetCompatibleCommand(command, git_revision), | 284 bisect_instance.GetCompatibleCommand(command, git_revision, depot), |
284 expected_command) | 285 expected_command) |
285 # android-chrome-shell -> android-chrome-shell | 286 # android-chrome-shell -> android-chrome-shell |
286 command = ('tools/perf/run_benchmark -v ' | 287 command = ('tools/perf/run_benchmark -v ' |
287 '--browser=android-chrome-shell page_cycler.intl_ja_zh') | 288 '--browser=android-chrome-shell page_cycler.intl_ja_zh') |
288 expected_command = ('tools/perf/run_benchmark -v --browser=' | 289 expected_command = ('tools/perf/run_benchmark -v --browser=' |
289 'android-chrome-shell page_cycler.intl_ja_zh') | 290 'android-chrome-shell page_cycler.intl_ja_zh') |
290 self.assertEqual( | 291 self.assertEqual( |
291 bisect_instance.GetCompatibleCommand(command, git_revision), | 292 bisect_instance.GetCompatibleCommand(command, git_revision, depot), |
292 expected_command) | 293 expected_command) |
293 # Not android platform | 294 # Not android platform |
294 bisect_instance.opts.target_platform = 'chromium' | 295 bisect_instance.opts.target_platform = 'chromium' |
295 command = ('tools/perf/run_benchmark -v ' | 296 command = ('tools/perf/run_benchmark -v ' |
296 '--browser=release page_cycler.intl_ja_zh') | 297 '--browser=release page_cycler.intl_ja_zh') |
297 expected_command = ('tools/perf/run_benchmark -v --browser=' | 298 expected_command = ('tools/perf/run_benchmark -v --browser=' |
298 'release page_cycler.intl_ja_zh') | 299 'release page_cycler.intl_ja_zh') |
299 self.assertEqual( | 300 self.assertEqual( |
300 bisect_instance.GetCompatibleCommand(command, git_revision), | 301 bisect_instance.GetCompatibleCommand(command, git_revision, depot), |
301 expected_command) | 302 expected_command) |
302 | 303 |
303 if __name__ == '__main__': | 304 if __name__ == '__main__': |
304 unittest.main() | 305 unittest.main() |
OLD | NEW |