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 """Top-level presubmit script for Blink. | 5 """Top-level presubmit script for Blink. |
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 gcl. | 8 for more details about the presubmit API built into gcl. |
9 """ | 9 """ |
10 | 10 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 337 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
338 input_api, output_api, | 338 input_api, output_api, |
339 json_url='http://blink-status.appspot.com/current?format=json')) | 339 json_url='http://blink-status.appspot.com/current?format=json')) |
340 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 340 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
341 input_api, output_api)) | 341 input_api, output_api)) |
342 results.extend(_CheckSubversionConfig(input_api, output_api)) | 342 results.extend(_CheckSubversionConfig(input_api, output_api)) |
343 return results | 343 return results |
344 | 344 |
345 | 345 |
346 def GetPreferredTryMasters(project, change): | 346 def GetPreferredTryMasters(project, change): |
347 return { | 347 import json |
348 'tryserver.blink': { | 348 import os.path |
349 'android_blink_compile_dbg': set(['defaulttests']), | 349 import platform |
350 'android_blink_compile_rel': set(['defaulttests']), | 350 import subprocess |
351 'android_chromium_gn_compile_rel': set(['defaulttests']), | 351 |
352 'linux_blink_compile_dbg': set(['defaulttests']), | 352 cq_config_path = os.path.join( |
353 'linux_blink_rel': set(['defaulttests']), | 353 change.RepositoryRoot(), 'infra', 'config', 'cq.cfg') |
354 'linux_chromium_gn_rel': set(['defaulttests']), | 354 # commit_queue.py below is a script in depot_tools directory, which has a |
355 'mac_blink_compile_dbg': set(['defaulttests']), | 355 # 'builders' command to retrieve a list of CQ builders from the CQ config. |
356 'mac_blink_rel': set(['defaulttests']), | 356 is_win = platform.system() == 'Windows' |
357 'win_blink_compile_dbg': set(['defaulttests']), | 357 masters = json.loads(subprocess.check_output( |
358 'win_blink_rel': set(['defaulttests']), | 358 ['commit_queue', 'builders', cq_config_path], shell=is_win)) |
359 }, | 359 |
360 } | 360 try_config = {} |
| 361 for master in masters: |
| 362 try_config.setdefault(master, {}) |
| 363 for builder in masters[master]: |
| 364 # Do not trigger presubmit builders, since they're likely to fail |
| 365 # (e.g. OWNERS checks before finished code review), and we're |
| 366 # running local presubmit anyway. |
| 367 if 'presubmit' not in builder: |
| 368 try_config[master][builder] = ['defaulttests'] |
| 369 |
| 370 return try_config |
OLD | NEW |