[Buildbot-commits] buildbot/buildbot/test test_config.py,1.17,1.18 test_run.py,1.29,1.30

Brian Warner warner at users.sourceforge.net
Wed May 4 06:44:33 UTC 2005


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

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

remove deprecated config keys

	* buildbot/master.py (BuildMaster.loadConfig): finally remove
	deprecated config keys: webPortnum, webPathname, irc, manholePort,
	and configuring builders with tuples.
	* buildbot/test/test_config.py: stop testing compatibility with
	deprecated config keys
	* buildbot/test/test_run.py: same


Index: test_config.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- test_config.py	27 Apr 2005 23:24:04 -0000	1.17
+++ test_config.py	4 May 2005 06:44:31 -0000	1.18
@@ -82,7 +82,8 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1)]
+c['builders'] = [{'name':'builder1', 'slavename':'bot1',
+                  'builddir':'workdir', 'factory':f1}]
 c['slavePortnum'] = 9999
 BuildmasterConfig = c
 """
@@ -94,7 +95,8 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule2')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1)]
+c['builders'] = [{'name':'builder1', 'slavename':'bot1',
+                  'builddir':'workdir', 'factory':f1}]
 c['slavePortnum'] = 9999
 BuildmasterConfig = c
 """
@@ -157,17 +159,6 @@
 
 ircCfg1 = \
 """
-c = {}
-c['bots'] = []
-c['sources'] = []
-c['builders'] = []
-c['slavePortnum'] = 9999
-c['irc'] = {('irc.us.freenode.net', 6667): ('buildbot', ['twisted'])}
-BuildmasterConfig = c
-"""
-
-ircCfg2 = \
-"""
 from buildbot.status import words
 c = {}
 c['bots'] = []
@@ -178,7 +169,7 @@
 BuildmasterConfig = c
 """
 
-ircCfg3 = \
+ircCfg2 = \
 """
 from buildbot.status import words
 c = {}
@@ -191,7 +182,7 @@
 BuildmasterConfig = c
 """
 
-ircCfg4 = \
+ircCfg3 = \
 """
 from buildbot.status import words
 c = {}
@@ -205,17 +196,6 @@
 
 webCfg1 = \
 """
-c = {}
-c['bots'] = []
-c['sources'] = []
-c['builders'] = []
-c['slavePortnum'] = 9999
-c['webPortnum'] = 9980  # backwards compatibility
-BuildmasterConfig = c
-"""
-
-webCfg2 = \
-"""
 from buildbot.status import html
 c = {}
 c['bots'] = []
@@ -226,7 +206,7 @@
 BuildmasterConfig = c
 """
 
-webCfg3 = \
+webCfg2 = \
 """
 from buildbot.status import html
 c = {}
@@ -240,17 +220,6 @@
 
 webNameCfg1 = \
 """
-c = {}
-c['bots'] = []
-c['sources'] = []
-c['builders'] = []
-c['slavePortnum'] = 9999
-c['webPathname'] = '~/.twistd-web-pb' # backwards compatibility
-BuildmasterConfig = c
-"""
-
-webNameCfg2 = \
-"""
 from buildbot.status import html
 c = {}
 c['bots'] = []
@@ -261,7 +230,7 @@
 BuildmasterConfig = c
 """
 
