OLD | NEW |
1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import json | 9 import json |
10 import os | 10 import os |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 input_api, output_api)) | 612 input_api, output_api)) |
613 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 613 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
614 input_api, output_api)) | 614 input_api, output_api)) |
615 results.extend(_CheckChangeHasBugField(input_api, output_api)) | 615 results.extend(_CheckChangeHasBugField(input_api, output_api)) |
616 results.extend(input_api.canned_checks.CheckChangeHasTestField( | 616 results.extend(input_api.canned_checks.CheckChangeHasTestField( |
617 input_api, output_api)) | 617 input_api, output_api)) |
618 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 618 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
619 input_api, output_api, | 619 input_api, output_api, |
620 json_url='http://webrtc-status.appspot.com/current?format=json')) | 620 json_url='http://webrtc-status.appspot.com/current?format=json')) |
621 return results | 621 return results |
622 | |
623 | |
624 # pylint: disable=W0613 | |
625 def GetPreferredTryMasters(project, change): | |
626 cq_config_path = os.path.join( | |
627 change.RepositoryRoot(), 'infra', 'config', 'cq.cfg') | |
628 # commit_queue.py below is a script in depot_tools directory, which has a | |
629 # 'builders' command to retrieve a list of CQ builders from the CQ config. | |
630 is_win = platform.system() == 'Windows' | |
631 masters = json.loads(subprocess.check_output( | |
632 ['commit_queue', 'builders', cq_config_path], shell=is_win)) | |
633 | |
634 try_config = {} | |
635 for master in masters: | |
636 try_config.setdefault(master, {}) | |
637 for builder in masters[master]: | |
638 if 'presubmit' in builder: | |
639 # Do not trigger presubmit builders, since they're likely to fail | |
640 # (e.g. OWNERS checks before finished code review), and we're running | |
641 # local presubmit anyway. | |
642 pass | |
643 else: | |
644 try_config[master][builder] = ['defaulttests'] | |
645 | |
646 return try_config | |
OLD | NEW |