Skip to content

Commit

Permalink
addBuildset takes a scheduler *name*, not object
Browse files Browse the repository at this point in the history
The wrong behavior was being enforced by the tests!
  • Loading branch information
djmitche committed Oct 14, 2012
1 parent fdad1fd commit d56aa3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions master/buildbot/schedulers/base.py
Expand Up @@ -21,7 +21,7 @@
from buildbot.process.properties import Properties
from buildbot.util import ComparableMixin
from buildbot.changes import changes
from buildbot import config, interfaces
from buildbot import config, interfaces, util
from buildbot.util.state import StateMixin

class BaseScheduler(service.MultiService, ComparableMixin, StateMixin):
Expand Down Expand Up @@ -61,7 +61,7 @@ def __init__(self, name, builderNames, properties,
value: {'repository':'<repo>', 'branch':'<br>', 'revision:'<rev>'}
"""
service.MultiService.__init__(self)
self.name = name
self.name = util.ascii2unicode(name)
"name of this scheduler; used to identify replacements on reconfig"

ok = True
Expand Down Expand Up @@ -470,7 +470,7 @@ def addBuildsetForSourceStamp(self, ssid=None, setid=None, reason='', external_i
yield None

rv = yield self.master.data.updates.addBuildset(
scheduler=self, sourcestampsetid=setid, reason=reason,
scheduler=self.name, sourcestampsetid=setid, reason=reason,
properties=properties_dict, builderNames=builderNames,
external_idstring=external_idstring)
defer.returnValue(rv)
4 changes: 1 addition & 3 deletions master/buildbot/test/fake/fakedata.py
Expand Up @@ -13,7 +13,6 @@
#
# Copyright Buildbot Team Members

from buildbot import interfaces
from buildbot.util import json
import types
from twisted.internet import defer
Expand Down Expand Up @@ -100,8 +99,7 @@ def masterStopped(self, name, masterid):
def addBuildset(self, scheduler=None, sourcestampsetid=None, reason='',
properties={}, builderNames=[], external_idstring=None):
# assert types
self.testcase.failUnless(interfaces.IScheduler.providedBy(scheduler))
scheduler = scheduler.name
self.testcase.assertIsInstance(scheduler, unicode)
self.testcase.assertIsInstance(sourcestampsetid, int)
self.testcase.assertIsInstance(reason, unicode)
self.assertProperties(sourced=True, properties=properties)
Expand Down

0 comments on commit d56aa3c

Please sign in to comment.