2013-01-09 07:49:57 +04:00
|
|
|
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
"""Presubmit script for android buildbot.
|
|
|
|
|
|
|
|
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
|
2015-01-31 03:20:48 +03:00
|
|
|
details on the presubmit API built into depot_tools.
|
2013-01-09 07:49:57 +04:00
|
|
|
"""
|
|
|
|
|
2013-01-17 02:52:22 +04:00
|
|
|
|
2013-01-09 07:49:57 +04:00
|
|
|
def CommonChecks(input_api, output_api):
|
|
|
|
output = []
|
|
|
|
|
2015-12-04 17:27:43 +03:00
|
|
|
build_android_dir = input_api.PresubmitLocalPath()
|
|
|
|
|
2013-01-09 07:49:57 +04:00
|
|
|
def J(*dirs):
|
|
|
|
"""Returns a path relative to presubmit directory."""
|
2015-12-04 17:27:43 +03:00
|
|
|
return input_api.os_path.join(build_android_dir, *dirs)
|
2013-01-09 07:49:57 +04:00
|
|
|
|
2015-09-16 22:56:47 +03:00
|
|
|
build_pys = [
|
|
|
|
r'gyp/.*\.py$',
|
|
|
|
r'gn/.*\.py',
|
|
|
|
]
|
2013-01-09 07:49:57 +04:00
|
|
|
output.extend(input_api.canned_checks.RunPylint(
|
|
|
|
input_api,
|
|
|
|
output_api,
|
2015-09-08 19:44:59 +03:00
|
|
|
pylintrc='pylintrc',
|
2016-05-05 20:58:50 +03:00
|
|
|
black_list=build_pys,
|
2016-03-10 06:01:00 +03:00
|
|
|
extra_paths_list=[
|
|
|
|
J(),
|
2016-07-14 07:00:50 +03:00
|
|
|
J('gyp'),
|
2016-03-10 06:01:00 +03:00
|
|
|
J('buildbot'),
|
|
|
|
J('..', '..', 'third_party', 'catapult', 'devil')
|
|
|
|
]))
|
2014-03-21 03:09:28 +04:00
|
|
|
output.extend(input_api.canned_checks.RunPylint(
|
|
|
|
input_api,
|
|
|
|
output_api,
|
2015-09-16 22:56:47 +03:00
|
|
|
white_list=build_pys,
|
2014-06-25 03:38:17 +04:00
|
|
|
extra_paths_list=[J('gyp'), J('gn')]))
|
2013-01-09 07:49:57 +04:00
|
|
|
|
2014-09-04 22:53:30 +04:00
|
|
|
# Disabled due to http://crbug.com/410936
|
|
|
|
#output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
|
|
|
|
#input_api, output_api, J('buildbot', 'tests')))
|
2014-07-11 04:20:34 +04:00
|
|
|
|
|
|
|
pylib_test_env = dict(input_api.environ)
|
|
|
|
pylib_test_env.update({
|
2015-12-04 17:27:43 +03:00
|
|
|
'PYTHONPATH': build_android_dir,
|
2014-07-11 04:20:34 +04:00
|
|
|
'PYTHONDONTWRITEBYTECODE': '1',
|
|
|
|
})
|
|
|
|
output.extend(input_api.canned_checks.RunUnitTests(
|
|
|
|
input_api,
|
|
|
|
output_api,
|
|
|
|
unit_tests=[
|
2015-07-29 04:35:17 +03:00
|
|
|
J('.', 'emma_coverage_stats_test.py'),
|
Reland of CallAndRecordIfStale(): Add knownledge of output_files, depfiles, stamp (patchset #1 id:1 of https://codereview.chromium.org/1369583002/ )
Reason for revert:
Fixed import path and ensured "ninja all" builds locally.
Original issue's description:
> Revert of CallAndRecordIfStale(): Add knownledge of output_files, depfiles, stamp (patchset #4 id:60001 of https://codereview.chromium.org/1356873003/ )
>
> Reason for revert:
> broke Android build (see other messages for details).
>
> Original issue's description:
> > CallAndRecordIfStale(): Add knownledge of output_files, depfiles, stamp
> >
> > Added output_paths to md5_check.py since it cuts down on
> > force=os.path.exists() boilder-plate (plus places that were forgetting
> > it). It also improves the message printed when PRINT_MD5_DIFFS=1 is set.
> >
> > Added a wrapper in build_utils.py that automatically handles --depfile
> > and --stamp options, which further cuts down on boilerplate in the
> > clients.
> >
> > Removed colorama to eliminate circular dependency between build_utils
> > and md5_check.
> >
> > BUG=533442
> >
> > Committed: https://crrev.com/dea0f30983bc18874ac8c49443fb5079d4c1b798
> > Cr-Commit-Position: refs/heads/master@{#350599}
>
> TBR=jbudorick@chromium.org,stgao@chromium.org,agrieve@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=533442
>
> Committed: https://crrev.com/1748d384c547136d059d413f5acbb1622ba548f0
> Cr-Commit-Position: refs/heads/master@{#350626}
TBR=jbudorick@chromium.org,stgao@chromium.org,caitkp@chromium.org
NOTRY=true
BUG=533442
Review URL: https://codereview.chromium.org/1369593002
Cr-Original-Commit-Position: refs/heads/master@{#350647}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca0e19488b8e75ae5546c09f89787dec580f0916
2015-09-24 23:27:11 +03:00
|
|
|
J('gyp', 'util', 'md5_check_test.py'),
|
2015-11-05 20:51:54 +03:00
|
|
|
J('play_services', 'update_test.py'),
|
2015-04-29 19:07:06 +03:00
|
|
|
J('pylib', 'base', 'test_dispatcher_unittest.py'),
|
2014-12-16 01:23:29 +03:00
|
|
|
J('pylib', 'gtest', 'gtest_test_instance_test.py'),
|
2015-01-13 05:51:06 +03:00
|
|
|
J('pylib', 'instrumentation',
|
|
|
|
'instrumentation_test_instance_test.py'),
|
2016-05-23 18:23:45 +03:00
|
|
|
J('pylib', 'local', 'device', 'local_device_test_run_test.py'),
|
2014-12-01 21:07:54 +03:00
|
|
|
J('pylib', 'results', 'json_results_test.py'),
|
2016-05-05 20:58:50 +03:00
|
|
|
J('pylib', 'symbols', 'elf_symbolizer_unittest.py'),
|
2014-08-05 20:05:13 +04:00
|
|
|
],
|
2014-07-11 04:20:34 +04:00
|
|
|
env=pylib_test_env))
|
2015-12-04 17:27:43 +03:00
|
|
|
|
2013-01-09 07:49:57 +04:00
|
|
|
return output
|
|
|
|
|
|
|
|
|
|
|
|
def CheckChangeOnUpload(input_api, output_api):
|
|
|
|
return CommonChecks(input_api, output_api)
|
|
|
|
|
|
|
|
|
|
|
|
def CheckChangeOnCommit(input_api, output_api):
|
|
|
|
return CommonChecks(input_api, output_api)
|