def testQueryMultipleCurrentPatchset(self): """Test ordering of results in QueryMultipleCurrentPatchset""" changes = [x for x in self.CHANGES if not x.startswith('*')] helper = gerrit.GetCrosExternal() results = list(helper.QueryMultipleCurrentPatchset(changes)) self.assertEqual(changes, [x.gerrit_number for _, x in results]) self.assertEqual(changes, [x for x, _ in results])
def testMultipleChangeDetail(self): """Test ordering of results in GetMultipleChangeDetail""" changes = [x for x in self.CHANGES if not x.startswith('*')] helper = gerrit.GetCrosExternal() results = list( helper.GetMultipleChangeDetail([str(x) for x in changes])) gerrit_numbers = [str(x['_number']) for x in results] self.assertEqual(changes, gerrit_numbers)
def CloseOldLKGMRolls(self): """Closes all open LKGM roll CLs that were last modified >24 hours ago. Any roll that hasn't passed the CQ in 24 hours is likely broken and can be discarded. """ query_params = { 'project': constants.CHROMIUM_SRC_PROJECT, 'branch': 'master', 'author': self._committer.author, 'file': constants.PATH_TO_CHROME_LKGM, 'age': '1d', 'status': 'open', } gerrit_helper = gerrit.GetCrosExternal() for open_issue in gerrit_helper.Query(**query_params): logging.info( 'Closing old LKGM roll crrev.com/c/%s', open_issue.gerrit_number) gerrit_helper.AbandonChange(open_issue)