summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsergiyb <sergiyb@chromium.org>2015-06-01 09:04:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-01 16:05:06 +0000
commit87e80c7a628381644013e3b96b437276d9b19bcd (patch)
treee7457de76651ab4244ec3a13192b01c09957f0c3
parentc27312546394b958473dc441b96274797e0ae339 (diff)
downloadchromium_src-87e80c7a628381644013e3b96b437276d9b19bcd.zip
chromium_src-87e80c7a628381644013e3b96b437276d9b19bcd.tar.gz
chromium_src-87e80c7a628381644013e3b96b437276d9b19bcd.tar.bz2
Use script in depot_tools to retrieve builders from new cq.cfg
R=pgervais@chromium.org TEST=ran git-cl-try on this CL Review URL: https://codereview.chromium.org/1152823005 Cr-Commit-Position: refs/heads/master@{#332200}
-rw-r--r--PRESUBMIT.py49
-rw-r--r--testing/commit_queue/OWNERS7
-rw-r--r--testing/commit_queue/config.json102
3 files changed, 24 insertions, 134 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 751ae52..5a13d2f 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1784,29 +1784,28 @@ def CheckChangeOnCommit(input_api, output_api):
def GetPreferredTryMasters(project, change):
- import re
- files = change.LocalPaths()
-
- import os
import json
- with open(os.path.join(
- change.RepositoryRoot(), 'testing', 'commit_queue', 'config.json')) as f:
- cq_config = json.load(f)
- cq_verifiers = cq_config.get('verifiers_no_patch', {})
- cq_try_jobs = cq_verifiers.get('try_job_verifier', {})
- builders = cq_try_jobs.get('launched', {})
-
- for master, master_config in cq_try_jobs.get('triggered', {}).iteritems():
- for triggered_bot in master_config:
- builders.get(master, {}).pop(triggered_bot, None)
-
- # Explicitly iterate over copies of dicts since we mutate them.
- for master in builders.keys():
- for builder in builders[master].keys():
- # 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' in builder:
- builders[master].pop(builder)
-
- return builders
+ import os.path
+ 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.
+ masters = json.loads(subprocess.check_output(
+ ['commit_queue', 'builders', cq_config_path], shell=True))
+
+ # Explicitly iterate over copies of keys since we mutate them.
+ for master in masters.keys():
+ for builder in masters[master].keys():
+ # 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' in builder:
+ masters[master].pop(builder)
+ else:
+ # Convert testfilter format to the one expected by git-cl-try.
+ testfilter = masters[master][builder].get('testfilter', 'defaulttests')
+ masters[master][builder] = [testfilter]
+
+ return masters
diff --git a/testing/commit_queue/OWNERS b/testing/commit_queue/OWNERS
deleted file mode 100644
index b8fe80c..0000000
--- a/testing/commit_queue/OWNERS
+++ /dev/null
@@ -1,7 +0,0 @@
-# This is needed because of * in testing/OWNERS .
-set noparent
-
-phajdan.jr@chromium.org
-sergeyberezin@chromium.org
-sergiyb@chromium.org
-sheyang@chromium.org
diff --git a/testing/commit_queue/config.json b/testing/commit_queue/config.json
deleted file mode 100644
index b210ccc..0000000
--- a/testing/commit_queue/config.json
+++ /dev/null
@@ -1,102 +0,0 @@
-{
- "_comment1": "This file is no longer used by CQ. Instead CQ reads",
- "_comment2": "infra/config/cq.cfg. However, this file is still used by",
- "_comment3": "git-cl-try and thus this list must be manually kept in sync",
- "_comment4": "to the list of builders in infra/config/cq.cfg. We apologize",
- "_comment5": "for the incovenience and are working on a fix that will make",
- "_comment6": "git-cl-try also read infra/config/cq.cfg.",
-
- "verifiers_no_patch": {
- "try_job_verifier": {
- "launched": {
- "tryserver.chromium.linux": {
- "android_arm64_dbg_recipe": [
- "defaulttests"
- ],
- "android_chromium_gn_compile_dbg": [
- "defaulttests"
- ],
- "android_chromium_gn_compile_rel": [
- "defaulttests"
- ],
- "android_clang_dbg_recipe": [
- "defaulttests"
- ],
- "android_compile_dbg": [
- "defaulttests"
- ],
- "cast_shell_android": [
- "defaulttests"
- ],
- "cast_shell_linux": [
- "defaulttests"
- ],
- "chromium_presubmit": [
- "defaulttests"
- ],
- "linux_android_rel_ng": [
- "defaulttests"
- ],
- "linux_chromium_asan_rel_ng": [
- "defaulttests"
- ],
- "linux_chromium_chromeos_compile_dbg_ng": [
- "defaulttests"
- ],
- "linux_chromium_chromeos_ozone_rel_ng": [
- "defaulttests"
- ],
- "linux_chromium_chromeos_rel_ng": [
- "defaulttests"
- ],
- "linux_chromium_clobber_rel_ng": [
- "defaulttests"
- ],
- "linux_chromium_compile_dbg_32_ng": [
- "compile"
- ],
- "linux_chromium_gn_chromeos_rel": [
- "defaulttests"
- ],
- "linux_chromium_gn_dbg": [
- "defaulttests"
- ],
- "linux_chromium_gn_rel": [
- "defaulttests"
- ],
- "linux_chromium_rel_ng": [
- "defaulttests"
- ]
- },
- "tryserver.chromium.mac": {
- "ios_dbg_simulator_ninja": [
- "defaulttests"
- ],
- "ios_rel_device_ninja": [
- "defaulttests"
- ],
- "mac_chromium_compile_dbg_ng": [
- "defaulttests"
- ],
- "mac_chromium_rel_ng": [
- "defaulttests"
- ]
- },
- "tryserver.chromium.win": {
- "win8_chromium_rel": [
- "defaulttests"
- ],
- "win_chromium_compile_dbg_ng": [
- "defaulttests"
- ],
- "win_chromium_rel_ng": [
- "defaulttests"
- ],
- "win_chromium_x64_rel_ng": [
- "defaulttests"
- ]
- }
- }
- }
- }
-}