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

Side by Side Diff: commit-queue/verification/trigger_experimental_try_job.py

Issue 141233003: CQ: do not force HEAD revision for chromium_trybot builders (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 6 years, 11 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 | « commit-queue/projects.py ('k') | 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 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 """Triggers experimental try jobs on Rietveld without monitoring the results.""" 5 """Triggers experimental try jobs on Rietveld without monitoring the results."""
6 6
7 import random 7 import random
8 import urllib2 8 import urllib2
9 9
10 from verification import base 10 from verification import base
11 11
12 12
13 class TriggerExperimentalTryJobVerifier(base.Verifier): 13 class TriggerExperimentalTryJobVerifier(base.Verifier):
14 name = 'trigger experimental try job' 14 name = 'trigger experimental try job'
15 15
16 def __init__(self, context, percentage, try_job_description): 16 def __init__(self, context, percentage, revision, try_job_description):
17 super(TriggerExperimentalTryJobVerifier, self).__init__() 17 super(TriggerExperimentalTryJobVerifier, self).__init__()
18 self.context = context 18 self.context = context
19 self.percentage = percentage 19 self.percentage = percentage
20 self.revision = revision
20 self.try_job_description = try_job_description 21 self.try_job_description = try_job_description
21 22
22 def verify(self, pending): 23 def verify(self, pending):
23 if random.random() < self.percentage: 24 if random.random() < self.percentage:
24 try: 25 try:
25 self.context.rietveld.trigger_try_jobs( 26 self.context.rietveld.trigger_try_jobs(
26 pending.issue, pending.patchset, 'CQ', False, 'HEAD', 27 pending.issue, pending.patchset, 'CQ', False, self.revision,
27 self.try_job_description) 28 self.try_job_description)
28 except urllib2.HTTPError as e: 29 except urllib2.HTTPError as e:
29 if e.code not in (400, 500, 503): 30 if e.code not in (400, 500, 503):
30 raise 31 raise
31 32
32 # Always succeed - experimental try jobs are not stable enough 33 # Always succeed - experimental try jobs are not stable enough
33 # to block CQ on them, but triggering builds allows developers 34 # to block CQ on them, but triggering builds allows developers
34 # to get enough real-world traffic to get them to stable state. 35 # to get enough real-world traffic to get them to stable state.
35 pending.verifications[self.name] = base.SimpleStatus(base.SUCCEEDED) 36 pending.verifications[self.name] = base.SimpleStatus(base.SUCCEEDED)
36 37
37 def update_status(self, queue): 38 def update_status(self, queue):
38 pass 39 pass
OLDNEW
« no previous file with comments | « commit-queue/projects.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698