[Buildbot-commits] buildbot/buildbot/test test_config.py,1.24,1.25

Brian Warner warner at users.sourceforge.net
Wed Jul 20 05:07:55 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21704/buildbot/test

Modified Files:
	test_config.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-258
Creator:  Brian Warner <warner at lothar.com>

oops, update sanity-checking to handle Dependent instances

	* buildbot/master.py (BuildMaster.loadConfig): oops, sanity-check
	c['schedulers'] in such a way that we can actually accept
	Dependent instances
	* buildbot/test/test_config.py: check it


Index: test_config.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- test_config.py	20 Jul 2005 04:21:57 -0000	1.24
+++ test_config.py	20 Jul 2005 05:07:48 -0000	1.25
@@ -505,7 +505,7 @@
 
         self.schedulersCfg = \
 """
-from buildbot.scheduler import Scheduler
+from buildbot.scheduler import Scheduler, Dependent
 from buildbot.process.factory import BasicBuildFactory
 c = {}
 c['bots'] = [('bot1', 'pw1')]
@@ -540,7 +540,7 @@
         d.addBoth(self._testSchedulers_2)
         return d
     def _testSchedulers_2(self, res):
-        self.shouldBeFailure(res, AssertionError, components.CannotAdapt)
+        self.shouldBeFailure(res, AssertionError)
         # c['schedulers'] must point at real builders
         badcfg = self.schedulersCfg + \
 """
@@ -563,6 +563,24 @@
         self.failUnlessEqual(s.treeStableTimer, 60)
         self.failUnlessEqual(s.builderNames, ['builder1'])
 
+        newcfg = self.schedulersCfg + \
+"""
+s1 = Scheduler('full', None, 60, ['builder1'])
+c['schedulers'] = [s1, Dependent('downstream', s1, ['builder1'])]
+"""
+        d = self.buildmaster.loadConfig(newcfg)
+        d.addCallback(self._testSchedulers_5)
+        return d
+    def _testSchedulers_5(self, res):
+        self.failUnlessEqual(len(self.buildmaster.schedulers), 2)
+        s = self.buildmaster.schedulers[0]
+        self.failUnless(isinstance(s, scheduler.Scheduler))
+        s = self.buildmaster.schedulers[1]
+        self.failUnless(isinstance(s, scheduler.Dependent))
+        self.failUnlessEqual(s.name, "downstream")
+        self.failUnlessEqual(s.builderNames, ['builder1'])
+
+
     def testBuilders(self):
         master = self.buildmaster
         master.loadConfig(emptyCfg)





More information about the Commits mailing list