Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: PRESUBMIT.py

Issue 1294313002: Let GetPreferredTryMasters read from CQ config. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 2bb31b461f6a27b2f8e535f575ce95a50e236fd1..2dfe25ab081ed299df2e03c323bca3526bd8e545 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -344,17 +344,27 @@ def CheckChangeOnCommit(input_api, output_api):
def GetPreferredTryMasters(project, change):
- return {
- 'tryserver.blink': {
- 'android_blink_compile_dbg': set(['defaulttests']),
- 'android_blink_compile_rel': set(['defaulttests']),
- 'android_chromium_gn_compile_rel': set(['defaulttests']),
- 'linux_blink_compile_dbg': set(['defaulttests']),
- 'linux_blink_rel': set(['defaulttests']),
- 'linux_chromium_gn_rel': set(['defaulttests']),
- 'mac_blink_compile_dbg': set(['defaulttests']),
- 'mac_blink_rel': set(['defaulttests']),
- 'win_blink_compile_dbg': set(['defaulttests']),
- 'win_blink_rel': set(['defaulttests']),
- },
- }
+ import json
+ import os.path
+ import platform
+ import subprocess
+
+ cq_config_path = os.path.join(
+ change.RepositoryRoot(), 'infra', 'config', 'cq.cfg')
+ # commit_queue.py below is a script in depot_tools directory, which has a
+ # 'builders' command to retrieve a list of CQ builders from the CQ config.
+ is_win = platform.system() == 'Windows'
+ masters = json.loads(subprocess.check_output(
+ ['commit_queue', 'builders', cq_config_path], shell=is_win))
+
+ try_config = {}
+ for master in masters:
+ try_config.setdefault(master, {})
+ for builder in masters[master]:
+ # Do not trigger presubmit builders, since they're likely to fail
+ # (e.g. OWNERS checks before finished code review), and we're
+ # running local presubmit anyway.
+ if 'presubmit' not in builder:
+ try_config[master][builder] = ['defaulttests']
+
+ return try_config
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698