-webNameCfg3 = \
+webNameCfg2 = \
 """
 from buildbot.status import html
 c = {}
@@ -293,11 +262,16 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1),
-                 ('builder2', 'bot1', 'workdir2', f1),
-                 ('builder4', 'bot1', 'workdir4', f1),
-                 ('builder5', 'bot1', 'workdir5', f1),
-                 ]
+c['builders'] = [
+                 { 'name': 'builder1', 'slavename': 'bot1',
+                 'builddir': 'workdir', 'factory': f1 },
+                 { 'name': 'builder2', 'slavename': 'bot1',
+                 'builddir': 'workdir2', 'factory': f1 },
+                 { 'name': 'builder4', 'slavename': 'bot1',
+                 'builddir': 'workdir4', 'factory': f1 },
+                 { 'name': 'builder5', 'slavename': 'bot1',
+                 'builddir': 'workdir5', 'factory': f1 },
+                   ]
 c['interlocks'] = [('lock1', ['builder1'], ['builder2', 'builder3']),
                    ]
 c['slavePortnum'] = 9999
@@ -312,12 +286,18 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1),
-                 ('builder2', 'bot1', 'workdir2', f1),
-                 ('builder3', 'bot1', 'workdir3', f1),
-                 ('builder4', 'bot1', 'workdir4', f1),
-                 ('builder5', 'bot1', 'workdir5', f1),
-                 ]
+c['builders'] = [
+                 { 'name': 'builder1', 'slavename': 'bot1',
+                 'builddir': 'workdir', 'factory': f1 },
+                 { 'name': 'builder2', 'slavename': 'bot1',
+                 'builddir': 'workdir2', 'factory': f1 },
+                 { 'name': 'builder3', 'slavename': 'bot1',
+                 'builddir': 'workdir3', 'factory': f1 },
+                 { 'name': 'builder4', 'slavename': 'bot1',
+                 'builddir': 'workdir4', 'factory': f1 },
+                 { 'name': 'builder5', 'slavename': 'bot1',
+                 'builddir': 'workdir5', 'factory': f1 },
+                   ]
 c['interlocks'] = [('lock1', ['builder1'], ['builder2', 'builder3']),
                    ]
 c['slavePortnum'] = 9999
@@ -332,12 +312,18 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1),
-                 ('builder2', 'bot1', 'workdir2', f1),
-                 ('builder3', 'bot1', 'workdir3', f1),
-                 ('builder4', 'bot1', 'workdir4', f1),
-                 ('builder5', 'bot1', 'workdir5', f1),
-                 ]
+c['builders'] = [
+                 { 'name': 'builder1', 'slavename': 'bot1',
+                 'builddir': 'workdir', 'factory': f1 },
+                 { 'name': 'builder2', 'slavename': 'bot1',
+                 'builddir': 'workdir2', 'factory': f1 },
+                 { 'name': 'builder3', 'slavename': 'bot1',
+                 'builddir': 'workdir3', 'factory': f1 },
+                 { 'name': 'builder4', 'slavename': 'bot1',
+                 'builddir': 'workdir4', 'factory': f1 },
+                 { 'name': 'builder5', 'slavename': 'bot1',
+                 'builddir': 'workdir5', 'factory': f1 },
+                   ]
 c['interlocks'] = [('lock1', ['builder1'], ['builder2', 'builder3']),
                    ('lock2', ['builder3', 'builder4'], ['builder5']),
                    ]
@@ -353,12 +339,18 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1),
-                 ('builder2', 'bot1', 'workdir2', f1),
-                 ('builder3', 'bot1', 'workdir3', f1),
-                 ('builder4', 'bot1', 'workdir4', f1),
-                 ('builder5', 'bot1', 'workdir5', f1),
-                 ]
+c['builders'] = [
+                 { 'name': 'builder1', 'slavename': 'bot1',
+                 'builddir': 'workdir', 'factory': f1 },
+                 { 'name': 'builder2', 'slavename': 'bot1',
+                 'builddir': 'workdir2', 'factory': f1 },
+                 { 'name': 'builder3', 'slavename': 'bot1',
+                 'builddir': 'workdir3', 'factory': f1 },
+                 { 'name': 'builder4', 'slavename': 'bot1',
+                 'builddir': 'workdir4', 'factory': f1 },
+                 { 'name': 'builder5', 'slavename': 'bot1',
+                 'builddir': 'workdir5', 'factory': f1 },
+                   ]
 c['interlocks'] = [('lock1', ['builder1'], ['builder2', 'builder3']),
                    ('lock2', ['builder1', 'builder4'], ['builder5']),
                    ]
@@ -374,12 +366,18 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1),
-                 ('builder2', 'bot1', 'workdir2', f1),
-                 ('builder3', 'bot1', 'workdir3', f1),
-                 ('builder4', 'bot1', 'workdir4', f1),
-                 ('builder5', 'bot1', 'workdir5', f1),
-                 ]
+c['builders'] = [
+                 { 'name': 'builder1', 'slavename': 'bot1',
+                 'builddir': 'workdir', 'factory': f1 },
+                 { 'name': 'builder2', 'slavename': 'bot1',
+                 'builddir': 'workdir2', 'factory': f1 },
+                 { 'name': 'builder3', 'slavename': 'bot1',
+                 'builddir': 'workdir3', 'factory': f1 },
+                 { 'name': 'builder4', 'slavename': 'bot1',
+                 'builddir': 'workdir4', 'factory': f1 },
+                 { 'name': 'builder5', 'slavename': 'bot1',
+                 'builddir': 'workdir5', 'factory': f1 },
+                   ]
 c['interlocks'] = [('lock2', ['builder1', 'builder4'], ['builder5']),
                    ]
 c['slavePortnum'] = 9999
@@ -394,11 +392,16 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1),
-                 ('builder2', 'bot1', 'workdir2', f1),
-                 ('builder3', 'bot1', 'workdir3', f1),
-                 ('builder4', 'bot1', 'workdir4', f1),
-                 ]
+c['builders'] = [
+                 { 'name': 'builder1', 'slavename': 'bot1',
+                 'builddir': 'workdir', 'factory': f1 },
+                 { 'name': 'builder2', 'slavename': 'bot1',
+                 'builddir': 'workdir2', 'factory': f1 },
+                 { 'name': 'builder3', 'slavename': 'bot1',
+                 'builddir': 'workdir3', 'factory': f1 },
+                 { 'name': 'builder4', 'slavename': 'bot1',
+                 'builddir': 'workdir4', 'factory': f1 },
+                   ]
 c['interlocks'] = [('lock2', ['builder1', 'builder4'], ['builder5']),
                    ]
 c['slavePortnum'] = 9999
@@ -413,11 +416,16 @@
 c['bots'] = [('bot1', 'pw1')]
 c['sources'] = []
 f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
-c['builders'] = [('builder1', 'bot1', 'workdir', f1),
-                 ('builder2', 'bot1', 'workdir2', f1),
-                 ('builder3', 'bot1', 'workdir3', f1),
-                 ('builder4', 'bot1', 'workdir4', f1),
-                 ]
+c['builders'] = [
+                 { 'name': 'builder1', 'slavename': 'bot1',
+                 'builddir': 'workdir', 'factory': f1 },
+                 { 'name': 'builder2', 'slavename': 'bot1',
+                 'builddir': 'workdir2', 'factory': f1 },
+                 { 'name': 'builder3', 'slavename': 'bot1',
+                 'builddir': 'workdir3', 'factory': f1 },
+                 { 'name': 'builder4', 'slavename': 'bot1',
+                 'builddir': 'workdir4', 'factory': f1 },
+                   ]
 c['interlocks'] = []
 c['slavePortnum'] = 9999
 BuildmasterConfig = c
@@ -670,27 +678,28 @@
     def testIRC(self):
         master = self.buildmaster
         master.loadChanges()
-        master.loadConfig(emptyCfg)
+        d = master.loadConfig(emptyCfg)
+        dr(d)
         self.checkIRC(master, {})
 
-        master.loadConfig(ircCfg1)
-        expected = {'irc.us.freenode.net': ('buildbot', ['twisted'])}
-        self.checkIRC(master, expected)
-
-        master.loadConfig(ircCfg2)
+        d = master.loadConfig(ircCfg1)
+        dr(d)
         expected = {'irc.us.freenode.net': ('buildbot', ['twisted'])}
         self.checkIRC(master, expected)
 
-        master.loadConfig(ircCfg3)
+        d = master.loadConfig(ircCfg2)
+        dr(d)
         expected = {'irc.us.freenode.net': ('buildbot', ['twisted']),
                     'irc.example.com': ('otherbot', ['chan1', 'chan2'])}
         self.checkIRC(master, expected)
 
-        master.loadConfig(ircCfg4)
+        d = master.loadConfig(ircCfg3)
+        dr(d)
         expected = {'irc.us.freenode.net': ('buildbot', ['knotted'])}
         self.checkIRC(master, expected)
 
-        master.loadConfig(ircCfg1)
+        d = master.loadConfig(ircCfg1)
+        dr(d)
         expected = {'irc.us.freenode.net': ('buildbot', ['twisted'])}
         self.checkIRC(master, expected)
 
@@ -698,66 +707,60 @@
         master = self.buildmaster
         master.loadChanges()
 
-        master.loadConfig(webCfg1)
+        d = master.loadConfig(webCfg1)
+        dr(d)
         ports = self.checkPorts(master, [(9999, pb.PBServerFactory),
                                          (9980, Site)])
         p = ports[1]
 
-        master.loadConfig(webCfg1) # nothing should be changed
-        ports = self.checkPorts(master, [(9999, pb.PBServerFactory),
-                                         (9980, Site)])
-        self.failUnlessIdentical(p, ports[1],
-                                 "web port was changed even though " + \
-                                 "configuration was not")
-
-        master.loadConfig(webCfg2) # still nothing changes
+        d = master.loadConfig(webCfg1) # nothing should be changed
+        dr(d)
         ports = self.checkPorts(master, [(9999, pb.PBServerFactory),
                                          (9980, Site)])
         self.failUnlessIdentical(p, ports[1],
                                  "web port was changed even though " + \
                                  "configuration was not")
 
-        master.loadConfig(webCfg3) # changes to 9981
+        d = master.loadConfig(webCfg2) # changes to 9981
+        dr(d)
         ports = self.checkPorts(master, [(9999, pb.PBServerFactory),
                                          (9981, Site)])
         self.failIf(p is ports[1],
                     "web port was unchanged but configuration was changed")
 
-        master.loadConfig(emptyCfg)
+        d = master.loadConfig(emptyCfg)
+        dr(d)
         self.checkPorts(master, [(9999, pb.PBServerFactory)])
 
     def testWebPathname(self):
         master = self.buildmaster
         master.loadChanges()
 
-        master.loadConfig(webNameCfg1)
+        d = master.loadConfig(webNameCfg1)
+        dr(d)
         self.checkPorts(master, [(9999, pb.PBServerFactory),
                                  ('~/.twistd-web-pb', pb.PBServerFactory)])
         unixports = self.UNIXports(master)
         f = unixports[0].args[1]
         self.failUnless(isinstance(f.root, ResourcePublisher))
 
-        master.loadConfig(webNameCfg1) # nothing should be changed
-        self.checkPorts(master, [(9999, pb.PBServerFactory),
-                                 ('~/.twistd-web-pb', pb.PBServerFactory)])
-        self.failUnlessIdentical(f, self.UNIXports(master)[0].args[1],
-                                 "web factory was changed even though " + \
-                                 "configuration was not")
-
-        master.loadConfig(webNameCfg2) # still nothing changes
+        d = master.loadConfig(webNameCfg1) # nothing should be changed
+        dr(d)
         self.checkPorts(master, [(9999, pb.PBServerFactory),
                                  ('~/.twistd-web-pb', pb.PBServerFactory)])
         self.failUnlessIdentical(f, self.UNIXports(master)[0].args[1],
                                  "web factory was changed even though " + \
                                  "configuration was not")
 
-        master.loadConfig(webNameCfg3)
+        d = master.loadConfig(webNameCfg2)
+        dr(d)
         self.checkPorts(master, [(9999, pb.PBServerFactory),
                                  ('bar.socket', pb.PBServerFactory)])
         self.failIf(f is self.UNIXports(master)[0].args[1],
                     "web factory was unchanged but configuration was changed")
 
-        master.loadConfig(emptyCfg)
+        d = master.loadConfig(emptyCfg)
+        dr(d)
         self.checkPorts(master, [(9999, pb.PBServerFactory)])
 
     def testDebugPassword(self):

Index: test_run.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- test_run.py	27 Apr 2005 12:10:15 -0000	1.29
+++ test_run.py	4 May 2005 06:44:31 -0000	1.30
@@ -31,7 +31,8 @@
 c['sources'] = []
 c['builders'] = []
 f1 = factory.QuickBuildFactory('fakerep', 'cvsmodule', configure=None)
-c['builders'].append(('quick', 'bot1', 'quickdir', f1))
+c['builders'].append({'name':'quick', 'slavename':'bot1',
+                      'builddir': 'quickdir', 'factory': f1})
 c['slavePortnum'] = 0
 BuildmasterConfig = c
 """





More information about the Commits mailing list