| 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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 908 | 908 | 
| 909     self.AddAnnotatedPerfStep(step_name, None, log_type, factory_properties, | 909     self.AddAnnotatedPerfStep(step_name, None, log_type, factory_properties, | 
| 910                               cmd_name=self._telemetry_tool, | 910                               cmd_name=self._telemetry_tool, | 
| 911                               cmd_options=cmd_options, | 911                               cmd_options=cmd_options, | 
| 912                               step_name=step_name, timeout=timeout, | 912                               step_name=step_name, timeout=timeout, | 
| 913                               tool_opts=tool_options, py_script=True, | 913                               tool_opts=tool_options, py_script=True, | 
| 914                               dashboard_url=dashboard_url) | 914                               dashboard_url=dashboard_url) | 
| 915 | 915 | 
| 916   def AddPyAutoFunctionalTest(self, test_name, timeout=1200, | 916   def AddPyAutoFunctionalTest(self, test_name, timeout=1200, | 
| 917                               workdir=None, | 917                               workdir=None, | 
| 918                               src_base='.', |  | 
| 919                               suite=None, | 918                               suite=None, | 
| 920                               test_args=None, | 919                               test_args=None, | 
| 921                               factory_properties=None, | 920                               factory_properties=None, | 
| 922                               perf=False): | 921                               perf=False): | 
| 923     """Adds a step to run PyAuto functional tests. | 922     """Adds a step to run PyAuto functional tests. | 
| 924 | 923 | 
| 925     Args: | 924     Args: | 
| 926       test_name: a string describing the test, used to build its logfile name | 925       test_name: a string describing the test, used to build its logfile name | 
| 927           and its descriptions in the waterfall display | 926           and its descriptions in the waterfall display | 
| 928       timeout: The buildbot timeout for this step, in seconds.  The step will | 927       timeout: The buildbot timeout for this step, in seconds.  The step will | 
| 929           fail if the test does not produce any output within this time. | 928           fail if the test does not produce any output within this time. | 
| 930       workdir: the working dir for this step | 929       workdir: the working dir for this step | 
| 931       src_base: relative path (from workdir) to src. Not needed if workdir is |  | 
| 932           'build' (the default) |  | 
| 933       suite: PyAuto suite to execute. | 930       suite: PyAuto suite to execute. | 
| 934       test_args: list of PyAuto test arguments. | 931       test_args: list of PyAuto test arguments. | 
| 935       factory_properties: A dictionary of factory property values. | 932       factory_properties: A dictionary of factory property values. | 
| 936       perf: Is this a perf test or not? Requires suite or test_args to be set. | 933       perf: Is this a perf test or not? Requires suite or test_args to be set. | 
| 937     """ | 934     """ | 
| 938     factory_properties = factory_properties or {} | 935     factory_properties = factory_properties or {} | 
| 939     factory_properties['step_name'] = test_name | 936     factory_properties['step_name'] = test_name | 
| 940 | 937 | 
| 941     J = self.PathJoin | 938     J = self.PathJoin | 
| 942     pyauto_script = J(src_base, 'src', 'chrome', 'test', 'functional', | 939     pyauto_script = J('src', 'chrome', 'test', 'functional', | 
| 943                       'pyauto_functional.py') | 940                       'pyauto_functional.py') | 
| 944     args = ['-v'] | 941     args = ['-v'] | 
| 945     if suite: | 942     if suite: | 
| 946       args.append('--suite=%s' % suite) | 943       args.append('--suite=%s' % suite) | 
| 947     if test_args: | 944     if test_args: | 
| 948       args.extend(test_args) | 945       args.extend(test_args) | 
| 949 | 946 | 
| 950     wrapper_args = [] | 947     wrapper_args = [] | 
| 951     if not factory_properties.get('use_xvfb_on_linux'): | 948     if not factory_properties.get('use_xvfb_on_linux'): | 
| 952       wrapper_args.append('--no-xvfb') | 949       wrapper_args.append('--no-xvfb') | 
| 953 | 950 | 
| 954     if perf and (suite or test_args): | 951     if perf and (suite or test_args): | 
| 955       cmd = self.GetAnnotatedPerfCmd(None, 'graphing', test_name, | 952       cmd = self.GetAnnotatedPerfCmd(None, 'graphing', test_name, | 
| 956                                      cmd_name=pyauto_script, options=args, | 953                                      cmd_name=pyauto_script, options=args, | 
| 957                                      factory_properties=factory_properties, | 954                                      factory_properties=factory_properties, | 
| 958                                      tool_opts=wrapper_args, py_script=True) | 955                                      tool_opts=wrapper_args, py_script=True) | 
| 959     else: | 956     else: | 
| 960       cmd = self.GetPythonTestCommand(pyauto_script, arg_list=args, | 957       cmd = self.GetPythonTestCommand(pyauto_script, arg_list=args, | 
| 961           wrapper_args=wrapper_args, factory_properties=factory_properties) | 958           wrapper_args=wrapper_args, factory_properties=factory_properties) | 
| 962 | 959 | 
| 963 |  | 
| 964 |  | 
| 965     # The following lines adjust the runtest.py path and build_dir to be |  | 
| 966     # relative to src_base. |  | 
| 967     cmd[1] = J(src_base, cmd[1]) |  | 
| 968     cmd = map(lambda x:x if x!= self._build_dir else J(src_base, x), cmd) |  | 
| 969 |  | 
| 970     # Allow setting a custom environment for a PyAuto test. | 960     # Allow setting a custom environment for a PyAuto test. | 
| 971     env = factory_properties.get('pyauto_env', {'PYTHONPATH': '.'}) | 961     env = factory_properties.get('pyauto_env', {'PYTHONPATH': '.'}) | 
| 972 | 962 | 
| 973     self.AddTestStep(chromium_step.AnnotatedCommand, test_name, cmd, env=env, | 963     self.AddTestStep(chromium_step.AnnotatedCommand, test_name, cmd, env=env, | 
| 974                      target=self._target, factory_properties=factory_properties, | 964                      target=self._target, factory_properties=factory_properties, | 
| 975                      timeout=timeout, workdir=workdir, | 965                      timeout=timeout, workdir=workdir, | 
| 976                      do_step_if=self.GetTestStepFilter(factory_properties)) | 966                      do_step_if=self.GetTestStepFilter(factory_properties)) | 
| 977 | 967 | 
| 978   def AddDevToolsTests(self, factory_properties=None): | 968   def AddDevToolsTests(self, factory_properties=None): | 
| 979     factory_properties = factory_properties or {} | 969     factory_properties = factory_properties or {} | 
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1672   return '%s/%s/%s' % (config.Master.archive_url, archive_type, builder_name) | 1662   return '%s/%s/%s' % (config.Master.archive_url, archive_type, builder_name) | 
| 1673 | 1663 | 
| 1674 | 1664 | 
| 1675 def _GetSnapshotUrl(factory_properties=None, builder_name='%(build_name)s'): | 1665 def _GetSnapshotUrl(factory_properties=None, builder_name='%(build_name)s'): | 
| 1676   if not factory_properties or 'gs_bucket' not in factory_properties: | 1666   if not factory_properties or 'gs_bucket' not in factory_properties: | 
| 1677     return (_GetArchiveUrl('snapshots', builder_name), None) | 1667     return (_GetArchiveUrl('snapshots', builder_name), None) | 
| 1678   gs_bucket = factory_properties['gs_bucket'] | 1668   gs_bucket = factory_properties['gs_bucket'] | 
| 1679   gs_bucket = re.sub(r'^gs://', 'http://commondatastorage.googleapis.com/', | 1669   gs_bucket = re.sub(r'^gs://', 'http://commondatastorage.googleapis.com/', | 
| 1680                      gs_bucket) | 1670                      gs_bucket) | 
| 1681   return ('%s/index.html?path=%s' % (gs_bucket, builder_name), '/') | 1671   return ('%s/index.html?path=%s' % (gs_bucket, builder_name), '/') | 
| OLD | NEW | 
|---|