diff options
author | stip@chromium.org <stip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 23:48:01 +0000 |
---|---|---|
committer | stip@chromium.org <stip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 23:48:01 +0000 |
commit | 38c6a51931fe958b7b59ba281157c828f84d4b79 (patch) | |
tree | 5b619d92cfe4f16907ab6c20b43bb89570b8ff75 /PRESUBMIT.py | |
parent | adf5f3543feadf581e3ba84d930efd18110ffa31 (diff) | |
download | chromium_src-38c6a51931fe958b7b59ba281157c828f84d4b79.zip chromium_src-38c6a51931fe958b7b59ba281157c828f84d4b79.tar.gz chromium_src-38c6a51931fe958b7b59ba281157c828f84d4b79.tar.bz2 |
Sync PRESUBMIT.py with CQ's projects.py.
This is a reland of https://codereview.chromium.org/58803002 which was reverted in https://codereview.chromium.org/64473002. It has been updated to reflect the latest projects.py changes.
BUG=278554
R=maruel@chromium.org
Review URL: https://codereview.chromium.org/116673003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241707 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 201 |
1 files changed, 186 insertions, 15 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 573a2c7..5698fe9 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -1207,6 +1207,168 @@ def CheckChangeOnUpload(input_api, output_api): return results +def GetDefaultTryConfigs(bots=None): + """Returns a list of ('bot', set(['tests']), optionally filtered by [bots]. + + To add tests to this list, they MUST be in the the corresponding master's + gatekeeper config. For example, anything on master.chromium would be closed by + tools/build/masters/master.chromium/master_gatekeeper_cfg.py. + + If 'bots' is specified, will only return configurations for bots in that list. + """ + + standard_tests = [ + 'base_unittests', + 'browser_tests', + 'cacheinvalidation_unittests', + 'check_deps', + 'check_deps2git', + 'content_browsertests', + 'content_unittests', + 'crypto_unittests', + #'gfx_unittests', + 'gpu_unittests', + 'interactive_ui_tests', + 'ipc_tests', + 'jingle_unittests', + 'media_unittests', + 'net_unittests', + 'ppapi_unittests', + 'printing_unittests', + 'sql_unittests', + 'sync_unit_tests', + 'unit_tests', + # Broken in release. + #'url_unittests', + #'webkit_unit_tests', + ] + + linux_aura_tests = [ + 'app_list_unittests', + 'aura_unittests', + 'browser_tests', + 'compositor_unittests', + 'content_browsertests', + 'content_unittests', + 'events_unittests', + 'interactive_ui_tests', + 'unit_tests', + ] + builders_and_tests = { + # TODO(maruel): Figure out a way to run 'sizes' where people can + # effectively update the perf expectation correctly. This requires a + # clobber=True build running 'sizes'. 'sizes' is not accurate with + # incremental build. Reference: + # http://chromium.org/developers/tree-sheriffs/perf-sheriffs. + # TODO(maruel): An option would be to run 'sizes' but not count a failure + # of this step as a try job failure. + 'android_aosp': ['compile'], + 'android_clang_dbg': ['slave_steps'], + 'android_dbg': ['slave_steps'], + 'cros_x86': ['defaulttests'], + 'ios_dbg_simulator': [ + 'compile', + 'base_unittests', + 'content_unittests', + 'crypto_unittests', + 'url_unittests', + 'net_unittests', + 'sql_unittests', + 'ui_unittests', + ], + 'ios_rel_device': ['compile'], + 'linux_asan': ['defaulttests'], + #TODO(stip): Change the name of this builder to reflect that it's release. + 'linux_aura': linux_aura_tests, + 'linux_chromeos_asan': ['defaulttests'], + 'linux_chromeos_clang': ['compile'], + # Note: It is a Release builder even if its name convey otherwise. + 'linux_chromeos': standard_tests + [ + 'app_list_unittests', + 'aura_unittests', + 'ash_unittests', + 'chromeos_unittests', + 'components_unittests', + 'dbus_unittests', + 'device_unittests', + 'events_unittests', + 'google_apis_unittests', + 'sandbox_linux_unittests', + ], + 'linux_clang': ['compile'], + 'linux_rel': standard_tests + [ + 'cc_unittests', + 'chromedriver2_unittests', + 'components_unittests', + 'google_apis_unittests', + 'nacl_integration', + 'remoting_unittests', + 'sandbox_linux_unittests', + 'sync_integration_tests', + ], + 'mac': ['compile'], + 'mac_rel': standard_tests + [ + 'app_list_unittests', + 'cc_unittests', + 'chromedriver2_unittests', + 'components_unittests', + 'google_apis_unittests', + 'message_center_unittests', + 'nacl_integration', + 'remoting_unittests', + 'sync_integration_tests', + 'telemetry_unittests', + ], + 'win': ['compile'], + 'win_rel': standard_tests + [ + 'app_list_unittests', + 'ash_unittests', + 'aura_unittests', + 'cc_unittests', + 'chrome_elf_unittests', + 'chromedriver2_unittests', + 'components_unittests', + 'compositor_unittests', + 'events_unittests', + 'google_apis_unittests', + 'installer_util_unittests', + 'mini_installer_test', + 'nacl_integration', + 'remoting_unittests', + 'sync_integration_tests', + 'telemetry_unittests', + 'views_unittests', + ], + 'win_x64_rel': [ + 'base_unittests', + ], + } + + swarm_enabled_builders = ( + 'linux_rel', + 'mac_rel', + 'win_rel', + ) + + swarm_enabled_tests = ( + 'base_unittests', + 'browser_tests', + 'interactive_ui_tests', + 'net_unittests', + 'unit_tests', + ) + + for bot in builders_and_tests: + if bot in swarm_enabled_builders: + builders_and_tests[bot] = [x + '_swarm' if x in swarm_enabled_tests else x + for x in builders_and_tests[bot]] + + if bots: + return [(bot, set(builders_and_tests[bot])) for bot in bots] + else: + return [(bot, set(tests)) for bot, tests in builders_and_tests.iteritems()] + + def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) @@ -1238,37 +1400,46 @@ def GetPreferredTrySlaves(project, change): return [] if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files): - return ['mac_rel', 'mac:compile'] + return GetDefaultTryConfigs(['mac', 'mac_rel']) if all(re.search('(^|[/_])win[/_.]', f) for f in files): - return ['win_rel', 'win:compile'] + return GetDefaultTryConfigs(['win', 'win_rel', 'win7_aura']) if all(re.search('(^|[/_])android[/_.]', f) for f in files): - return ['android_aosp', 'android_dbg', 'android_clang_dbg'] + return GetDefaultTryConfigs([ + 'android_aosp', + 'android_clang_dbg', + 'android_dbg', + ]) if all(re.search('^native_client_sdk', f) for f in files): - return ['linux_nacl_sdk', 'win_nacl_sdk', 'mac_nacl_sdk'] + return GetDefaultTryConfigs([ + 'linux_nacl_sdk', + 'mac_nacl_sdk', + 'win_nacl_sdk', + ]) if all(re.search('[/_]ios[/_.]', f) for f in files): - return ['ios_rel_device', 'ios_dbg_simulator'] + return GetDefaultTryConfigs(['ios_rel_device', 'ios_dbg_simulator']) - trybots = [ + trybots = GetDefaultTryConfigs([ 'android_clang_dbg', 'android_dbg', 'ios_dbg_simulator', 'ios_rel_device', - 'linux_asan', 'linux_aura', + 'linux_asan', 'linux_chromeos', - 'linux_clang:compile', + 'linux_clang', 'linux_rel', + 'mac', 'mac_rel', - 'mac:compile', + 'win', 'win_rel', - 'win:compile', - 'win_x64_rel:base_unittests', - ] + 'win_x64_rel', + ]) # Match things like path/aura/file.cc and path/file_aura.cc. # Same for chromeos. if any(re.search('[/_](aura|chromeos)', f) for f in files): - trybots += ['linux_chromeos_clang:compile', 'linux_chromeos_asan'] + trybots.extend(GetDefaultTryConfigs([ + 'linux_chromeos_asan', 'linux_chromeos_clang'])) # If there are gyp changes to base, build, or chromeos, run a full cros build # in addition to the shorter linux_chromeos build. Changes to high level gyp @@ -1276,13 +1447,13 @@ def GetPreferredTrySlaves(project, change): # differnt from the linux_chromeos build that most chrome developers test # with. if any(re.search('^(base|build|chromeos).*\.gypi?$', f) for f in files): - trybots += ['cros_x86'] + trybots.extend(GetDefaultTryConfigs(['cros_x86'])) # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it # unless they're .gyp(i) files as changes to those files can break the gyp # step on that bot. if (not all(re.search('^chrome', f) for f in files) or any(re.search('\.gypi?$', f) for f in files)): - trybots += ['android_aosp'] + trybots.extend(GetDefaultTryConfigs(['android_aosp'])) return trybots |