OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Set of utilities to add commands to a buildbot factory. | 6 """Set of utilities to add commands to a buildbot factory. |
7 | 7 |
8 This is based on commands.py and adds chromium-specific commands.""" | 8 This is based on commands.py and adds chromium-specific commands.""" |
9 | 9 |
10 import logging | 10 import logging |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 self.AddTestStep(retcode_command.ReturnCodeCommand, test_name, cmd, | 543 self.AddTestStep(retcode_command.ReturnCodeCommand, test_name, cmd, |
544 timeout=timeout) | 544 timeout=timeout) |
545 | 545 |
546 def AddPyAutoFunctionalTest(self, test_name, timeout=1200, | 546 def AddPyAutoFunctionalTest(self, test_name, timeout=1200, |
547 workdir=None, | 547 workdir=None, |
548 functional_base=None): | 548 functional_base=None): |
549 """Adds a step to run PyAuto functional tests.""" | 549 """Adds a step to run PyAuto functional tests.""" |
550 J = self.PathJoin | 550 J = self.PathJoin |
551 pyauto_script = J('src', 'chrome', 'test', 'functional', | 551 pyauto_script = J('src', 'chrome', 'test', 'functional', |
552 'pyauto_functional.py') | 552 'pyauto_functional.py') |
553 # in case a '..' prefix is needed | 553 # Mapping from self._target_platform to the name of the |
554 if functional_base: | 554 # extracted chrome-*.zip |
555 pyauto_script = J(functional_base, pyauto_script) | 555 platmap = {'win32': 'chrome-win32', |
| 556 'darwin': 'chrome-mac', |
| 557 'linux2': 'chrome-linux' } |
556 | 558 |
557 pyauto_functional_cmd = ['python', pyauto_script, '-v'] | 559 pyauto_functional_cmd = ['python', pyauto_script, '-v'] |
558 if self._target_platform == 'win32': # win needs python24 | 560 if self._target_platform == 'win32': # win needs python24 |
559 py24 = J('src', 'third_party', 'python_24', 'python_slave.exe') | 561 py24 = J('src', 'third_party', 'python_24', 'python_slave.exe') |
560 pyauto_functional_cmd = ['cmd', '/C'] + [py24, pyauto_script, '-v'] | 562 pyauto_functional_cmd = ['cmd', '/C'] + [py24, pyauto_script, '-v'] |
561 elif self._target_platform == 'darwin': | 563 elif self._target_platform == 'darwin': |
562 pyauto_functional_cmd = ['python2.5', pyauto_script, '-v'] | 564 pyauto_functional_cmd = ['python2.5', pyauto_script, '-v'] |
563 self.AddTestStep(retcode_command.ReturnCodeCommand, | 565 self.AddTestStep(retcode_command.ReturnCodeCommand, |
564 test_name, | 566 test_name, |
565 pyauto_functional_cmd, | 567 pyauto_functional_cmd, |
566 env={'PYTHONPATH': '.'}, | 568 env={'PYTHONPATH': platmap[self._target_platform]}, |
567 workdir=workdir, | 569 workdir=workdir, |
568 timeout=timeout) | 570 timeout=timeout) |
569 | 571 |
570 def AddWebkitTests(self, factory_properties=None): | 572 def AddWebkitTests(self, factory_properties=None): |
571 """Adds a step to the factory to run the WebKit layout tests. | 573 """Adds a step to the factory to run the WebKit layout tests. |
572 | 574 |
573 Args: | 575 Args: |
574 with_pageheap: if True, page-heap checking will be enabled for test_shell | 576 with_pageheap: if True, page-heap checking will be enabled for test_shell |
575 test_timeout: buildbot timeout for the test step | 577 test_timeout: buildbot timeout for the test step |
576 archive_timeout: buildbot timeout for archiving the test results and | 578 archive_timeout: buildbot timeout for archiving the test results and |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 cmd = [self._python, self._download_and_extract_official_tool, | 707 cmd = [self._python, self._download_and_extract_official_tool, |
706 '--identifier', identifier, | 708 '--identifier', identifier, |
707 # TODO(jrg): for now we are triggered on a timer and always | 709 # TODO(jrg): for now we are triggered on a timer and always |
708 # use the latest build. Instead we should trigger on the | 710 # use the latest build. Instead we should trigger on the |
709 # presence of new build and pass that info down for a | 711 # presence of new build and pass that info down for a |
710 # --build N arg. | 712 # --build N arg. |
711 '--latest'] | 713 '--latest'] |
712 self.AddTestStep(commands.WaterfallLoggingShellCommand, | 714 self.AddTestStep(commands.WaterfallLoggingShellCommand, |
713 'Download and extract official build', cmd, | 715 'Download and extract official build', cmd, |
714 halt_on_failure=True) | 716 halt_on_failure=True) |
OLD | NEW |