blob: bca8cd77773e72b1b44d5557924953ef477d904b [file] [log] [blame]
kbre85ee562016-02-09 04:37:351# Copyright (c) 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5"""Top-level presubmit script for gpu.
6
7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8for more details about the presubmit API built into depot_tools.
9"""
10
Jonathan Backer16cd5362018-01-17 17:00:1011def PostUploadHook(cl, _change, output_api):
kbre85ee562016-02-09 04:37:3512 """git cl upload will call this hook after the issue is created/modified.
13
kbr43842632017-02-16 19:06:5614 This hook modifies the CL description in order to run extra GPU
15 tests (in particular, the WebGL 2.0 conformance tests) in addition
16 to the regular CQ try bots. This test suite is too large to run
17 against all Chromium commits, but should be run against changes
18 likely to affect these tests.
Sunny Sachanandani4b2894f2017-04-18 02:30:0519
20 When adding/removing tests here, ensure that both gpu/PRESUBMIT.py and
21 ui/gl/PRESUBMIT.py are updated.
kbre85ee562016-02-09 04:37:3522 """
kbr43842632017-02-16 19:06:5623 return output_api.EnsureCQIncludeTrybotsAreAdded(
24 cl,
25 [
26 'master.tryserver.chromium.linux:linux_optional_gpu_tests_rel',
27 'master.tryserver.chromium.mac:mac_optional_gpu_tests_rel',
28 'master.tryserver.chromium.win:win_optional_gpu_tests_rel',
ynovikovfc4582fa2017-03-03 22:18:0529 'master.tryserver.chromium.android:android_optional_gpu_tests_rel',
kbr43842632017-02-16 19:06:5630 ],
31 'Automatically added optional GPU tests to run on CQ.')
Jonathan Backer16cd5362018-01-17 17:00:1032
33def CommonChecks(input_api, output_api):
34 import sys
35
36 output = []
37 sys_path_backup = sys.path
38 try:
39 sys.path = [
40 input_api.PresubmitLocalPath()
41 ] + sys.path
42 disabled_warnings = [
43 'W0622', # redefined-builtin
44 'R0923', # interface-not-implemented
45 ]
46 output.extend(input_api.canned_checks.RunPylint(
47 input_api,
48 output_api,
49 disabled_warnings=disabled_warnings))
50 finally:
51 sys.path = sys_path_backup
52
53 return output
54
55
56def CheckChangeOnUpload(input_api, output_api):
57 return CommonChecks(input_api, output_api)
58
59
60def CheckChangeOnCommit(input_api, output_api):
61 return CommonChecks(input_api, output_api)