diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 23:35:57 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 23:35:57 +0000 |
commit | 7468ac52e787ad758f84f95427876351cd1cbebb (patch) | |
tree | c79bc351d659cb281458aecf3ec6ecee64708635 | |
parent | 7e4836ddd688846e881daad989a507da6ad9e0d9 (diff) | |
download | chromium_src-7468ac52e787ad758f84f95427876351cd1cbebb.zip chromium_src-7468ac52e787ad758f84f95427876351cd1cbebb.tar.gz chromium_src-7468ac52e787ad758f84f95427876351cd1cbebb.tar.bz2 |
Change top-level PRESUBMIT to support split tryserver
This also fixes problems with generic trybots not being triggered
when other presubmit files which already support multiple masters
get in scope.
BUG=334892
R=maruel@chromium.org
Review URL: https://codereview.chromium.org/197963003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256698 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | PRESUBMIT.py | 31 | ||||
-rwxr-xr-x | PRESUBMIT_test.py | 4 |
2 files changed, 22 insertions, 13 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index c7b9fde..b5a873e 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -1370,9 +1370,16 @@ def GetDefaultTryConfigs(bots=None): for x in builders_and_tests[bot]] if bots: - return [(bot, set(builders_and_tests[bot])) for bot in bots] + return { + 'tryserver.chromium': dict((bot, set(builders_and_tests[bot])) + for bot in bots) + } else: - return [(bot, set(tests)) for bot, tests in builders_and_tests.iteritems()] + return { + 'tryserver.chromium': dict( + (bot, set(tests)) + for bot, tests in builders_and_tests.iteritems()) + } def CheckChangeOnCommit(input_api, output_api): @@ -1395,11 +1402,11 @@ def CheckChangeOnCommit(input_api, output_api): return results -def GetPreferredTrySlaves(project, change): +def GetPreferredTryMasters(project, change): files = change.LocalPaths() if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files): - return [] + return {} if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files): return GetDefaultTryConfigs([ @@ -1418,7 +1425,7 @@ def GetPreferredTrySlaves(project, change): if all(re.search('[/_]ios[/_.]', f) for f in files): return GetDefaultTryConfigs(['ios_rel_device', 'ios_dbg_simulator']) - trybots = GetDefaultTryConfigs([ + builders = [ 'android_clang_dbg', 'android_dbg', 'ios_dbg_simulator', @@ -1438,13 +1445,15 @@ def GetPreferredTrySlaves(project, change): 'win_nacl_sdk_build', 'win_rel', '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.extend(GetDefaultTryConfigs([ - 'linux_chromeos_asan', 'linux_chromium_chromeos_clang_dbg'])) + builders.extend([ + 'linux_chromeos_asan', + 'linux_chromium_chromeos_clang_dbg' + ]) # 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 @@ -1452,13 +1461,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.extend(GetDefaultTryConfigs(['cros_x86'])) + builders.extend(['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.extend(GetDefaultTryConfigs(['android_aosp'])) + builders.extend(['android_aosp']) - return trybots + return GetDefaultTryConfigs(builders) diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index 2d6e066..3bebc67 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py @@ -369,8 +369,8 @@ class BadExtensionsTest(unittest.TestCase): 'some/path/OWNERS', 'A\Windows\Path\OWNERS', ]) - results = PRESUBMIT.GetPreferredTrySlaves(None, mock_change) - self.assertEqual(0, len(results)) + results = PRESUBMIT.GetPreferredTryMasters(None, mock_change) + self.assertEqual({}, results) class InvalidOSMacroNamesTest(unittest.TestCase): |