def testExpectedDepsIsNotReportedMissing(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 testFindRemovedDeps(self): webrtc_deps = ParseLocalDepsFile(self._webrtc_depsfile_android) new_cr_deps = ParseLocalDepsFile(self._new_cr_depsfile_android) removed_android_paths, other_paths = FindRemovedDeps( webrtc_deps, new_cr_deps) self.assertEquals(removed_android_paths, [ 'src/third_party/android_deps/libs/android_arch_lifecycle_runtime' ]) self.assertEquals(other_paths, [])
def testMissingDepsIsDetected(self): """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/third_party/xstream', 'src/buildtools'])
def _CommitMessageSetup(self): webrtc_deps = ParseLocalDepsFile(self._webrtc_depsfile_android) new_cr_deps = ParseLocalDepsFile(self._new_cr_depsfile_android) changed_deps = CalculateChangedDeps(webrtc_deps, new_cr_deps) added_paths, _ = FindAddedDeps(webrtc_deps, new_cr_deps) removed_paths, _ = FindRemovedDeps(webrtc_deps, new_cr_deps) current_commit_pos = 'cafe' new_commit_pos = 'f00d' commit_msg = GenerateCommitMessage(NO_CHROMIUM_REVISION_UPDATE, current_commit_pos, new_commit_pos, changed_deps, added_paths, removed_paths) return [l.strip() for l in commit_msg.split('\n')]
def _CommitMessageSetup(self): webrtc_deps = ParseLocalDepsFile(self._webrtc_depsfile_android) new_cr_deps = ParseLocalDepsFile(self._new_cr_depsfile_android) changed_deps = CalculateChangedDeps(webrtc_deps, new_cr_deps) added_paths, _ = FindAddedDeps(webrtc_deps, new_cr_deps) removed_paths, _ = FindRemovedDeps(webrtc_deps, new_cr_deps) current_commit_pos = 'cafe' new_commit_pos = 'f00d' with mock.patch('roll_deps._RunCommand', self.fake): # We don't really care, but it's needed to construct the message. self.fake.AddExpectation(['git', 'config', 'user.email'], _returns=('*****@*****.**', None), _ignores=['working_dir']) commit_msg = GenerateCommitMessage(NO_CHROMIUM_REVISION_UPDATE, current_commit_pos, new_commit_pos, changed_deps, added_paths, removed_paths) return [l.strip() for l in commit_msg.split('\n')]