| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Set of utilities to add commands to a buildbot factory. | 5 """Set of utilities to add commands to a buildbot factory. |
| 6 | 6 |
| 7 This is based on commands.py and adds chromium-specific commands.""" | 7 This is based on commands.py and adds chromium-specific commands.""" |
| 8 | 8 |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 maxTime=10*60*60, | 277 maxTime=10*60*60, |
| 278 description='packaging source', | 278 description='packaging source', |
| 279 descriptionDone='packaged source', | 279 descriptionDone='packaged source', |
| 280 base_url=None, | 280 base_url=None, |
| 281 link_text=None, | 281 link_text=None, |
| 282 more_link_url=None, | 282 more_link_url=None, |
| 283 more_link_text=None, | 283 more_link_text=None, |
| 284 command=cmd) | 284 command=cmd) |
| 285 | 285 |
| 286 def GetAnnotatedPerfCmd(self, gtest_filter, log_type, test_name, | 286 def GetAnnotatedPerfCmd(self, gtest_filter, log_type, test_name, |
| 287 cmd_name, tool_opts=None, | 287 cmd_name='performance_ui_tests', tool_opts=None, |
| 288 options=None, factory_properties=None, | 288 options=None, factory_properties=None, |
| 289 py_script=False, dashboard_url=None): | 289 py_script=False, dashboard_url=None): |
| 290 """Return a runtest command suitable for most perf test steps.""" | 290 """Return a runtest command suitable for most perf test steps.""" |
| 291 | 291 |
| 292 dashboard_url = dashboard_url or config.Master.dashboard_upload_url | 292 dashboard_url = dashboard_url or config.Master.dashboard_upload_url |
| 293 | 293 |
| 294 tool_options = ['--annotate=' + log_type] | 294 tool_options = ['--annotate=' + log_type] |
| 295 tool_options.extend(tool_opts or []) | 295 tool_options.extend(tool_opts or []) |
| 296 tool_options.append('--results-url=%s' % dashboard_url) | 296 tool_options.append('--results-url=%s' % dashboard_url) |
| 297 | 297 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 318 # Prevents breakages in perf tests, but we shouldn't have to set this. | 318 # Prevents breakages in perf tests, but we shouldn't have to set this. |
| 319 # TODO(phajdan.jr): Do not set this. | 319 # TODO(phajdan.jr): Do not set this. |
| 320 '--single-process-tests', | 320 '--single-process-tests', |
| 321 ]) | 321 ]) |
| 322 | 322 |
| 323 return self.GetTestCommand(cmd_name, wrapper_args=tool_options, | 323 return self.GetTestCommand(cmd_name, wrapper_args=tool_options, |
| 324 arg_list=arg_list, | 324 arg_list=arg_list, |
| 325 factory_properties=factory_properties) | 325 factory_properties=factory_properties) |
| 326 | 326 |
| 327 def AddAnnotatedPerfStep(self, test_name, gtest_filter, log_type, | 327 def AddAnnotatedPerfStep(self, test_name, gtest_filter, log_type, |
| 328 factory_properties, cmd_name, | 328 factory_properties, cmd_name='performance_ui_tests', |
| 329 tool_opts=None, cmd_options=None, step_name=None, | 329 tool_opts=None, cmd_options=None, step_name=None, |
| 330 timeout=1200, py_script=False, dashboard_url=None, | 330 timeout=1200, py_script=False, dashboard_url=None, |
| 331 addmethod=None, alwaysRun=False): | 331 addmethod=None, alwaysRun=False): |
| 332 | 332 |
| 333 """Add an annotated perf step to the builder. | 333 """Add an annotated perf step to the builder. |
| 334 | 334 |
| 335 Args: | 335 Args: |
| 336 test_name: name of the test given to runtest.py. If step_name is not | 336 test_name: name of the test given to runtest.py. If step_name is not |
| 337 provided, a standard transform will be applied and the step on the | 337 provided, a standard transform will be applied and the step on the |
| 338 waterfall will be test_name_test. | 338 waterfall will be test_name_test. |
| 339 | 339 |
| 340 gtest_filter: most steps use --gtest_filter to filter their output. | 340 gtest_filter: most steps use --gtest_filter to filter their output. |
| 341 | 341 |
| 342 log_type: one of the log parsers in runtest.py --annotate=list, such | 342 log_type: one of the log parsers in runtest.py --annotate=list, such |
| 343 as 'graphing' or 'framerate'. | 343 as 'graphing' or 'framerate'. |
| 344 | 344 |
| 345 cmd_name: command to run. | 345 cmd_name: command to run, by default 'performance_ui_tests'. |
| 346 | 346 |
| 347 tool_opts: additional options for runtest.py. | 347 tool_opts: additional options for runtest.py. |
| 348 | 348 |
| 349 cmd_options: additional options for the test run under runtest.py. | 349 cmd_options: additional options for the test run under runtest.py. |
| 350 | 350 |
| 351 step_name: the step name for the builder/waterfall. | 351 step_name: the step name for the builder/waterfall. |
| 352 | 352 |
| 353 factory_properties: additional properties from the factory. | 353 factory_properties: additional properties from the factory. |
| 354 """ | 354 """ |
| 355 | 355 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 cmd_name='media_perftests', | 460 cmd_name='media_perftests', |
| 461 step_name='media_perftests', | 461 step_name='media_perftests', |
| 462 factory_properties=factory_properties) | 462 factory_properties=factory_properties) |
| 463 | 463 |
| 464 def AddLoadLibraryPerfTests(self, factory_properties=None): | 464 def AddLoadLibraryPerfTests(self, factory_properties=None): |
| 465 self.AddAnnotatedPerfStep('load_library_perf_tests', None, 'graphing', | 465 self.AddAnnotatedPerfStep('load_library_perf_tests', None, 'graphing', |
| 466 cmd_name='load_library_perf_tests', | 466 cmd_name='load_library_perf_tests', |
| 467 step_name='load_library_perf_tests', | 467 step_name='load_library_perf_tests', |
| 468 factory_properties=factory_properties) | 468 factory_properties=factory_properties) |
| 469 | 469 |
| 470 def AddMemoryTests(self, factory_properties=None): |
| 471 self.AddAnnotatedPerfStep('memory', 'GeneralMix*MemoryTest.*', 'graphing', |
| 472 factory_properties=factory_properties) |
| 473 |
| 474 def AddSyncPerfTests(self, factory_properties=None): |
| 475 options = ['--ui-test-action-max-timeout=120000'] |
| 476 |
| 477 self.AddAnnotatedPerfStep('sync', '*SyncPerfTest.*', 'graphing', |
| 478 cmd_options=options, step_name='sync', |
| 479 factory_properties=factory_properties) |
| 480 |
| 470 def AddSizesTests(self, factory_properties=None): | 481 def AddSizesTests(self, factory_properties=None): |
| 471 factory_properties = factory_properties or {} | 482 factory_properties = factory_properties or {} |
| 472 | 483 |
| 473 # For Android, platform is hardcoded as target_platform is set to linux2. | 484 # For Android, platform is hardcoded as target_platform is set to linux2. |
| 474 # By default, the sizes.py script looks at sys.platform to identify | 485 # By default, the sizes.py script looks at sys.platform to identify |
| 475 # the platform (which is also linux2). | 486 # the platform (which is also linux2). |
| 476 args = ['--target', self._target] | 487 args = ['--target', self._target] |
| 477 | 488 |
| 478 if self._target_os == 'android': | 489 if self._target_os == 'android': |
| 479 args.extend(['--platform', 'android']) | 490 args.extend(['--platform', 'android']) |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 options.append(factory_properties.get('browser_tests_filter', [])) | 722 options.append(factory_properties.get('browser_tests_filter', [])) |
| 712 options.extend(factory_properties.get('browser_tests_extra_options', [])) | 723 options.extend(factory_properties.get('browser_tests_extra_options', [])) |
| 713 | 724 |
| 714 options = filter(None, options) | 725 options = filter(None, options) |
| 715 | 726 |
| 716 self.AddBuildrunnerGTest('browser_tests', factory_properties, | 727 self.AddBuildrunnerGTest('browser_tests', factory_properties, |
| 717 description, options, | 728 description, options, |
| 718 total_shards=total_shards, | 729 total_shards=total_shards, |
| 719 shard_index=shard_index) | 730 shard_index=shard_index) |
| 720 | 731 |
| 732 def AddDomCheckerTests(self): |
| 733 cmd = [self._python, self._test_tool, |
| 734 '--target', self._target] |
| 735 |
| 736 cmd.extend(['--with-httpd', |
| 737 self.PathJoin('src', 'chrome', 'test', 'data')]) |
| 738 |
| 739 cmd.extend([self.GetExecutableName('performance_ui_tests'), |
| 740 '--gtest_filter=DomCheckerTest.*', |
| 741 '--gtest_print_time', |
| 742 '--run-dom-checker-test']) |
| 743 |
| 744 self.AddTestStep(shell.ShellCommand, 'dom_checker_tests', cmd, |
| 745 do_step_if=self.TestStepFilter) |
| 746 |
| 747 def AddBuildrunnerDomCheckerTests(self): |
| 748 cmd = [self._python, self._test_tool, |
| 749 '--target', self._target] |
| 750 |
| 751 cmd.extend(['--with-httpd', |
| 752 self.PathJoin('src', 'chrome', 'test', 'data')]) |
| 753 |
| 754 cmd.extend([self.GetExecutableName('performance_ui_tests'), |
| 755 '--gtest_filter=DomCheckerTest.*', |
| 756 '--gtest_print_time', |
| 757 '--run-dom-checker-test']) |
| 758 |
| 759 self.AddBuildrunnerTestStep(shell.ShellCommand, 'dom_checker_tests', cmd, |
| 760 do_step_if=self.TestStepFilter) |
| 761 |
| 721 def AddMemoryTest(self, test_name, tool_name, timeout=1200, | 762 def AddMemoryTest(self, test_name, tool_name, timeout=1200, |
| 722 factory_properties=None, | 763 factory_properties=None, |
| 723 wrapper_args=None, addmethod=None): | 764 wrapper_args=None, addmethod=None): |
| 724 factory_properties = factory_properties or {} | 765 factory_properties = factory_properties or {} |
| 725 factory_properties['full_test_name'] = True | 766 factory_properties['full_test_name'] = True |
| 726 if not wrapper_args: | 767 if not wrapper_args: |
| 727 wrapper_args = [] | 768 wrapper_args = [] |
| 728 wrapper_args.extend([ | 769 wrapper_args.extend([ |
| 729 '--annotate=gtest', | 770 '--annotate=gtest', |
| 730 '--test-type', 'memory test: %s' % test_name, | 771 '--test-type', 'memory test: %s' % test_name, |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1528 return '%s/%s/%s' % (config.Master.archive_url, archive_type, builder_name) | 1569 return '%s/%s/%s' % (config.Master.archive_url, archive_type, builder_name) |
| 1529 | 1570 |
| 1530 | 1571 |
| 1531 def _GetSnapshotUrl(factory_properties=None, builder_name='%(build_name)s'): | 1572 def _GetSnapshotUrl(factory_properties=None, builder_name='%(build_name)s'): |
| 1532 if not factory_properties or 'gs_bucket' not in factory_properties: | 1573 if not factory_properties or 'gs_bucket' not in factory_properties: |
| 1533 return (_GetArchiveUrl('snapshots', builder_name), None) | 1574 return (_GetArchiveUrl('snapshots', builder_name), None) |
| 1534 gs_bucket = factory_properties['gs_bucket'] | 1575 gs_bucket = factory_properties['gs_bucket'] |
| 1535 gs_bucket = re.sub(r'^gs://', 'http://commondatastorage.googleapis.com/', | 1576 gs_bucket = re.sub(r'^gs://', 'http://commondatastorage.googleapis.com/', |
| 1536 gs_bucket) | 1577 gs_bucket) |
| 1537 return ('%s/index.html?path=%s' % (gs_bucket, builder_name), '/') | 1578 return ('%s/index.html?path=%s' % (gs_bucket, builder_name), '/') |
| OLD | NEW |