OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld and Gerrit.""" | 8 """A git-command for integrating reviews on Rietveld and Gerrit.""" |
9 | 9 |
10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
330 'category': category, | 330 'category': category, |
331 'issue': issue, | 331 'issue': issue, |
332 'master': master, | 332 'master': master, |
333 'patch_project': issue_props['project'], | 333 'patch_project': issue_props['project'], |
334 'patch_storage': 'rietveld', | 334 'patch_storage': 'rietveld', |
335 'patchset': patchset, | 335 'patchset': patchset, |
336 'reason': options.name, | 336 'reason': options.name, |
337 'rietveld': rietveld_url, | 337 'rietveld': rietveld_url, |
338 }, | 338 }, |
339 } | 339 } |
340 if 'presubmit' in builder.lower(): | |
tandrii(chromium)
2016/04/28 19:39:52
derp
| |
341 parameters['properties']['dry_run'] = 'true' | |
340 if tests: | 342 if tests: |
341 parameters['properties']['testfilter'] = tests | 343 parameters['properties']['testfilter'] = tests |
342 if properties: | 344 if properties: |
343 parameters['properties'].update(properties) | 345 parameters['properties'].update(properties) |
344 if options.clobber: | 346 if options.clobber: |
345 parameters['properties']['clobber'] = True | 347 parameters['properties']['clobber'] = True |
346 batch_req_body['builds'].append( | 348 batch_req_body['builds'].append( |
347 { | 349 { |
348 'bucket': bucket, | 350 'bucket': bucket, |
349 'parameters_json': json.dumps(parameters), | 351 'parameters_json': json.dumps(parameters), |
(...skipping 3959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4309 # location. | 4311 # location. |
4310 cq_cfg = os.path.join(change.RepositoryRoot(), | 4312 cq_cfg = os.path.join(change.RepositoryRoot(), |
4311 'infra', 'config', 'cq.cfg') | 4313 'infra', 'config', 'cq.cfg') |
4312 if os.path.exists(cq_cfg): | 4314 if os.path.exists(cq_cfg): |
4313 masters = {} | 4315 masters = {} |
4314 cq_masters = commit_queue.get_master_builder_map( | 4316 cq_masters = commit_queue.get_master_builder_map( |
4315 cq_cfg, include_experimental=False, include_triggered=False) | 4317 cq_cfg, include_experimental=False, include_triggered=False) |
4316 for master, builders in cq_masters.iteritems(): | 4318 for master, builders in cq_masters.iteritems(): |
4317 for builder in builders: | 4319 for builder in builders: |
4318 # Skip presubmit builders, because these will fail without LGTM. | 4320 # Skip presubmit builders, because these will fail without LGTM. |
4319 if 'presubmit' not in builder.lower(): | 4321 masters.setdefault(master, {})[builder] = ['defaulttests'] |
4320 masters.setdefault(master, {})[builder] = ['defaulttests'] | |
4321 if masters: | 4322 if masters: |
4322 return masters | 4323 return masters |
4323 | 4324 |
4324 if not options.bot: | 4325 if not options.bot: |
4325 parser.error('No default try builder to try, use --bot') | 4326 parser.error('No default try builder to try, use --bot') |
4326 | 4327 |
4327 builders_and_tests = {} | 4328 builders_and_tests = {} |
4328 # TODO(machenbach): The old style command-line options don't support | 4329 # TODO(machenbach): The old style command-line options don't support |
4329 # multiple try masters yet. | 4330 # multiple try masters yet. |
4330 old_style = filter(lambda x: isinstance(x, basestring), options.bot) | 4331 old_style = filter(lambda x: isinstance(x, basestring), options.bot) |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4854 if __name__ == '__main__': | 4855 if __name__ == '__main__': |
4855 # These affect sys.stdout so do it outside of main() to simplify mocks in | 4856 # These affect sys.stdout so do it outside of main() to simplify mocks in |
4856 # unit testing. | 4857 # unit testing. |
4857 fix_encoding.fix_encoding() | 4858 fix_encoding.fix_encoding() |
4858 setup_color.init() | 4859 setup_color.init() |
4859 try: | 4860 try: |
4860 sys.exit(main(sys.argv[1:])) | 4861 sys.exit(main(sys.argv[1:])) |
4861 except KeyboardInterrupt: | 4862 except KeyboardInterrupt: |
4862 sys.stderr.write('interrupted\n') | 4863 sys.stderr.write('interrupted\n') |
4863 sys.exit(1) | 4864 sys.exit(1) |
OLD | NEW |