OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 def AddAnnotatedSteps(self, factory_properties, timeout=1200): | 863 def AddAnnotatedSteps(self, factory_properties, timeout=1200): |
864 factory_properties = factory_properties or {} | 864 factory_properties = factory_properties or {} |
865 cmd = [self._python, self._annotated_steps] | 865 cmd = [self._python, self._annotated_steps] |
866 self._factory.addStep(chromium_step.AnnotatedCommand, | 866 self._factory.addStep(chromium_step.AnnotatedCommand, |
867 name='annotated_steps', | 867 name='annotated_steps', |
868 description='annotated_steps', | 868 description='annotated_steps', |
869 timeout=timeout, | 869 timeout=timeout, |
870 haltOnFailure=True, | 870 haltOnFailure=True, |
871 command=cmd) | 871 command=cmd) |
872 | 872 |
| 873 def AddAnnotationStep(self, name, cmd, timeout=6000): |
| 874 """Add an @@@BUILD_STEP step@@@ annotation script build command. |
| 875 |
| 876 This function allows the caller to specify the name of the |
| 877 annotation script. In contrast, AddAnnotatedSteps() simply adds |
| 878 in a hard-coded annotation script that is not yet in the tree. |
| 879 TODO(jrg): resolve this inconsistency with the |
| 880 chrome-infrastrucure team; we shouldn't need two functions.""" |
| 881 self._factory.addStep(chromium_step.AnnotatedCommand, |
| 882 name=name, |
| 883 description=name, |
| 884 timeout=timeout, |
| 885 haltOnFailure=True, |
| 886 workdir=self._build_dir, |
| 887 command=cmd) |
| 888 |
| 889 |
873 def _GetPyAutoCmd(self, src_base=None, script=None, factory_properties=None, | 890 def _GetPyAutoCmd(self, src_base=None, script=None, factory_properties=None, |
874 dataset=None, matrix=True, media_home=None, test_name=None, | 891 dataset=None, matrix=True, media_home=None, test_name=None, |
875 http=False, nocache=False, verbose=False, suite_name=None, | 892 http=False, nocache=False, verbose=False, suite_name=None, |
876 reference_build_dir=None, track=False): | 893 reference_build_dir=None, track=False): |
877 """Get PyAuto command line based on arguments. | 894 """Get PyAuto command line based on arguments. |
878 | 895 |
879 Args: | 896 Args: |
880 src_base: relative path (from workdir) to src. Not needed if workdir is | 897 src_base: relative path (from workdir) to src. Not needed if workdir is |
881 'build' (the default). Needed when workdir is not 'build' (like | 898 'build' (the default). Needed when workdir is not 'build' (like |
882 parent of 'build'). | 899 parent of 'build'). |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 # ArchiveCommand.createSummary. | 1134 # ArchiveCommand.createSummary. |
1118 return '%s/%s/%s' % (config.Master.archive_url, archive_type, builder_name) | 1135 return '%s/%s/%s' % (config.Master.archive_url, archive_type, builder_name) |
1119 | 1136 |
1120 def _GetSnapshotUrl(factory_properties=None, builder_name='%(build_name)s'): | 1137 def _GetSnapshotUrl(factory_properties=None, builder_name='%(build_name)s'): |
1121 if not factory_properties or 'gs_bucket' not in factory_properties: | 1138 if not factory_properties or 'gs_bucket' not in factory_properties: |
1122 return (_GetArchiveUrl('snapshots', builder_name), None) | 1139 return (_GetArchiveUrl('snapshots', builder_name), None) |
1123 gs_bucket = factory_properties['gs_bucket'] | 1140 gs_bucket = factory_properties['gs_bucket'] |
1124 gs_bucket = re.sub(r'^gs://', 'http://commondatastorage.googleapis.com/', | 1141 gs_bucket = re.sub(r'^gs://', 'http://commondatastorage.googleapis.com/', |
1125 gs_bucket) | 1142 gs_bucket) |
1126 return ('%s/index.html?path=%s' % (gs_bucket, builder_name), '/') | 1143 return ('%s/index.html?path=%s' % (gs_bucket, builder_name), '/') |
OLD | NEW |