kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 1 | # 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 | |
| 7 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 | for more details about the presubmit API built into depot_tools. |
| 9 | """ |
| 10 | |
Jonathan Backer | 16cd536 | 2018-01-17 17:00:10 | [diff] [blame^] | 11 | def PostUploadHook(cl, _change, output_api): |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 12 | """git cl upload will call this hook after the issue is created/modified. |
| 13 | |
kbr | 4384263 | 2017-02-16 19:06:56 | [diff] [blame] | 14 | 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 Sachanandani | 4b2894f | 2017-04-18 02:30:05 | [diff] [blame] | 19 | |
| 20 | When adding/removing tests here, ensure that both gpu/PRESUBMIT.py and |
| 21 | ui/gl/PRESUBMIT.py are updated. |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 22 | """ |
kbr | 4384263 | 2017-02-16 19:06:56 | [diff] [blame] | 23 | 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', |
ynovikov | fc4582fa | 2017-03-03 22:18:05 | [diff] [blame] | 29 | 'master.tryserver.chromium.android:android_optional_gpu_tests_rel', |
kbr | 4384263 | 2017-02-16 19:06:56 | [diff] [blame] | 30 | ], |
| 31 | 'Automatically added optional GPU tests to run on CQ.') |
Jonathan Backer | 16cd536 | 2018-01-17 17:00:10 | [diff] [blame^] | 32 | |
| 33 | def 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 | |
| 56 | def CheckChangeOnUpload(input_api, output_api): |
| 57 | return CommonChecks(input_api, output_api) |
| 58 | |
| 59 | |
| 60 | def CheckChangeOnCommit(input_api, output_api): |
| 61 | return CommonChecks(input_api, output_api) |