Files
platform-external-webrtc/infra/specs/PRESUBMIT.py
Mirko Bonadei b5ab062a3e Revert "Add 2 additional tests config in waterfalls.pyl."
This reverts commit 429c1bd74d5b821a360be6a215bcbe7c422bedeb.

Reason for revert: It breaks some CQ bots (e.g. https://ci.chromium.org/ui/p/webrtc/builders/try/linux_compile_rel/42825/overview). I am reverting to check is this is the culprit.

Original change's description:
> Add 2 additional tests config in waterfalls.pyl.
>
> * Add a presubmit check that generate_builbot_json.py has been called.
> * Add a webrtc_mixins.pyl file.
>
> Bug: webrtc:13899
> Change-Id: I7c4226ddd80bf9376bcb91476a1446a0392e7ec6
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257904
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Jeremy Leconte <jleconte@google.com>
> Cr-Commit-Position: refs/heads/main@{#36428}

Bug: webrtc:13899
Change-Id: Ic79306688c26937a988a9eacb4799f53f7145c65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257919
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36431}
2022-04-04 18:23:08 +00:00

44 lines
1.4 KiB
Python

# Copyright (c) 2022 The WebRTC 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 in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
def _HasLocalChanges(input_api):
ret = input_api.subprocess.call(['git', 'diff', '--quiet'])
return ret != 0
def CheckPatchFormatted(input_api, output_api):
results = []
file_filter = lambda x: x.LocalPath().endswith('.pyl')
affected_files = input_api.AffectedFiles(include_deletes=False,
file_filter=file_filter)
for f in affected_files:
cmd = ['yapf', '-i', f.AbsoluteLocalPath()]
if input_api.subprocess.call(cmd):
results.append(output_api.PresubmitError('Error calling "' + cmd + '"'))
if _HasLocalChanges(input_api):
msg = ('Diff found after running "yapf -i" on modified .pyl files.\n'
'Please commit or discard the new changes.')
results.append(output_api.PresubmitError(msg))
return results
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(CheckPatchFormatted(input_api, output_api))
return results
def CheckChangeOnCommit(input_api, output_api):
results = []
results.extend(CheckPatchFormatted(input_api, output_api))
return results