Skip to content

Commit

Permalink
fix some tests .. but not all
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin J. Mitchell committed Jan 22, 2010
1 parent a15e66d commit b7a16a2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 30 deletions.
11 changes: 0 additions & 11 deletions buildbot/test/runutils.py
Expand Up @@ -104,17 +104,6 @@ def connectSlave(self, builders=["dummy"], slavename="bot1",
self.connectOneSlave(slavename, opts)
return d

def connectSlaves(self, slavenames, builders):
dl = []
# initiate call for all of them, before waiting on result,
# otherwise we might miss some
for b in builders:
dl.append(self.master.botmaster.waitUntilBuilderAttached(b))
d = defer.DeferredList(dl)
for name in slavenames:
self.connectOneSlave(name)
return d

def connectSlave2(self):
# this takes over for bot1, so it has to share the slavename
port = self.master.slavePort._port.getHost().port
Expand Down
15 changes: 8 additions & 7 deletions buildbot/test/test_locks.py
Expand Up @@ -400,10 +400,10 @@ def setUp(self):
req1.events = req2.events = req3.events = self.events = []
d = self.master.loadConfig(config_1)
d.addCallback(lambda res: self.master.startService())
d.addCallback(lambda res: self.connectSlaves(["bot1", "bot2"],
["full1a", "full1b",
"full1c", "full1d",
"full2a", "full2b"]))
d.addCallback(lambda res: self.connectSlave(
["full1a", "full1b", "full1c", "full1d"],
"bot1"))
d.addCallback(lambda res: self.connectSlave(["full2a", "full2b"], "bot2"))
return d

def testLock1(self):
Expand Down Expand Up @@ -476,9 +476,10 @@ def setUp(self):
self.reqs[i].events = self.events
d = self.master.loadConfig(self.config)
d.addCallback(lambda res: self.master.startService())
d.addCallback(lambda res: self.connectSlaves(["bot1", "bot2"],
["excl_A", "excl_B",
"count_A", "count_B"]))
d.addCallback(lambda res: self.connectSlave(
["excl_A", "excl_B", "count_A", "count_B"], "bot1"))
d.addCallback(lambda res: self.connectSlave(
["excl_A", "excl_B", "count_A", "count_B"], "bot2"))
return d

def testOrder(self):
Expand Down
23 changes: 11 additions & 12 deletions buildbot/test/test_mergerequests.py
Expand Up @@ -53,15 +53,14 @@ def do_test(self, mergefun, results, reqs = None):
R("changes", S("branch1", None, None, [c4,c5,c6]), 'test_builder'),
)

m = self.master
m.loadConfig(master_cfg % mergefun)
m.readConfig = True
m.startService()
builder = self.control.getBuilder('dummy')
for req in reqs:
builder.requestBuild(req)

d = self.connectSlave()
d = self.master.loadConfig(master_cfg % mergefun)
d.addCallback(lambda res: self.master.startService())
def request_builds(_):
builder = self.control.getBuilder('dummy')
for req in reqs:
builder.requestBuild(req)
d.addCallback(request_builds)
d.addCallback(lambda res : self.connectSlave())
d.addCallback(self.waitForBuilds, results)

return d
Expand Down Expand Up @@ -179,17 +178,17 @@ def testProperties(self):
properties = p1),
R("why", S("branch1", None, None, None), 'test_builder',
properties = p1),
R("why", S("branch1", None, None, None), 'test_builder',
R("why", S("branch2", None, None, None), 'test_builder',
properties = p2),
R("why", S("branch1", None, None, None), 'test_builder',
R("why", S("branch2", None, None, None), 'test_builder',
properties = p2),
)
return self.do_test(mergefun,
({'reason': 'why',
'branch': 'branch1',
'changecount': 0},
{'reason': 'why',
'branch': 'branch1',
'branch': 'branch2',
'changecount': 0},
),
reqs=reqs)

0 comments on commit b7a16a2

Please sign in to comment.