Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Top-level presubmit script for Chromium. | 5 """Top-level presubmit script for Chromium. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details about the presubmit API built into gcl. | 8 for more details about the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 996 'Possibly invalid OS macro[s] found. Please fix your code\n' | 996 'Possibly invalid OS macro[s] found. Please fix your code\n' |
| 997 'or add your macro to src/PRESUBMIT.py.', bad_macros)] | 997 'or add your macro to src/PRESUBMIT.py.', bad_macros)] |
| 998 | 998 |
| 999 | 999 |
| 1000 def CheckChangeOnUpload(input_api, output_api): | 1000 def CheckChangeOnUpload(input_api, output_api): |
| 1001 results = [] | 1001 results = [] |
| 1002 results.extend(_CommonChecks(input_api, output_api)) | 1002 results.extend(_CommonChecks(input_api, output_api)) |
| 1003 return results | 1003 return results |
| 1004 | 1004 |
| 1005 | 1005 |
| 1006 def GetDefaultTryConfigs(bots=None): | |
| 1007 # To add tests to this list, they MUST be in | |
|
M-A Ruel
2013/11/05 03:59:28
It could be a docstring. Also document that |bots|
ghost stip (do not use)
2013/11/05 22:59:19
Done.
| |
| 1008 # /chrome/trunk/tools/build/masters/master.chromium/master_gatekeeper_cfg.py | |
| 1009 # or somehow close the tree whenever they break. | |
| 1010 standard_tests = [ | |
| 1011 'base_unittests', | |
| 1012 'browser_tests', | |
| 1013 'cacheinvalidation_unittests', | |
| 1014 'check_deps', | |
| 1015 'content_browsertests', | |
| 1016 'content_unittests', | |
| 1017 'crypto_unittests', | |
| 1018 #'gfx_unittests', | |
| 1019 # Broken in release. | |
| 1020 #'url_unittests', | |
|
M-A Ruel
2013/11/05 03:59:28
The test was renamed from googleurl, hence the imp
ghost stip (do not use)
2013/11/05 22:59:19
Done.
| |
| 1021 'gpu_unittests', | |
| 1022 'ipc_tests', | |
| 1023 'interactive_ui_tests', | |
| 1024 'jingle_unittests', | |
| 1025 'media_unittests', | |
| 1026 'net_unittests', | |
| 1027 'ppapi_unittests', | |
| 1028 'printing_unittests', | |
| 1029 'sql_unittests', | |
| 1030 'sync_unit_tests', | |
| 1031 'unit_tests', | |
| 1032 #'webkit_unit_tests', | |
| 1033 ] | |
| 1034 | |
| 1035 # Use a smaller set of tests for *_aura, since there's a lot of overlap with | |
| 1036 # the corresponding *_rel builders. | |
| 1037 # Note: *_aura are Release builders even if their names convey otherwise. | |
|
M-A Ruel
2013/11/05 03:59:28
Do we still have non-aura builder for Windows? Pro
ghost stip (do not use)
2013/11/05 22:59:19
waiting on kbr/egr's comments
| |
| 1038 aura_tests = [ | |
| 1039 'app_list_unittests', | |
| 1040 'aura_unittests', | |
| 1041 'browser_tests', | |
| 1042 'compositor_unittests', | |
| 1043 'content_browsertests', | |
| 1044 'content_unittests', | |
| 1045 'interactive_ui_tests', | |
| 1046 'unit_tests', | |
| 1047 'views_unittests', | |
| 1048 ] | |
| 1049 linux_aura_tests = aura_tests[:] | |
| 1050 linux_aura_tests.remove('views_unittests') | |
| 1051 win7_aura_tests = aura_tests[:] | |
| 1052 win7_aura_tests.remove('app_list_unittests') | |
| 1053 builders_and_tests = { | |
| 1054 # TODO(maruel): Figure out a way to run 'sizes' where people can | |
| 1055 # effectively update the perf expectation correctly. This requires a | |
| 1056 # clobber=True build running 'sizes'. 'sizes' is not accurate with | |
| 1057 # incremental build. Reference: | |
| 1058 # http://chromium.org/developers/tree-sheriffs/perf-sheriffs. | |
| 1059 # TODO(maruel): An option would be to run 'sizes' but not count a failure | |
| 1060 # of this step as a try job failure. | |
| 1061 'android_dbg': ['slave_steps'], | |
| 1062 'android_clang_dbg': ['slave_steps'], | |
| 1063 'android_aosp': ['compile'], | |
| 1064 'ios_dbg_simulator': [ | |
| 1065 'compile', | |
| 1066 'base_unittests', | |
| 1067 'content_unittests', | |
| 1068 'crypto_unittests', | |
| 1069 'url_unittests', | |
| 1070 'net_unittests', | |
| 1071 'sql_unittests', | |
| 1072 'ui_unittests', | |
| 1073 ], | |
| 1074 'ios_rel_device': ['compile'], | |
| 1075 'linux_aura': linux_aura_tests, | |
| 1076 'linux_asan': ['defaulttests'], | |
| 1077 'linux_clang': ['compile'], | |
| 1078 'linux_chromeos_clang': ['compile'], | |
| 1079 # Note: It is a Release builder even if its name convey otherwise. | |
| 1080 'linux_chromeos': standard_tests + [ | |
| 1081 'app_list_unittests', | |
| 1082 'aura_unittests', | |
| 1083 'ash_unittests', | |
| 1084 'chromeos_unittests', | |
| 1085 'components_unittests', | |
| 1086 'dbus_unittests', | |
| 1087 'device_unittests', | |
| 1088 'sandbox_linux_unittests', | |
| 1089 ], | |
| 1090 'linux_rel': standard_tests + [ | |
| 1091 'cc_unittests', | |
| 1092 'chromedriver2_unittests', | |
| 1093 'components_unittests', | |
| 1094 'nacl_integration', | |
| 1095 'remoting_unittests', | |
| 1096 'sandbox_linux_unittests', | |
| 1097 'sync_integration_tests', | |
| 1098 ], | |
| 1099 'mac': ['compile'], | |
| 1100 'mac_rel': standard_tests + [ | |
| 1101 'app_list_unittests', | |
| 1102 'cc_unittests', | |
| 1103 'chromedriver2_unittests', | |
| 1104 'components_unittests', | |
| 1105 'message_center_unittests', | |
| 1106 'nacl_integration', | |
| 1107 'remoting_unittests', | |
| 1108 'sync_integration_tests', | |
| 1109 'telemetry_unittests', | |
| 1110 ], | |
| 1111 'win': ['compile'], | |
| 1112 'win7_aura': win7_aura_tests + [ | |
| 1113 'ash_unittests', | |
| 1114 ], | |
| 1115 'win_rel': standard_tests + [ | |
| 1116 'app_list_unittests', | |
| 1117 'cc_unittests', | |
| 1118 'chrome_frame_net_tests', | |
| 1119 'chrome_frame_tests', | |
| 1120 'chrome_frame_unittests', | |
| 1121 'chromedriver2_unittests', | |
| 1122 'components_unittests', | |
| 1123 'installer_util_unittests', | |
| 1124 'mini_installer_test', | |
| 1125 'nacl_integration', | |
| 1126 'remoting_unittests', | |
| 1127 'sync_integration_tests', | |
| 1128 'telemetry_unittests', | |
| 1129 ], | |
| 1130 'win_x64_rel': [ | |
| 1131 'base_unittests', | |
| 1132 ], | |
| 1133 } | |
| 1134 | |
| 1135 swarm_enabled_builders = ( | |
| 1136 'linux_rel', | |
| 1137 ) | |
| 1138 | |
| 1139 swarm_enabled_tests = ( | |
| 1140 'base_unittests', | |
| 1141 'browser_tests', | |
| 1142 'interactive_ui_tests', | |
| 1143 'net_unittests', | |
| 1144 'unit_tests', | |
| 1145 ) | |
| 1146 | |
| 1147 for bot in builders_and_tests: | |
| 1148 if bot in swarm_enabled_builders: | |
| 1149 builders_and_tests[bot] = [x + '_swarm' if x in swarm_enabled_tests else x | |
| 1150 for x in builders_and_tests[bot]] | |
| 1151 | |
| 1152 if bots: | |
| 1153 return [(bot, set(builders_and_tests[bot])) for bot in bots] | |
| 1154 else: | |
| 1155 return [(bot, set(tests)) for bot, tests in builders_and_tests.iteritems()] | |
| 1156 | |
| 1157 | |
| 1006 def CheckChangeOnCommit(input_api, output_api): | 1158 def CheckChangeOnCommit(input_api, output_api): |
| 1007 results = [] | 1159 results = [] |
| 1008 results.extend(_CommonChecks(input_api, output_api)) | 1160 results.extend(_CommonChecks(input_api, output_api)) |
| 1009 # TODO(thestig) temporarily disabled, doesn't work in third_party/ | 1161 # TODO(thestig) temporarily disabled, doesn't work in third_party/ |
| 1010 #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( | 1162 #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( |
| 1011 # input_api, output_api, sources)) | 1163 # input_api, output_api, sources)) |
| 1012 # Make sure the tree is 'open'. | 1164 # Make sure the tree is 'open'. |
| 1013 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 1165 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
| 1014 input_api, | 1166 input_api, |
| 1015 output_api, | 1167 output_api, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 1027 return results | 1179 return results |
| 1028 | 1180 |
| 1029 | 1181 |
| 1030 def GetPreferredTrySlaves(project, change): | 1182 def GetPreferredTrySlaves(project, change): |
| 1031 files = change.LocalPaths() | 1183 files = change.LocalPaths() |
| 1032 | 1184 |
| 1033 if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files): | 1185 if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files): |
| 1034 return [] | 1186 return [] |
| 1035 | 1187 |
| 1036 if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files): | 1188 if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files): |
| 1037 return ['mac_rel', 'mac:compile'] | 1189 return GetDefaultTryConfigs(['mac_rel']) + [ |
| 1190 ('mac', set(['compile']))] | |
| 1038 if all(re.search('(^|[/_])win[/_.]', f) for f in files): | 1191 if all(re.search('(^|[/_])win[/_.]', f) for f in files): |
| 1039 return ['win_rel', 'win7_aura', 'win:compile'] | 1192 return GetDefaultTryConfigs(['win_rel', 'win7_aura']) + [ |
| 1193 ('win', set(['compile']))] | |
| 1040 if all(re.search('(^|[/_])android[/_.]', f) for f in files): | 1194 if all(re.search('(^|[/_])android[/_.]', f) for f in files): |
| 1041 return ['android_aosp', 'android_dbg', 'android_clang_dbg'] | 1195 return GetDefaultTryConfigs(['android_aosp', 'android_dbg', |
|
M-A Ruel
2013/11/05 03:59:28
Keep one entry per line. Since this is the kind of
ghost stip (do not use)
2013/11/05 22:59:19
Done.
| |
| 1196 'android_clang_dbg']) | |
| 1042 if all(re.search('^native_client_sdk', f) for f in files): | 1197 if all(re.search('^native_client_sdk', f) for f in files): |
| 1043 return ['linux_nacl_sdk', 'win_nacl_sdk', 'mac_nacl_sdk'] | 1198 return GetDefaultTryConfigs(['linux_nacl_sdk', 'win_nacl_sdk', |
| 1199 'mac_nacl_sdk']) | |
| 1044 if all(re.search('[/_]ios[/_.]', f) for f in files): | 1200 if all(re.search('[/_]ios[/_.]', f) for f in files): |
| 1045 return ['ios_rel_device', 'ios_dbg_simulator'] | 1201 return GetDefaultTryConfigs(['ios_rel_device', 'ios_dbg_simulator']) |
| 1046 | 1202 |
| 1047 trybots = [ | 1203 trybots = GetDefaultTryConfigs([ |
| 1048 'android_clang_dbg', | 1204 'android_clang_dbg', |
| 1049 'android_dbg', | 1205 'android_dbg', |
| 1050 'ios_dbg_simulator', | 1206 'ios_dbg_simulator', |
| 1051 'ios_rel_device', | 1207 'ios_rel_device', |
| 1052 'linux_asan', | 1208 'linux_asan', |
| 1053 'linux_aura', | 1209 'linux_aura', |
| 1054 'linux_chromeos', | 1210 'linux_chromeos', |
| 1055 'linux_clang:compile', | 1211 'linux_clang', |
| 1056 'linux_rel', | 1212 'linux_rel', |
| 1057 'mac_rel', | 1213 'mac_rel', |
| 1058 'mac:compile', | 1214 'mac', |
| 1059 'win7_aura', | 1215 'win7_aura', |
| 1060 'win_rel', | 1216 'win_rel', |
| 1061 'win:compile', | 1217 'win', |
| 1062 'win_x64_rel:base_unittests', | 1218 'win_x64_rel', |
| 1063 ] | 1219 ]) |
| 1064 | 1220 |
| 1065 # Match things like path/aura/file.cc and path/file_aura.cc. | 1221 # Match things like path/aura/file.cc and path/file_aura.cc. |
| 1066 # Same for chromeos. | 1222 # Same for chromeos. |
| 1067 if any(re.search('[/_](aura|chromeos)', f) for f in files): | 1223 if any(re.search('[/_](aura|chromeos)', f) for f in files): |
| 1068 trybots += ['linux_chromeos_clang:compile', 'linux_chromeos_asan'] | 1224 trybots += GetDefaultTryConfigs(['linux_chromeos_clang']) |
|
M-A Ruel
2013/11/05 03:59:28
I highly prefer explicit append/extend.
ghost stip (do not use)
2013/11/05 22:59:19
Done.
| |
| 1225 trybots += [('linux_chromeos_asan', set(['defaulttests']))] | |
| 1069 | 1226 |
| 1070 # If there are gyp changes to base, build, or chromeos, run a full cros build | 1227 # If there are gyp changes to base, build, or chromeos, run a full cros build |
| 1071 # in addition to the shorter linux_chromeos build. Changes to high level gyp | 1228 # in addition to the shorter linux_chromeos build. Changes to high level gyp |
| 1072 # files have a much higher chance of breaking the cros build, which is | 1229 # files have a much higher chance of breaking the cros build, which is |
| 1073 # differnt from the linux_chromeos build that most chrome developers test | 1230 # differnt from the linux_chromeos build that most chrome developers test |
| 1074 # with. | 1231 # with. |
| 1075 if any(re.search('^(base|build|chromeos).*\.gypi?$', f) for f in files): | 1232 if any(re.search('^(base|build|chromeos).*\.gypi?$', f) for f in files): |
| 1076 trybots += ['cros_x86'] | 1233 trybots += [('cros_x86', set(['defaulttests']))] |
| 1077 | 1234 |
| 1078 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it | 1235 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it |
| 1079 # unless they're .gyp(i) files as changes to those files can break the gyp | 1236 # unless they're .gyp(i) files as changes to those files can break the gyp |
| 1080 # step on that bot. | 1237 # step on that bot. |
| 1081 if (not all(re.search('^chrome', f) for f in files) or | 1238 if (not all(re.search('^chrome', f) for f in files) or |
| 1082 any(re.search('\.gypi?$', f) for f in files)): | 1239 any(re.search('\.gypi?$', f) for f in files)): |
| 1083 trybots += ['android_aosp'] | 1240 trybots += GetDefaultTryConfigs(['android_aosp']) |
| 1084 | 1241 |
| 1085 return trybots | 1242 return trybots |
| OLD | NEW |