|
|
|
@ -12,6 +12,16 @@ import fnmatch
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ENSURE_FILE_TEMPLATE = r'''
|
|
|
|
|
|
|
|
$VerifiedPlatform linux-386 linux-amd64 linux-arm64 linux-armv6l linux-mips64
|
|
|
|
|
|
|
|
$VerifiedPlatform linux-ppc64 linux-ppc64le linux-s390x
|
|
|
|
|
|
|
|
$VerifiedPlatform mac-amd64
|
|
|
|
|
|
|
|
$VerifiedPlatform windows-386 windows-amd64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%s %s
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def DepotToolsPylint(input_api, output_api):
|
|
|
|
def DepotToolsPylint(input_api, output_api):
|
|
|
|
"""Gather all the pylint logic into one place to make it self-contained."""
|
|
|
|
"""Gather all the pylint logic into one place to make it self-contained."""
|
|
|
|
white_list = [
|
|
|
|
white_list = [
|
|
|
|
@ -59,6 +69,34 @@ def CommonChecks(input_api, output_api, tests_to_black_list):
|
|
|
|
tests.extend(unit_tests)
|
|
|
|
tests.extend(unit_tests)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print('Warning: not running unit tests on Windows')
|
|
|
|
print('Warning: not running unit tests on Windows')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Validate CIPD manifests.
|
|
|
|
|
|
|
|
root = input_api.os_path.normpath(
|
|
|
|
|
|
|
|
input_api.os_path.abspath(input_api.PresubmitLocalPath()))
|
|
|
|
|
|
|
|
rel_file = lambda rel: input_api.os_path.join(root, rel)
|
|
|
|
|
|
|
|
cipd_manifests = set(rel_file(input_api.os_path.join(*x)) for x in (
|
|
|
|
|
|
|
|
('cipd_manifest.txt',),
|
|
|
|
|
|
|
|
('bootstrap', 'win', 'manifest.txt'),
|
|
|
|
|
|
|
|
('bootstrap', 'win', 'manifest_bleeding_edge.txt'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Also generate a file for the cipd client itself.
|
|
|
|
|
|
|
|
('cipd_client_version',),
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
affected_manifests = input_api.AffectedFiles(
|
|
|
|
|
|
|
|
include_deletes=False,
|
|
|
|
|
|
|
|
file_filter=lambda x:
|
|
|
|
|
|
|
|
input_api.os_path.normpath(x.AbsoluteLocalPath()) in cipd_manifests)
|
|
|
|
|
|
|
|
for path in affected_manifests:
|
|
|
|
|
|
|
|
path = path.AbsoluteLocalPath()
|
|
|
|
|
|
|
|
if path.endswith('.txt'):
|
|
|
|
|
|
|
|
tests.append(input_api.canned_checks.CheckCIPDManifest(
|
|
|
|
|
|
|
|
input_api, output_api, path=path))
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
pkg = 'infra/tools/cipd/${platform}'
|
|
|
|
|
|
|
|
ver = input_api.ReadFile(path)
|
|
|
|
|
|
|
|
tests.append(input_api.canned_checks.CheckCIPDManifest(
|
|
|
|
|
|
|
|
input_api, output_api, content=ENSURE_FILE_TEMPLATE % (pkg, ver)))
|
|
|
|
|
|
|
|
|
|
|
|
results.extend(input_api.RunTests(tests))
|
|
|
|
results.extend(input_api.RunTests(tests))
|
|
|
|
return results
|
|
|
|
return results
|
|
|
|
|
|
|
|
|
|
|
|
|