diff --git a/tools_webrtc/autoroller/roll_deps.py b/tools_webrtc/autoroller/roll_deps.py index 28db376382..e1e4a36124 100755 --- a/tools_webrtc/autoroller/roll_deps.py +++ b/tools_webrtc/autoroller/roll_deps.py @@ -32,6 +32,24 @@ DONT_AUTOROLL_THESE = [ 'src/third_party/ffmpeg', ] +# These dependencies are missing in chromium/src/DEPS, either unused or already +# in-tree. For instance, src/base is a part of the Chromium source git repo, +# but we pull it through a subtree mirror, so therefore it isn't listed in +# Chromium's deps but it is in ours. +WEBRTC_ONLY_DEPS = [ + 'src/base', + 'src/build', + 'src/ios' + 'src/testing', + 'src/third_party', + 'src/third_party/findbugs', + 'src/third_party/gtest-parallel', + 'src/third_party/winsdk_samples', + 'src/third_party/yasm/binaries', + 'src/tools', +] + + # Run these CQ trybots in addition to the default ones in infra/config/cq.cfg. EXTRA_TRYBOTS = ( 'master.internal.tryserver.corp.webrtc:linux_internal' @@ -321,11 +339,10 @@ def FindRemovedDeps(webrtc_deps, new_cr_deps): all_removed_deps = _FindNewDeps(new_cr_deps, webrtc_deps) generated_android_deps = [path for path in all_removed_deps if path.startswith(ANDROID_DEPS_PATH)] - # DepsEntry are assumed to be webrtc-only dependencies, - # and are handled in CalculatedChangedDeds. + # Webrtc-only dependencies are handled in CalculateChangedDeps. other_deps = [path for path in all_removed_deps if path not in generated_android_deps and - not isinstance(webrtc_deps['deps'][path], DepsEntry)] + path not in WEBRTC_ONLY_DEPS] return generated_android_deps, other_deps @@ -365,7 +382,7 @@ def CalculateChangedDeps(webrtc_deps, new_cr_deps): 'WebRTC DEPS entry %s has a different URL (%s) than Chromium (%s).' % (path, webrtc_deps_entry.url, cr_deps_entry.url)) else: - if isinstance(webrtc_deps_entry, DepsEntry): + if path in WEBRTC_ONLY_DEPS: # Use the HEAD of the deps repo. stdout, _ = _RunCommand(['git', 'ls-remote', webrtc_deps_entry.url, 'HEAD']) diff --git a/tools_webrtc/autoroller/unittests/roll_deps_test.py b/tools_webrtc/autoroller/unittests/roll_deps_test.py index 200c9540fb..e9912f91ce 100755 --- a/tools_webrtc/autoroller/unittests/roll_deps_test.py +++ b/tools_webrtc/autoroller/unittests/roll_deps_test.py @@ -72,7 +72,7 @@ class FakeCmd(object): class NullCmd(object): - """ No-op mock when calls mustn't be checked. """ + """No-op mock when calls mustn't be checked. """ def __call__(self, *args, **kwargs): # Empty stdout and stderr. @@ -218,7 +218,7 @@ class TestRollChromiumRevision(unittest.TestCase): self.assertEquals(changed_deps[2].new_version, 'version:1.10.0-cr0') def testWithDistinctDeps(self): - """ Check CalculateChangedDeps still works when deps are added/removed. """ + """Check CalculateChangedDeps still works when deps are added/removed. """ webrtc_deps = ParseLocalDepsFile(self._webrtc_depsfile_android) new_cr_deps = ParseLocalDepsFile(self._new_cr_depsfile_android) changed_deps = CalculateChangedDeps(webrtc_deps, new_cr_deps) @@ -251,17 +251,25 @@ class TestRollChromiumRevision(unittest.TestCase): self.assertEquals(other_paths, []) def testMissingDepsIsDetected(self): - """ Check an error is reported when deps cannot be automatically removed.""" + """Check an error is reported when deps cannot be automatically removed.""" # The situation at test is the following: # * A WebRTC DEPS entry is missing from Chromium. # * The dependency isn't an android_deps (those are supported). webrtc_deps = ParseLocalDepsFile(self._webrtc_depsfile) new_cr_deps = ParseLocalDepsFile(self._new_cr_depsfile_android) _, other_paths = FindRemovedDeps(webrtc_deps, new_cr_deps) - self.assertEquals(other_paths, ['src/build', - 'src/third_party/xstream', + self.assertEquals(other_paths, ['src/third_party/xstream', 'src/buildtools']) + def testExpectedDepsIsNot(self): + """Some deps musn't be seen as missing, even if absent from Chromium.""" + webrtc_deps = ParseLocalDepsFile(self._webrtc_depsfile) + new_cr_deps = ParseLocalDepsFile(self._new_cr_depsfile_android) + removed_android_paths, other_paths = FindRemovedDeps(webrtc_deps, + new_cr_deps) + self.assertTrue('src/build' not in removed_android_paths) + self.assertTrue('src/build' not in other_paths) + def _CommitMessageSetup(self): webrtc_deps = ParseLocalDepsFile(self._webrtc_depsfile_android) new_cr_deps = ParseLocalDepsFile(self._new_cr_depsfile_android)