Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: commit-queue/pending_manager.py

Issue 41583004: CQ: assert instead of re-running verifiers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding=utf8 1 # coding=utf8
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Commit queue manager class. 5 """Commit queue manager class.
6 6
7 Security implications: 7 Security implications:
8 8
9 The following hypothesis are made: 9 The following hypothesis are made:
10 - Commit queue: 10 - Commit queue:
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 {'verification': 'why not', 350 {'verification': 'why not',
351 'payload': {'message': pending.why_not()}}) 351 'payload': {'message': pending.why_not()}})
352 352
353 @classmethod 353 @classmethod
354 def _pending_run_verifiers(cls, pending, verifiers): 354 def _pending_run_verifiers(cls, pending, verifiers):
355 """Runs verifiers on a pending change. 355 """Runs verifiers on a pending change.
356 356
357 Returns True if all Verifiers were run. 357 Returns True if all Verifiers were run.
358 """ 358 """
359 for verifier in verifiers: 359 for verifier in verifiers:
360 if verifier.name in pending.verifications: 360 assert verifier.name not in pending.verifications
361 logging.warning(
362 'Re-running verififer %s for issue %s' % (
Isaac (away) 2013/10/28 18:16:41 what happens when you restart CQ and add tests?
Paweł Hajdan Jr. 2013/10/28 22:57:11 Seems to work. Still, please note you're doing a _
363 verifier.name, pending.issue))
364 verifier.verify(pending) 361 verifier.verify(pending)
365 assert verifier.name in pending.verifications 362 assert verifier.name in pending.verifications
366 if pending.get_state() == base.IGNORED: 363 if pending.get_state() == base.IGNORED:
367 assert pending.verifications[verifier.name].get_state() == base.IGNORED 364 assert pending.verifications[verifier.name].get_state() == base.IGNORED
368 # Remove all the other verifiers since we need to keep it in the 365 # Remove all the other verifiers since we need to keep it in the
369 # 'datastore' to not retry this issue constantly. 366 # 'datastore' to not retry this issue constantly.
370 for key in pending.verifications.keys(): 367 for key in pending.verifications.keys():
371 if key != verifier.name: 368 if key != verifier.name:
372 del pending.verifications[key] 369 del pending.verifications[key]
373 return False 370 return False
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 """Loads the commit queue state from a JSON file.""" 548 """Loads the commit queue state from a JSON file."""
552 self.queue = model.load_from_json_file(filename) 549 self.queue = model.load_from_json_file(filename)
553 550
554 def save(self, filename): 551 def save(self, filename):
555 """Save the commit queue state in a simple JSON file.""" 552 """Save the commit queue state in a simple JSON file."""
556 model.save_to_json_file(filename, self.queue) 553 model.save_to_json_file(filename, self.queue)
557 554
558 def close(self): 555 def close(self):
559 """Close all the active pending manager items.""" 556 """Close all the active pending manager items."""
560 self.context.status.close() 557 self.context.status.close()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698