OLD | NEW |
1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
4 | 4 |
5 import re | 5 import re |
6 import urlparse | 6 import urlparse |
7 | 7 |
8 from recipe_engine import recipe_test_api | 8 from recipe_engine import recipe_test_api |
9 | 9 |
10 class PropertiesTestApi(recipe_test_api.RecipeTestApi): | 10 class PropertiesTestApi(recipe_test_api.RecipeTestApi): |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 patchset=1, | 120 patchset=1, |
121 project='chrome', | 121 project='chrome', |
122 repository='', | 122 repository='', |
123 requester='commit-bot@chromium.org', | 123 requester='commit-bot@chromium.org', |
124 revision='HEAD', | 124 revision='HEAD', |
125 rietveld='https://codereview.chromium.org', | 125 rietveld='https://codereview.chromium.org', |
126 patch_project='chromium', | 126 patch_project='chromium', |
127 ) | 127 ) |
128 ret.properties.update(kwargs) | 128 ret.properties.update(kwargs) |
129 return ret | 129 return ret |
130 | |
131 def tryserver_gerrit(self, full_project_name, gerrit_host=None, **kwargs): | |
132 """ | |
133 DEPRECATED. Use tryserver(gerrit_project='infra/infra') instead. | |
134 | |
135 Merge kwargs into a typical buildbot properties blob for a job fired off | |
136 by a gerrit tryjob on the tryserver, and return the blob. | |
137 | |
138 Arguments: | |
139 full_project_name: (required) name of the project in Gerrit. | |
140 gerrit_host: hostname of the gerrit server. | |
141 Example: chromium-review.googlesource.com. | |
142 """ | |
143 # TODO(tandrii): remove this method. | |
144 gerrit_host = gerrit_host or 'chromium-review.googlesource.com' | |
145 parts = gerrit_host.split('.') | |
146 assert parts[0].endswith('-review') | |
147 parts[0] = parts[0][:-len('-review')] | |
148 repository = 'https://%s/%s' % ('.'.join(parts), full_project_name) | |
149 | |
150 ret = self.generic( | |
151 branch='', | |
152 category='cq', | |
153 gerrit='https://%s' % gerrit_host, | |
154 patch_storage='gerrit', | |
155 project=full_project_name, | |
156 patch_project=full_project_name, | |
157 reason='CQ', | |
158 repository=repository, | |
159 requester='commit-bot@chromium.org', | |
160 revision='HEAD', | |
161 ) | |
162 ret.properties.update({ | |
163 'event.change.id': u'%s~master~Ideadbeaf' % | |
164 (full_project_name.replace('/', '%2F')), | |
165 'event.change.number': 338811, | |
166 'event.change.url': u'https://%s/#/c/338811' % gerrit_host, | |
167 'event.patchSet.ref': u'refs/changes/11/338811/3', | |
168 }) | |
169 ret.properties.update(kwargs) | |
170 return ret | |
OLD | NEW |