Add layout test bots to changes to api.cc

Also restrict include/ rules to only add bots for changes affecting
headers

R=machenbach@chromium.org

Change-Id: I97dc3c6249994566912a82ac9fbf8c7d3a57890c
Reviewed-on: https://chromium-review.googlesource.com/519342
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45638}
This commit is contained in:
Jochen Eisinger 2017-05-31 15:52:43 +02:00 committed by Commit Bot
parent 6a65e6deef
commit b21bc232aa
2 changed files with 34 additions and 1 deletions

View File

@ -8,7 +8,7 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
import re
import os
def PostUploadHook(cl, change, output_api):
@ -17,6 +17,10 @@ def PostUploadHook(cl, change, output_api):
This hook adds extra try bots to the CL description in order to run layout
tests in addition to CQ try bots.
"""
def header_filter(f):
return '.h' in os.path.split(f.LocalPath())[1]
if not change.AffectedFiles(file_filter=header_filter):
return []
return output_api.EnsureCQIncludeTrybotsAreAdded(
cl,
[

29
src/PRESUBMIT.py Normal file
View File

@ -0,0 +1,29 @@
# Copyright 2017 the V8 project authors. All rights reserved.')
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for //v8/src
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
import os
def PostUploadHook(cl, change, output_api):
"""git cl upload will call this hook after the issue is created/modified.
This hook adds extra try bots to the CL description in order to run layout
tests in addition to CQ try bots.
"""
def is_api_cc(f):
return 'api.cc' == os.path.split(f.LocalPath())[1]
if not change.AffectedFiles(file_filter=is_api_cc):
return []
return output_api.EnsureCQIncludeTrybotsAreAdded(
cl,
[
'master.tryserver.chromium.linux:linux_chromium_rel_ng'
],
'Automatically added layout test trybots to run tests on CQ.')