summaryrefslogtreecommitdiff
path: root/tb3
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2013-07-23 19:19:51 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2013-07-23 19:19:51 +0200
commit7a63055c8f9882b80e4770d6a061c5b2208c3789 (patch)
tree499e8f6f2f694657729b6d3a21af1b84eefd91d2 /tb3
parent9d3441d50c1b9b10a2508c60ada127b6e53ea0cf (diff)
add platform and branch to each proposal in master
Diffstat (limited to 'tb3')
-rw-r--r--tb3/dist-packages/tb3/scheduler.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tb3/dist-packages/tb3/scheduler.py b/tb3/dist-packages/tb3/scheduler.py
index e3accab..c6847a8 100644
--- a/tb3/dist-packages/tb3/scheduler.py
+++ b/tb3/dist-packages/tb3/scheduler.py
@@ -14,10 +14,10 @@ import functools
import datetime
class Proposal:
- def __init__(self, score, commit, scheduler):
- (self.score, self.commit, self.scheduler) = (score, commit, scheduler)
+ def __init__(self, score, commit, scheduler, platform, branch):
+ (self.score, self.commit, self.scheduler, self.platform, self.branch) = (score, commit, scheduler, platform, branch)
def __repr__(self):
- return 'Proposal(%f, %s, %s)' % (self.score, self.commit, self.scheduler)
+ return 'Proposal(%f, %s, %s, %s, %s)' % (self.score, self.commit, self.scheduler, self.platform, self.branch)
def __cmp__(self, other):
return other.score - self.score
@@ -63,10 +63,10 @@ class HeadScheduler(Scheduler):
if not last_build is None:
commits = self.get_commits(last_build, head)
for commit in commits:
- proposals.append(Proposal(1-1/((len(commits)-float(commit[0]))**2+1), commit[1], self.__class__.__name__))
+ proposals.append(Proposal(1-1/((len(commits)-float(commit[0]))**2+1), commit[1], self.__class__.__name__, self.platform, self.branch))
self.dampen_running_commits(commits, proposals, time)
else:
- proposals.append(Proposal(float(1), head, self.__class__.__name__))
+ proposals.append(Proposal(float(1), head, self.__class__.__name__, self.platform, self.branch))
self.norm_results(proposals)
return proposals
@@ -81,7 +81,7 @@ class BisectScheduler(Scheduler):
commits = self.get_commits(last_good, '%s^' % first_bad)
proposals = []
for commit in commits:
- proposals.append(Proposal(1.0, commit[1], self.__class__.__name__))
+ proposals.append(Proposal(1.0, commit[1], self.__class__.__name__, self.platform, self.branch))
for idx in range(len(proposals)):
proposals[idx].score *= (1-1/(float(idx)**2+1)) * (1-1/((float(idx-len(proposals)))**2+1))
self.dampen_running_commits(commits, proposals, time)