Hash :
237479a2
Author :
Date :
2022-05-02T14:22:11
Fix presubmit following https://crrev.com/c/3611486 Switch to python3 for to get expected dict.keys() ordering python behavior/spec changed around ~3.6-3.7 https://stackoverflow.com/a/40007169 Reorder mixins that got out of order. Bug: angleproject:7242 Change-Id: I5fbc973ccc52b11f7db55c50e2ae7af54361dd40 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3622053 Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
# Copyright 2021 The ANGLE 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.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into depot_tools.
"""
import os
USE_PYTHON3 = True
def _CommonChecks(input_api, output_api):
d = os.path.dirname
angle_root = d(d(input_api.PresubmitLocalPath()))
gen_script = os.path.join(angle_root, 'testing', 'buildbot', 'generate_buildbot_json.py')
# Validate the format of the mb_config.pyl file.
mb_path = os.path.join(angle_root, 'tools', 'mb', 'mb.py')
config_path = os.path.join(input_api.PresubmitLocalPath(), 'angle_mb_config.pyl')
commands = [
input_api.Command(
name='generate_buildbot_json',
cmd=[
input_api.python3_executable, gen_script, '--check', '--verbose',
'--pyl-files-dir',
input_api.PresubmitLocalPath()
],
kwargs={},
message=output_api.PresubmitError),
input_api.Command(
name='mb_validate',
cmd=[
input_api.python3_executable,
mb_path,
'validate',
'-f',
config_path,
],
kwargs={'cwd': input_api.PresubmitLocalPath()},
message=output_api.PresubmitError),
]
messages = []
messages.extend(input_api.RunTests(commands))
return messages
def CheckChangeOnUpload(input_api, output_api):
return _CommonChecks(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return _CommonChecks(input_api, output_api)