OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 DEPS = [ | 5 DEPS = [ |
6 'depot_tools/bot_update', | 6 'depot_tools/bot_update', |
7 'depot_tools/gclient', | 7 'depot_tools/gclient', |
8 'depot_tools/git', | 8 'depot_tools/git', |
9 'depot_tools/presubmit', | 9 'depot_tools/presubmit', |
10 'recipe_engine/json', | 10 'recipe_engine/json', |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if codereview_auth: | 70 if codereview_auth: |
71 presubmit_args.extend([ | 71 presubmit_args.extend([ |
72 '--rietveld_email_file', | 72 '--rietveld_email_file', |
73 api.path['build'].join('site_config', '.rietveld_client_email')]) | 73 api.path['build'].join('site_config', '.rietveld_client_email')]) |
74 presubmit_args.extend([ | 74 presubmit_args.extend([ |
75 '--rietveld_private_key_file', | 75 '--rietveld_private_key_file', |
76 api.path['build'].join('site_config', '.rietveld_secret_key')]) | 76 api.path['build'].join('site_config', '.rietveld_secret_key')]) |
77 else: | 77 else: |
78 presubmit_args.extend(['--rietveld_email', '']) # activate anonymous mode | 78 presubmit_args.extend(['--rietveld_email', '']) # activate anonymous mode |
79 elif patch_storage == 'gerrit': | 79 elif patch_storage == 'gerrit': |
80 gerrit_url = api.properties.get('patch_gerrit_url') | |
81 if not gerrit_url: | |
82 # TODO(tandrii): clean up old Gerrit patch properties. | |
83 # Field event.patchSet.ref looks like 'refs/changes/11/338811/4' | |
84 issue, patchset = api.properties['event.patchSet.ref'].split('/')[-2:] | |
85 gerrit_url = api.properties['gerrit'] | |
86 else: | |
87 issue = api.properties.get('patch_issue') | |
88 patchset = api.properties.get('patch_set') | |
89 presubmit_args = [ | 80 presubmit_args = [ |
90 '--issue', issue, | 81 '--issue', api.properties['patch_issue'], |
91 '--patchset', patchset, | 82 '--patchset', api.properties['patch_set'], |
92 '--gerrit_url', gerrit_url, | 83 '--gerrit_url', api.properties['patch_gerrit_url'], |
93 '--gerrit_fetch', | 84 '--gerrit_fetch', |
94 ] | 85 ] |
95 else: # pragma: no cover | 86 else: # pragma: no cover |
96 assert False, 'patch_storage %s is not supported' % patch_storage | 87 assert False, 'patch_storage %s is not supported' % patch_storage |
97 if api.properties.get('dry_run'): | 88 if api.properties.get('dry_run'): |
98 presubmit_args.append('--dry_run') | 89 presubmit_args.append('--dry_run') |
99 | 90 |
100 presubmit_args.extend([ | 91 presubmit_args.extend([ |
101 '--root', abs_root, | 92 '--root', abs_root, |
102 '--commit', | 93 '--commit', |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 mastername='tryserver.chromium.linux', | 171 mastername='tryserver.chromium.linux', |
181 buildername='infra_presubmit', | 172 buildername='infra_presubmit', |
182 repo_name='infra', | 173 repo_name='infra', |
183 patch_project='infra', | 174 patch_project='infra', |
184 runhooks=True) + | 175 runhooks=True) + |
185 api.step_data('presubmit', api.json.output([['infra_presubmit', | 176 api.step_data('presubmit', api.json.output([['infra_presubmit', |
186 ['compile']]])) | 177 ['compile']]])) |
187 ) | 178 ) |
188 | 179 |
189 yield ( | 180 yield ( |
190 api.test('infra_with_runhooks_and_gerrit_deprecated') + | |
191 api.properties.tryserver_gerrit( | |
192 full_project_name='infra/infra', | |
193 repo_name='infra', | |
194 mastername='tryserver.infra', | |
195 buildername='infra_presubmit', | |
196 runhooks=True) + | |
197 api.step_data('presubmit', api.json.output([['infra_presubmit', | |
198 ['compile']]])) | |
199 ) | |
200 | |
201 yield ( | |
202 api.test('infra_with_runhooks_and_gerrit') + | 181 api.test('infra_with_runhooks_and_gerrit') + |
203 api.properties.tryserver( | 182 api.properties.tryserver( |
204 gerrit_project='infra/infra', | 183 gerrit_project='infra/infra', |
205 repo_name='infra', | 184 repo_name='infra', |
206 mastername='tryserver.infra', | 185 mastername='tryserver.infra', |
207 buildername='infra_presubmit', | 186 buildername='infra_presubmit', |
208 runhooks=True) + | 187 runhooks=True) + |
209 api.step_data('presubmit', api.json.output([['infra_presubmit', | 188 api.step_data('presubmit', api.json.output([['infra_presubmit', |
210 ['compile']]])) | 189 ['compile']]])) |
211 ) | 190 ) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 yield ( | 236 yield ( |
258 api.test('repository_url') + | 237 api.test('repository_url') + |
259 api.properties.tryserver( | 238 api.properties.tryserver( |
260 mastername='tryserver.chromium.linux', | 239 mastername='tryserver.chromium.linux', |
261 buildername='chromium_presubmit', | 240 buildername='chromium_presubmit', |
262 repository_url='https://skia.googlesource.com/skia.git', | 241 repository_url='https://skia.googlesource.com/skia.git', |
263 solution_name='skia') + | 242 solution_name='skia') + |
264 api.step_data('presubmit', | 243 api.step_data('presubmit', |
265 api.json.output([['chromium_presubmit', ['compile']]])) | 244 api.json.output([['chromium_presubmit', ['compile']]])) |
266 ) | 245 ) |
OLD | NEW |