[Buildbot-commits] buildbot/buildbot/test test_config.py, 1.34, 1.35
Brian Warner
warner at users.sourceforge.net
Wed Jun 7 16:53:21 UTC 2006
Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17114/buildbot/test
Modified Files:
test_config.py
Log Message:
[project @ add a test for the WithProperties/ComparableMixin fix]
Original author: warner at lothar.com
Date: 2006-06-07 16:50:17
Index: test_config.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- test_config.py 13 Jan 2006 08:34:29 -0000 1.34
+++ test_config.py 7 Jun 2006 16:53:19 -0000 1.35
@@ -81,6 +81,27 @@
'builddir': 'workdir2', 'factory': f1 }]
"""
+wpCfg1 = buildersCfg + \
+"""
+from buildbot.process import step
+f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
+f1.addStep(step.ShellCommand, command=[step.WithProperties('echo')])
+c['builders'] = [{'name':'builder1', 'slavename':'bot1',
+ 'builddir':'workdir1', 'factory': f1}]
+"""
+
+wpCfg2 = buildersCfg + \
+"""
+from buildbot.process import step
+f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
+f1.addStep(step.ShellCommand,
+ command=[step.WithProperties('echo %s', 'revision')])
+c['builders'] = [{'name':'builder1', 'slavename':'bot1',
+ 'builddir':'workdir1', 'factory': f1}]
+"""
+
+
+
ircCfg1 = emptyCfg + \
"""
from buildbot.status import words
@@ -686,6 +707,28 @@
self.failUnlessEqual(master.botmaster.builders, {})
#self.failUnlessEqual(master.client_svc.statusbags, {}) # TODO
+ def testWithProperties(self):
+ master = self.buildmaster
+ master.loadConfig(wpCfg1)
+ self.failUnlessEqual(master.botmaster.builderNames, ["builder1"])
+ self.failUnlessEqual(master.botmaster.builders.keys(), ["builder1"])
+ b1 = master.botmaster.builders["builder1"]
+
+ # reloading the same config should leave the builder unchanged
+ master.loadConfig(wpCfg1)
+ b2 = master.botmaster.builders["builder1"]
+ self.failUnlessIdentical(b1, b2)
+
+ # but changing the parameters of the WithProperties should change it
+ master.loadConfig(wpCfg2)
+ b3 = master.botmaster.builders["builder1"]
+ self.failIf(b1 is b3)
+
+ # again, reloading same config should leave the builder unchanged
+ master.loadConfig(wpCfg2)
+ b4 = master.botmaster.builders["builder1"]
+ self.failUnlessIdentical(b3, b4)
+
def checkIRC(self, m, expected):
ircs = {}
for irc in self.servers(m, words.IRC):
More information about the Commits
mailing list