OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Top-level presubmit script for Chromium. | 5 """Top-level presubmit script for Chromium. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1777 json_url='http://chromium-status.appspot.com/current?format=json')) | 1777 json_url='http://chromium-status.appspot.com/current?format=json')) |
1778 | 1778 |
1779 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 1779 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
1780 input_api, output_api)) | 1780 input_api, output_api)) |
1781 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 1781 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
1782 input_api, output_api)) | 1782 input_api, output_api)) |
1783 return results | 1783 return results |
1784 | 1784 |
1785 | 1785 |
1786 def GetPreferredTryMasters(project, change): | 1786 def GetPreferredTryMasters(project, change): |
1787 import re | 1787 import json |
1788 files = change.LocalPaths() | 1788 import os.path |
1789 import subprocess | |
1789 | 1790 |
1790 import os | 1791 cq_config_path = os.path.join( |
1791 import json | 1792 change.RepositoryRoot(), 'infra', 'config', 'cq.cfg') |
jam
2015/05/29 18:07:27
how does this work? i.e. if i do fetch chromium, I
pgervais
2015/05/29 18:14:45
Yes you do :-) CQ configuration now lives in proje
jam
2015/05/29 18:19:46
ah, looks like the checkout i checked was a day ol
pgervais
2015/05/29 18:23:32
sys.executable is missing on line 1796
Sergiy Byelozyorov
2015/05/29 18:57:55
This would help, because python doesn't use $PATH
Sergiy Byelozyorov
2015/05/29 19:04:20
Added binaries in https://codereview.chromium.org/
| |
1792 with open(os.path.join( | 1793 # commit_queue.py below is a script in depot_tools directory, which has a |
1793 change.RepositoryRoot(), 'testing', 'commit_queue', 'config.json')) as f: | 1794 # 'builders' command to retrieve a list of CQ builders from the CQ config. |
1794 cq_config = json.load(f) | 1795 masters = json.loads(subprocess.check_output( |
1795 cq_verifiers = cq_config.get('verifiers_no_patch', {}) | 1796 ['commit_queue.py', 'builders', cq_config_path])) |
1796 cq_try_jobs = cq_verifiers.get('try_job_verifier', {}) | |
1797 builders = cq_try_jobs.get('launched', {}) | |
1798 | 1797 |
1799 for master, master_config in cq_try_jobs.get('triggered', {}).iteritems(): | 1798 # Explicitly iterate over copies of keys since we mutate them. |
1800 for triggered_bot in master_config: | 1799 for master in masters.keys(): |
1801 builders.get(master, {}).pop(triggered_bot, None) | 1800 for builder in masters[master].keys(): |
1801 # Do not trigger presubmit builders, since they're likely to fail | |
1802 # (e.g. OWNERS checks before finished code review), and we're | |
1803 # running local presubmit anyway. | |
1804 if 'presubmit' in builder: | |
1805 masters[master].pop(builder) | |
1806 else: | |
1807 # Convert testfilter format to the one expected by git-cl-try. | |
1808 testfilter = masters[master][builder].get('testfilter', 'defaulttests') | |
1809 masters[master][builder] = [testfilter] | |
1802 | 1810 |
1803 # Explicitly iterate over copies of dicts since we mutate them. | 1811 return masters |
1804 for master in builders.keys(): | |
1805 for builder in builders[master].keys(): | |
1806 # Do not trigger presubmit builders, since they're likely to fail | |
1807 # (e.g. OWNERS checks before finished code review), and we're | |
1808 # running local presubmit anyway. | |
1809 if 'presubmit' in builder: | |
1810 builders[master].pop(builder) | |
1811 | |
1812 return builders | |
OLD | NEW |