aboutsummaryrefslogtreecommitdiff
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authorkjellander <kjellander@webrtc.org>2015-06-16 04:32:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-16 11:32:16 +0000
commit986ee082b628ffd3a90fbbe4b933a312489921e0 (patch)
treeab5928375804d69e6cd6c022a14cac5e34ed3e4a /PRESUBMIT.py
parentf050b9dd9af95d554ceba333e21e3c8a3b35c006 (diff)
downloadwebrtc-986ee082b628ffd3a90fbbe4b933a312489921e0.tar.gz
Move default trybots configuration to CQ config.
This is the same set of trybots that used to be configured in PRESUBMIT.py BUG=470518 TBR= Review URL: https://codereview.webrtc.org/1189583003 Cr-Commit-Position: refs/heads/master@{#9448}
Diffstat (limited to 'PRESUBMIT.py')
-rwxr-xr-xPRESUBMIT.py104
1 files changed, 24 insertions, 80 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index f8ca580af4..c429009199 100755
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -6,8 +6,11 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
+import json
import os
+import platform
import re
+import subprocess
import sys
@@ -332,85 +335,26 @@ def CheckChangeOnCommit(input_api, output_api):
return results
-def GetDefaultTryConfigs(bots=None):
- """Returns a list of ('bot', set(['tests']), optionally filtered by [bots].
-
- For WebRTC purposes, we always return an empty list of tests, since we want
- to run all tests by default on all our trybots.
- """
- return {'tryserver.webrtc': dict((bot, []) for bot in bots)}
-
-
# pylint: disable=W0613
def GetPreferredTryMasters(project, change):
- files = change.LocalPaths()
-
- android_gn_bots = [
- 'android_gn',
- 'android_gn_rel',
- ]
- android_bots = [
- 'android',
- 'android_arm64_rel',
- 'android_rel',
- 'android_clang',
- ] + android_gn_bots
- ios_bots = [
- 'ios',
- 'ios_arm64',
- 'ios_arm64_rel',
- 'ios_rel',
- 'ios32_sim',
- 'ios64_sim',
- ]
- linux_gn_bots = [
- 'linux_gn',
- 'linux_gn_rel',
- ]
- linux_bots = [
- 'linux',
- 'linux_asan',
- 'linux_baremetal',
- 'linux_msan',
- 'linux_rel',
- 'linux_tsan2',
- ] + linux_gn_bots
- mac_gn_bots = [
- 'mac_x64_gn',
- 'mac_x64_gn_rel',
- ]
- mac_bots = [
- 'mac',
- 'mac_asan',
- 'mac_baremetal',
- 'mac_rel',
- 'mac_x64',
- 'mac_x64_rel',
- ] + mac_gn_bots
- win_gn_bots = [
- 'win_x64_gn',
- 'win_x64_gn_rel',
- ]
- win_bots = [
- 'win',
- 'win_baremetal',
- 'win_drmemory_light',
- 'win_rel',
- 'win_x64_rel',
- ] + win_gn_bots
- if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files):
- return {}
- if all(re.search(r'[\\/]BUILD.gn$', f) for f in files):
- return GetDefaultTryConfigs(android_gn_bots + linux_gn_bots + mac_gn_bots +
- win_gn_bots)
- if all(re.search('[/_]mac[/_.]', f) for f in files):
- return GetDefaultTryConfigs(mac_bots)
- if all(re.search('(^|[/_])win[/_.]', f) for f in files):
- return GetDefaultTryConfigs(win_bots)
- if all(re.search('(^|[/_])android[/_.]', f) for f in files):
- return GetDefaultTryConfigs(android_bots)
- if all(re.search('[/_]ios[/_.]', f) for f in files):
- return GetDefaultTryConfigs(ios_bots)
-
- return GetDefaultTryConfigs(android_bots + ios_bots + linux_bots + mac_bots +
- win_bots)
+ 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]:
+ if 'presubmit' in builder:
+ # 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.
+ pass
+ else:
+ try_config[master][builder] = ['defaulttests']
+
+ return try_config