Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: build/android/PRESUBMIT.py

Issue 1416703003: [Android] Add a configurable environment for devil/. (RELAND 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/android/adb_install_apk.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Presubmit script for android buildbot. 5 """Presubmit script for android buildbot.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
8 details on the presubmit API built into depot_tools. 8 details on the presubmit API built into depot_tools.
9 """ 9 """
10 10
11 11
12 def CommonChecks(input_api, output_api): 12 def CommonChecks(input_api, output_api):
13 output = [] 13 output = []
14 14
15 build_android_dir = input_api.PresubmitLocalPath()
16
15 def J(*dirs): 17 def J(*dirs):
16 """Returns a path relative to presubmit directory.""" 18 """Returns a path relative to presubmit directory."""
17 return input_api.os_path.join(input_api.PresubmitLocalPath(), *dirs) 19 return input_api.os_path.join(build_android_dir, *dirs)
18 20
19 build_pys = [ 21 build_pys = [
20 r'gyp/.*\.py$', 22 r'gyp/.*\.py$',
21 r'gn/.*\.py', 23 r'gn/.*\.py',
22 r'incremental_install/.*\.py', 24 r'incremental_install/.*\.py',
23 ] 25 ]
24 output.extend(input_api.canned_checks.RunPylint( 26 output.extend(input_api.canned_checks.RunPylint(
25 input_api, 27 input_api,
26 output_api, 28 output_api,
27 pylintrc='pylintrc', 29 pylintrc='pylintrc',
28 # symbols has its own PRESUBMIT.py 30 # symbols has its own PRESUBMIT.py
29 black_list=build_pys + [r'pylib/symbols/.*\.py$'], 31 black_list=build_pys + [r'pylib/symbols/.*\.py$'],
30 extra_paths_list=[J(), J('buildbot')])) 32 extra_paths_list=[J(), J('buildbot')]))
31 output.extend(input_api.canned_checks.RunPylint( 33 output.extend(input_api.canned_checks.RunPylint(
32 input_api, 34 input_api,
33 output_api, 35 output_api,
34 white_list=build_pys, 36 white_list=build_pys,
35 extra_paths_list=[J('gyp'), J('gn')])) 37 extra_paths_list=[J('gyp'), J('gn')]))
36 38
37 # Disabled due to http://crbug.com/410936 39 # Disabled due to http://crbug.com/410936
38 #output.extend(input_api.canned_checks.RunUnitTestsInDirectory( 40 #output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
39 #input_api, output_api, J('buildbot', 'tests'))) 41 #input_api, output_api, J('buildbot', 'tests')))
40 42
41 pylib_test_env = dict(input_api.environ) 43 pylib_test_env = dict(input_api.environ)
42 pylib_test_env.update({ 44 pylib_test_env.update({
43 'PYTHONPATH': input_api.PresubmitLocalPath(), 45 'PYTHONPATH': build_android_dir,
44 'PYTHONDONTWRITEBYTECODE': '1', 46 'PYTHONDONTWRITEBYTECODE': '1',
45 }) 47 })
46 output.extend(input_api.canned_checks.RunUnitTests( 48 output.extend(input_api.canned_checks.RunUnitTests(
47 input_api, 49 input_api,
48 output_api, 50 output_api,
49 unit_tests=[ 51 unit_tests=[
50 J('.', 'emma_coverage_stats_test.py'), 52 J('.', 'emma_coverage_stats_test.py'),
51 J('devil', 'android', 'fastboot_utils_test.py'),
52 J('devil', 'android', 'battery_utils_test.py'),
53 J('devil', 'android', 'device_utils_test.py'),
54 J('devil', 'android', 'md5sum_test.py'),
55 J('devil', 'android', 'logcat_monitor_test.py'),
56 J('devil', 'utils', 'cmd_helper_test.py'),
57 J('devil', 'utils', 'timeout_retry_unittest.py'),
58 J('gyp', 'util', 'md5_check_test.py'), 53 J('gyp', 'util', 'md5_check_test.py'),
59 J('play_services', 'update_test.py'), 54 J('play_services', 'update_test.py'),
60 J('pylib', 'base', 'test_dispatcher_unittest.py'), 55 J('pylib', 'base', 'test_dispatcher_unittest.py'),
61 J('pylib', 'gtest', 'gtest_test_instance_test.py'), 56 J('pylib', 'gtest', 'gtest_test_instance_test.py'),
62 J('pylib', 'instrumentation', 57 J('pylib', 'instrumentation',
63 'instrumentation_test_instance_test.py'), 58 'instrumentation_test_instance_test.py'),
64 J('pylib', 'results', 'json_results_test.py'), 59 J('pylib', 'results', 'json_results_test.py'),
65 ], 60 ],
66 env=pylib_test_env)) 61 env=pylib_test_env))
62
63
64 devil_test_env = dict(pylib_test_env)
65 devil_test_env.update({
66 'DEVIL_ENV_CONFIG':
67 input_api.os_path.join(build_android_dir, 'devil_chromium.json')
68 })
69 output.extend(input_api.canned_checks.RunUnitTests(
70 input_api,
71 output_api,
72 unit_tests=[
73 J('devil', 'android', 'battery_utils_test.py'),
74 J('devil', 'android', 'device_utils_test.py'),
75 J('devil', 'android', 'fastboot_utils_test.py'),
76 J('devil', 'android', 'md5sum_test.py'),
77 J('devil', 'android', 'logcat_monitor_test.py'),
78 J('devil', 'utils', 'cmd_helper_test.py'),
79 J('devil', 'utils', 'timeout_retry_unittest.py'),
80 ],
81 env=devil_test_env))
67 return output 82 return output
68 83
69 84
70 def CheckChangeOnUpload(input_api, output_api): 85 def CheckChangeOnUpload(input_api, output_api):
71 return CommonChecks(input_api, output_api) 86 return CommonChecks(input_api, output_api)
72 87
73 88
74 def CheckChangeOnCommit(input_api, output_api): 89 def CheckChangeOnCommit(input_api, output_api):
75 return CommonChecks(input_api, output_api) 90 return CommonChecks(input_api, output_api)
OLDNEW
« no previous file with comments | « no previous file | build/android/adb_install_apk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698