| 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 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 'net_unittests', | 1363 'net_unittests', |
| 1364 'unit_tests', | 1364 'unit_tests', |
| 1365 ) | 1365 ) |
| 1366 | 1366 |
| 1367 for bot in builders_and_tests: | 1367 for bot in builders_and_tests: |
| 1368 if bot in swarm_enabled_builders: | 1368 if bot in swarm_enabled_builders: |
| 1369 builders_and_tests[bot] = [x + '_swarm' if x in swarm_enabled_tests else x | 1369 builders_and_tests[bot] = [x + '_swarm' if x in swarm_enabled_tests else x |
| 1370 for x in builders_and_tests[bot]] | 1370 for x in builders_and_tests[bot]] |
| 1371 | 1371 |
| 1372 if bots: | 1372 if bots: |
| 1373 return [(bot, set(builders_and_tests[bot])) for bot in bots] | 1373 return { |
| 1374 'tryserver.chromium': dict((bot, set(builders_and_tests[bot])) |
| 1375 for bot in bots) |
| 1376 } |
| 1374 else: | 1377 else: |
| 1375 return [(bot, set(tests)) for bot, tests in builders_and_tests.iteritems()] | 1378 return { |
| 1379 'tryserver.chromium': dict( |
| 1380 (bot, set(tests)) |
| 1381 for bot, tests in builders_and_tests.iteritems()) |
| 1382 } |
| 1376 | 1383 |
| 1377 | 1384 |
| 1378 def CheckChangeOnCommit(input_api, output_api): | 1385 def CheckChangeOnCommit(input_api, output_api): |
| 1379 results = [] | 1386 results = [] |
| 1380 results.extend(_CommonChecks(input_api, output_api)) | 1387 results.extend(_CommonChecks(input_api, output_api)) |
| 1381 # TODO(thestig) temporarily disabled, doesn't work in third_party/ | 1388 # TODO(thestig) temporarily disabled, doesn't work in third_party/ |
| 1382 #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( | 1389 #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( |
| 1383 # input_api, output_api, sources)) | 1390 # input_api, output_api, sources)) |
| 1384 # Make sure the tree is 'open'. | 1391 # Make sure the tree is 'open'. |
| 1385 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 1392 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
| 1386 input_api, | 1393 input_api, |
| 1387 output_api, | 1394 output_api, |
| 1388 json_url='http://chromium-status.appspot.com/current?format=json')) | 1395 json_url='http://chromium-status.appspot.com/current?format=json')) |
| 1389 | 1396 |
| 1390 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 1397 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
| 1391 input_api, output_api)) | 1398 input_api, output_api)) |
| 1392 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 1399 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
| 1393 input_api, output_api)) | 1400 input_api, output_api)) |
| 1394 results.extend(_CheckSubversionConfig(input_api, output_api)) | 1401 results.extend(_CheckSubversionConfig(input_api, output_api)) |
| 1395 return results | 1402 return results |
| 1396 | 1403 |
| 1397 | 1404 |
| 1398 def GetPreferredTrySlaves(project, change): | 1405 def GetPreferredTryMasters(project, change): |
| 1399 files = change.LocalPaths() | 1406 files = change.LocalPaths() |
| 1400 | 1407 |
| 1401 if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files): | 1408 if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files): |
| 1402 return [] | 1409 return {} |
| 1403 | 1410 |
| 1404 if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files): | 1411 if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files): |
| 1405 return GetDefaultTryConfigs([ | 1412 return GetDefaultTryConfigs([ |
| 1406 'mac_chromium_compile_dbg', | 1413 'mac_chromium_compile_dbg', |
| 1407 'mac_chromium_rel', | 1414 'mac_chromium_rel', |
| 1408 'mac_rel' | 1415 'mac_rel' |
| 1409 ]) | 1416 ]) |
| 1410 if all(re.search('(^|[/_])win[/_.]', f) for f in files): | 1417 if all(re.search('(^|[/_])win[/_.]', f) for f in files): |
| 1411 return GetDefaultTryConfigs(['win', 'win_rel']) | 1418 return GetDefaultTryConfigs(['win', 'win_rel']) |
| 1412 if all(re.search('(^|[/_])android[/_.]', f) for f in files): | 1419 if all(re.search('(^|[/_])android[/_.]', f) for f in files): |
| 1413 return GetDefaultTryConfigs([ | 1420 return GetDefaultTryConfigs([ |
| 1414 'android_aosp', | 1421 'android_aosp', |
| 1415 'android_clang_dbg', | 1422 'android_clang_dbg', |
| 1416 'android_dbg', | 1423 'android_dbg', |
| 1417 ]) | 1424 ]) |
| 1418 if all(re.search('[/_]ios[/_.]', f) for f in files): | 1425 if all(re.search('[/_]ios[/_.]', f) for f in files): |
| 1419 return GetDefaultTryConfigs(['ios_rel_device', 'ios_dbg_simulator']) | 1426 return GetDefaultTryConfigs(['ios_rel_device', 'ios_dbg_simulator']) |
| 1420 | 1427 |
| 1421 trybots = GetDefaultTryConfigs([ | 1428 builders = [ |
| 1422 'android_clang_dbg', | 1429 'android_clang_dbg', |
| 1423 'android_dbg', | 1430 'android_dbg', |
| 1424 'ios_dbg_simulator', | 1431 'ios_dbg_simulator', |
| 1425 'ios_rel_device', | 1432 'ios_rel_device', |
| 1426 'linux_gtk', | 1433 'linux_gtk', |
| 1427 'linux_asan', | 1434 'linux_asan', |
| 1428 'linux_chromium_chromeos_rel', | 1435 'linux_chromium_chromeos_rel', |
| 1429 'linux_chromium_clang_dbg', | 1436 'linux_chromium_clang_dbg', |
| 1430 'linux_nacl_sdk_build', | 1437 'linux_nacl_sdk_build', |
| 1431 'linux_chromium_rel', | 1438 'linux_chromium_rel', |
| 1432 'linux_rel', | 1439 'linux_rel', |
| 1433 'mac_chromium_compile_dbg', | 1440 'mac_chromium_compile_dbg', |
| 1434 'mac_nacl_sdk_build', | 1441 'mac_nacl_sdk_build', |
| 1435 'mac_chromium_rel', | 1442 'mac_chromium_rel', |
| 1436 'mac_rel', | 1443 'mac_rel', |
| 1437 'win', | 1444 'win', |
| 1438 'win_nacl_sdk_build', | 1445 'win_nacl_sdk_build', |
| 1439 'win_rel', | 1446 'win_rel', |
| 1440 'win_x64_rel', | 1447 'win_x64_rel', |
| 1441 ]) | 1448 ] |
| 1442 | 1449 |
| 1443 # Match things like path/aura/file.cc and path/file_aura.cc. | 1450 # Match things like path/aura/file.cc and path/file_aura.cc. |
| 1444 # Same for chromeos. | 1451 # Same for chromeos. |
| 1445 if any(re.search('[/_](aura|chromeos)', f) for f in files): | 1452 if any(re.search('[/_](aura|chromeos)', f) for f in files): |
| 1446 trybots.extend(GetDefaultTryConfigs([ | 1453 builders.extend([ |
| 1447 'linux_chromeos_asan', 'linux_chromium_chromeos_clang_dbg'])) | 1454 'linux_chromeos_asan', |
| 1455 'linux_chromium_chromeos_clang_dbg' |
| 1456 ]) |
| 1448 | 1457 |
| 1449 # If there are gyp changes to base, build, or chromeos, run a full cros build | 1458 # If there are gyp changes to base, build, or chromeos, run a full cros build |
| 1450 # in addition to the shorter linux_chromeos build. Changes to high level gyp | 1459 # in addition to the shorter linux_chromeos build. Changes to high level gyp |
| 1451 # files have a much higher chance of breaking the cros build, which is | 1460 # files have a much higher chance of breaking the cros build, which is |
| 1452 # differnt from the linux_chromeos build that most chrome developers test | 1461 # differnt from the linux_chromeos build that most chrome developers test |
| 1453 # with. | 1462 # with. |
| 1454 if any(re.search('^(base|build|chromeos).*\.gypi?$', f) for f in files): | 1463 if any(re.search('^(base|build|chromeos).*\.gypi?$', f) for f in files): |
| 1455 trybots.extend(GetDefaultTryConfigs(['cros_x86'])) | 1464 builders.extend(['cros_x86']) |
| 1456 | 1465 |
| 1457 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it | 1466 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it |
| 1458 # unless they're .gyp(i) files as changes to those files can break the gyp | 1467 # unless they're .gyp(i) files as changes to those files can break the gyp |
| 1459 # step on that bot. | 1468 # step on that bot. |
| 1460 if (not all(re.search('^chrome', f) for f in files) or | 1469 if (not all(re.search('^chrome', f) for f in files) or |
| 1461 any(re.search('\.gypi?$', f) for f in files)): | 1470 any(re.search('\.gypi?$', f) for f in files)): |
| 1462 trybots.extend(GetDefaultTryConfigs(['android_aosp'])) | 1471 builders.extend(['android_aosp']) |
| 1463 | 1472 |
| 1464 return trybots | 1473 return GetDefaultTryConfigs(builders) |
| OLD | NEW |