From warner at users.sourceforge.net Fri Apr 1 01:01:15 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 01 Apr 2005 01:01:15 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py,1.46,1.47 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17226/buildbot/status Modified Files: builder.py Log Message: (BuildStatus.saveYourself): under w32, don't unlink the file unless it already exists. Thanks to Baptiste Lepilleur for the catch. (BuilderStatus.saveYourself): same Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- builder.py 3 Dec 2004 22:54:52 -0000 1.46 +++ builder.py 1 Apr 2005 01:01:12 -0000 1.47 @@ -795,7 +795,8 @@ # fall back to delete-first. There are ways this can fail and # lose the builder's history, so we avoid using it in the # general (non-windows) case - os.unlink(filename) + if os.path.exists(filename): + os.unlink(filename) os.rename(tmpfilename, filename) except: log.msg("unable to save build %s-#%d" % (self.builder.name, @@ -884,7 +885,8 @@ pickle.dump(self, open(tmpfilename, "w"), -1) if sys.platform == 'win32': # windows cannot rename a file on top of an existing one - os.unlink(filename) + if os.path.exists(filename): + os.unlink(filename) os.rename(tmpfilename, filename) except: log.msg("unable to save builder %s" % self.name) From warner at users.sourceforge.net Fri Apr 1 01:01:15 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 01 Apr 2005 01:01:15 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.340,1.341 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17226 Modified Files: ChangeLog Log Message: (BuildStatus.saveYourself): under w32, don't unlink the file unless it already exists. Thanks to Baptiste Lepilleur for the catch. (BuilderStatus.saveYourself): same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.340 retrieving revision 1.341 diff -u -d -r1.340 -r1.341 --- ChangeLog 1 Feb 2005 08:36:46 -0000 1.340 +++ ChangeLog 1 Apr 2005 01:01:13 -0000 1.341 @@ -1,3 +1,10 @@ +2005-03-31 Brian Warner + + * buildbot/status/builder.py (BuildStatus.saveYourself): under + w32, don't unlink the file unless it already exists. Thanks to + Baptiste Lepilleur for the catch. + (BuilderStatus.saveYourself): same + 2005-02-01 Brian Warner * buildbot/status/html.py (TextLog.getChild): use a /text child From warner at users.sourceforge.net Fri Apr 1 06:02:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 01 Apr 2005 06:02:27 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.341,1.342 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10144 Modified Files: ChangeLog Log Message: (Bot.remote_setBuilderList): fix typo that caused a warning each time the master changed our set of builders Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.341 retrieving revision 1.342 diff -u -d -r1.341 -r1.342 --- ChangeLog 1 Apr 2005 01:01:13 -0000 1.341 +++ ChangeLog 1 Apr 2005 06:02:25 -0000 1.342 @@ -1,5 +1,8 @@ 2005-03-31 Brian Warner + * buildbot/slave/bot.py (Bot.remote_setBuilderList): fix typo that + caused a warning each time the master changed our set of builders + * buildbot/status/builder.py (BuildStatus.saveYourself): under w32, don't unlink the file unless it already exists. Thanks to Baptiste Lepilleur for the catch. From warner at users.sourceforge.net Fri Apr 1 06:02:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 01 Apr 2005 06:02:27 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave bot.py,1.6,1.7 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10144/buildbot/slave Modified Files: bot.py Log Message: (Bot.remote_setBuilderList): fix typo that caused a warning each time the master changed our set of builders Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- bot.py 11 Dec 2004 11:12:35 -0000 1.6 +++ bot.py 1 Apr 2005 06:02:24 -0000 1.7 @@ -261,7 +261,7 @@ for name in self.builders.keys(): if not name in map(lambda a: a[0], wanted): log.msg("removing old builder %s" % name) - self.builder[name].disownServiceParent() + self.builders[name].disownServiceParent() del(self.builders[name]) return retval From warner at users.sourceforge.net Sat Apr 2 00:33:24 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 02 Apr 2005 00:33:24 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.19,1.20 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11108/buildbot/test Modified Files: test_vc.py Log Message: rearrange probe-for-VC-program routine so the tests don't hang under twisted-2.0 Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- test_vc.py 24 Nov 2004 22:02:01 -0000 1.19 +++ test_vc.py 2 Apr 2005 00:33:21 -0000 1.20 @@ -42,43 +42,62 @@ # is running). -RepositoryPath = None -if os.environ.get("BUILDBOT_TEST_VC"): - p = os.path.join(os.path.expanduser(os.environ.get("BUILDBOT_TEST_VC")), - "buildbot-test-vc-1") - if os.path.exists(os.path.join(p, "README")): - RepositoryPath = p - # some of them take a file: URI - RepositoryPath_URI = "file://" + RepositoryPath - # many VC systems can access the repository via HTTP - Repository_HTTP = "http://localhost:%d" -have_arch, have_darcs, have_svn, have_cvs = False, False, False, False -for p in os.environ['PATH'].split(":"): - if os.path.exists(os.path.join(p, 'tla')): - have_arch = True - if os.path.exists(os.path.join(p, 'darcs')): - have_darcs = True - if os.path.exists(os.path.join(p, 'svn')): - # we need svn to be compiled with the ra_local access module - from twisted.internet import utils - v = dr(utils.getProcessOutput('svn', ["--version"], env=os.environ)) - if "handles 'file' schema" in v: - have_svn = True - else: - log.msg(("%s found but it does not support 'file:' schema, " + - "skipping svn tests") % os.path.join(p, "svn")) - if os.path.exists(os.path.join(p, 'cvs')): - have_cvs = True +class VCSupport: + """This holds everything we learn about the availability of VC tools on + the test host. A single instance of this is created when the first test + case is started, and remains available at the module level for all other + test cases.""" -if not have_svn: - log.msg("could not find usable 'svn', skipping Subversion tests") -if not have_arch: - log.msg("could not find 'tla' on $PATH, skipping Arch tests") -if not have_darcs: - log.msg("could not find 'darcs' on $PATH, skipping Darcs tests") -if not have_cvs: - log.msg("could not find 'cvs' on $PATH, skipping CVS tests") + RepositoryPath = None + def __init__(self): + log.msg("test_vc now looking for VC programs") + if os.environ.get("BUILDBOT_TEST_VC"): + vcdir = os.path.expanduser(os.environ.get("BUILDBOT_TEST_VC")) + p = os.path.join(vcdir, + "buildbot-test-vc-1") + if os.path.exists(os.path.join(p, "README")): + self.RepositoryPath = p + # some of them take a file: URI + self.RepositoryPath_URI = "file://" + self.RepositoryPath + # many VC systems can access the repository via HTTP + self.Repository_HTTP = "http://localhost:%d" + + self.have = {'arch': False, 'darcs': False, + 'svn': False, 'cvs': False, + } + + for p in os.environ['PATH'].split(":"): + if os.path.exists(os.path.join(p, 'tla')): + self.have['arch'] = True + if os.path.exists(os.path.join(p, 'darcs')): + self.have['darcs'] = True + if os.path.exists(os.path.join(p, 'svn')): + # we need svn to be compiled with the ra_local access module + from twisted.internet import utils + log.msg("running svn --version..") + v = dr(utils.getProcessOutput('svn', ["--version"], + env=os.environ)) + if "handles 'file' schema" in v: + self.have['svn'] = True + else: + log.msg(("%s found but it does not support 'file:' " + + "schema, skipping svn tests") % + os.path.join(p, "svn")) + if os.path.exists(os.path.join(p, 'cvs')): + self.have['cvs'] = True + + if not self.have['svn']: + log.msg("could not find usable 'svn', skipping Subversion tests") + if not self.have['arch']: + log.msg("could not find 'tla' on $PATH, skipping Arch tests") + if not self.have['darcs']: + log.msg("could not find 'darcs' on $PATH, skipping Darcs tests") + if not self.have['cvs']: + log.msg("could not find 'cvs' on $PATH, skipping CVS tests") + log.msg("test_vc program scan done") + +VCS = None config_vc = """ from buildbot.process import factory, step @@ -140,21 +159,24 @@ if self.sigchldHandler: signal.signal(signal.SIGCHLD, self.sigchldHandler) -class SetupMixin: +class SetupMixin(SignalMixin): master = None slave = None - serveHTTP = None httpServer = None httpPort = None + def setUpClass(self): + if VCS is None: + global VCS + VCS = VCSupport() + SignalMixin.setUpClass(self) + if not VCS.RepositoryPath: + raise unittest.SkipTest("provide " + "BUILDBOT_TEST_VC=path/to/repositories " + "to run this") + def setUp(self): - if self.serveHTTP: - # launch an HTTP server to serve the repository files - from twisted.web import static, server - from twisted.internet import reactor - root = static.File(self.serveHTTP) - self.httpServer = reactor.listenTCP(0, server.Site(root)) - self.httpPort = self.httpServer.getHost().port + self.serveHTTP() shutil.rmtree("basedir", ignore_errors=1) os.mkdir("basedir") self.master = master.BuildMaster("basedir") @@ -162,6 +184,9 @@ shutil.rmtree(self.slavebase, ignore_errors=1) os.mkdir("slavebase") + def serveHTTP(self): + pass + def connectSlave(self): port = self.master.slavePort._port.getHost().port slave = bot.BuildSlave("localhost", port, "bot1", "sekrit", @@ -301,28 +326,28 @@ self.shouldNotExist(workdir, "newfile") -class VC(SignalMixin, SetupMixin, unittest.TestCase): +class VC(SetupMixin, unittest.TestCase): def testCVS(self): - if not have_cvs: + if not VCS.have['cvs']: raise unittest.SkipTest("CVS is not installed") self.do_vc("step.CVS", { - 'cvsroot': RepositoryPath + "/CVS-Repository", + 'cvsroot': VCS.RepositoryPath + "/CVS-Repository", 'cvsmodule': "sample"}, metadir="CVS") def testSVN(self): - if not have_svn: + if not VCS.have['svn']: raise unittest.SkipTest("No usable Subversion was found") self.do_vc("step.SVN", { - 'svnurl': RepositoryPath_URI + "/SVN-Repository/sample"}, + 'svnurl': VCS.RepositoryPath_URI + "/SVN-Repository/sample"}, metadir=".svn") def testDarcs(self): - if not have_darcs: + if not VCS.have['darcs']: raise unittest.SkipTest("Darcs is not installed") self.do_vc("step.Darcs", { - 'repourl': RepositoryPath_URI + "/Darcs-Repository", + 'repourl': VCS.RepositoryPath_URI + "/Darcs-Repository", }, testRetry=False) # Darcs has a metadir="_darcs", but it does not have an 'export' @@ -332,10 +357,10 @@ # Arch def testArch(self): - if not have_arch: + if not VCS.have['arch']: raise unittest.SkipTest("Arch (tla) is not installed") self.do_vc("step.Arch", { - 'url': RepositoryPath + "/Arch-Repository", + 'url': VCS.RepositoryPath + "/Arch-Repository", 'version': "testvc--mainline--1", }, testRetry=False) @@ -355,27 +380,34 @@ # change it from the default, then 'tla update' won't work. os.system("tla register-archive -d test at buildbot.sf.net--testvc") -class VC_HTTP(SignalMixin, SetupMixin, unittest.TestCase): - serveHTTP = RepositoryPath +class VC_HTTP(SetupMixin, unittest.TestCase): + def serveHTTP(self): + # launch an HTTP server to serve the repository files + from twisted.web import static, server + from twisted.internet import reactor + root = static.File(VCS.RepositoryPath) + self.httpServer = reactor.listenTCP(0, server.Site(root)) + self.httpPort = self.httpServer.getHost().port def testDarcsHTTP(self): - if not have_darcs: + if not VCS.have['darcs']: raise unittest.SkipTest("Darcs is not installed") self.do_vc("step.Darcs", { - 'repourl': Repository_HTTP % self.httpPort + "/Darcs-Repository", + 'repourl': (VCS.Repository_HTTP % self.httpPort + + "/Darcs-Repository"), }, testRetry=False) # Darcs has a metadir="_darcs", but it does not have an 'export' mode def testArchHTTP(self): - if not have_arch: + if not VCS.have['arch']: raise unittest.SkipTest("Arch (tla) is not installed") self.do_vc("step.Arch", { - 'url': Repository_HTTP % self.httpPort + "/Arch-Repository", + 'url': VCS.Repository_HTTP % self.httpPort + "/Arch-Repository", 'version': "testvc--mainline--1", }, testRetry=False) os.system("tla register-archive -d test at buildbot.sf.net--testvc") -class Patch(SignalMixin, SetupMixin, unittest.TestCase): +class Patch(SetupMixin, unittest.TestCase): def doPatch(self, vc, revision, **kwargs): m = self.master @@ -419,18 +451,18 @@ def testPatchCVS(self): - if not have_cvs: + if not VCS.have['cvs']: raise unittest.SkipTest("CVS is not installed") self.doPatch(vc=step.CVS, - cvsroot= RepositoryPath + "/CVS-Repository", + cvsroot= VCS.RepositoryPath + "/CVS-Repository", cvsmodule="sample", revision="today") def testPatchSVN(self): - if not have_svn: + if not VCS.have['svn']: raise unittest.SkipTest("No usable Subversion was found") self.doPatch(vc=step.SVN, - svnurl= RepositoryPath_URI + "/SVN-Repository/sample", + svnurl=VCS.RepositoryPath_URI + "/SVN-Repository/sample", revision="HEAD") @@ -482,9 +514,3 @@ self.addChange(b, revision=67) s = step.SVN(svnurl=None, workdir=None, build=b) self.failUnlessEqual(s.computeSourceRevision(b.allChanges()), 67) - - -if not RepositoryPath: - VC.skip = "provide BUILDBOT_TEST_VC=path/to/repositories to run this" - VC_HTTP.skip = "provide BUILDBOT_TEST_VC=path/to/repositories to run this" - Patch.skip = "provide BUILDBOT_TEST_VC=path/to/repositories to run this" From warner at users.sourceforge.net Sat Apr 2 00:56:49 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 02 Apr 2005 00:56:49 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.5,1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23408/buildbot/test Modified Files: test_web.py Log Message: rearrange server-setup and teardown code to remove unclean-reactor warnings from twisted-2.0 Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- test_web.py 14 Oct 2004 16:47:32 -0000 1.5 +++ test_web.py 2 Apr 2005 00:56:46 -0000 1.6 @@ -7,7 +7,7 @@ from twisted.trial import unittest dr = unittest.deferredResult -from twisted.internet import reactor +from twisted.internet import reactor, defer from twisted.internet.interfaces import IReactorUNIX from twisted.web import client @@ -41,21 +41,32 @@ -def distrib_unix(unixpath): - from twisted.web import server, resource, distrib - root = resource.Resource() - r = distrib.ResourceSubscription("unix", unixpath) - root.putChild('remote', r) - p = reactor.listenTCP(0, server.Site(root)) - return p +class DistribUNIX: + def __init__(self, unixpath): + from twisted.web import server, resource, distrib + root = resource.Resource() + self.r = r = distrib.ResourceSubscription("unix", unixpath) + root.putChild('remote', r) + self.p = p = reactor.listenTCP(0, server.Site(root)) + self.portnum = p.getHost().port + def shutdown(self): + d = defer.maybeDeferred(self.p.stopListening) + return d -def distrib_tcp(port): - from twisted.web import server, resource, distrib - root = resource.Resource() - r = distrib.ResourceSubscription("localhost", port) - root.putChild('remote', r) - p = reactor.listenTCP(0, server.Site(root)) - return p +class DistribTCP: + def __init__(self, port): + from twisted.web import server, resource, distrib + root = resource.Resource() + self.r = r = distrib.ResourceSubscription("localhost", port) + root.putChild('remote', r) + self.p = p = reactor.listenTCP(0, server.Site(root)) + self.portnum = p.getHost().port + def shutdown(self): + d = defer.maybeDeferred(self.p.stopListening) + d.addCallback(self._shutdown_1) + return d + def _shutdown_1(self, res): + return self.r.publisher.broker.transport.loseConnection() class WebTest(unittest.TestCase): @@ -95,14 +106,13 @@ m = ConfiguredMaster("test_web2", cfg) m.startService() - p = distrib_unix("test_web2/.web-pb") - port = p.getHost().port + p = DistribUNIX("test_web2/.web-pb") - d = client.getPage("http://localhost:%d/remote/" % port) + d = client.getPage("http://localhost:%d/remote/" % p.portnum) page = dr(d) #print page self.failUnless(page) - dr(p.stopListening()) + dr(p.shutdown()) dr(m.stopService()) @@ -116,13 +126,11 @@ m.startService() dport = list(self.find_waterfall(m)[0])[0]._port.getHost().port - p = distrib_tcp(dport) - port = p.getHost().port + p = DistribTCP(dport) - d = client.getPage("http://localhost:%d/remote/" % port) + d = client.getPage("http://localhost:%d/remote/" % p.portnum) page = dr(d) #print page self.failUnless(page) - dr(p.stopListening()) + dr(p.shutdown()) dr(m.stopService()) - From warner at users.sourceforge.net Sat Apr 2 01:41:51 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 02 Apr 2005 01:41:51 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.342,1.343 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15644 Modified Files: ChangeLog Log Message: (Run.testMaster): change some uses of deferredResult to avoid hangs/warnings under twisted-2.0 (RunMixin.tearDown): same (RunMixin.shutdownSlave): same (Disconnect.testIdle1): same (Disconnect.testBuild2): same: wait one second after the build finishes for test to really be done.. this should be cleaned up to avoid wasting that second. Builder.detach uses a callLater(0), either that should be done in-line (something else needed that behavior), or it should return a Deferred that fires when the builder is really offline. (Disconnect.testBuild3): same (Disconnect.testDisappear): same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.342 retrieving revision 1.343 diff -u -d -r1.342 -r1.343 --- ChangeLog 1 Apr 2005 06:02:25 -0000 1.342 +++ ChangeLog 2 Apr 2005 01:41:40 -0000 1.343 @@ -1,3 +1,25 @@ +2005-04-01 Brian Warner + + * buildbot/test/test_run.py (Run.testMaster): change some uses of + deferredResult to avoid hangs/warnings under twisted-2.0 + (RunMixin.tearDown): same + (RunMixin.shutdownSlave): same + (Disconnect.testIdle1): same + (Disconnect.testBuild2): same: wait one second after the build + finishes for test to really be done.. this should be cleaned up to + avoid wasting that second. Builder.detach uses a callLater(0), + either that should be done in-line (something else needed that + behavior), or it should return a Deferred that fires when the + builder is really offline. + (Disconnect.testBuild3): same + (Disconnect.testDisappear): same + + * buildbot/test/test_web.py: rearrange server-setup and teardown + code to remove unclean-reactor warnings from twisted-2.0 + + * buildbot/test/test_vc.py: rearrange probe-for-VC-program routine + so the tests don't hang under twisted-2.0 + 2005-03-31 Brian Warner * buildbot/slave/bot.py (Bot.remote_setBuilderList): fix typo that From warner at users.sourceforge.net Sat Apr 2 01:41:42 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 02 Apr 2005 01:41:42 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_run.py,1.21,1.22 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15644/buildbot/test Modified Files: test_run.py Log Message: (Run.testMaster): change some uses of deferredResult to avoid hangs/warnings under twisted-2.0 (RunMixin.tearDown): same (RunMixin.shutdownSlave): same (Disconnect.testIdle1): same (Disconnect.testBuild2): same: wait one second after the build finishes for test to really be done.. this should be cleaned up to avoid wasting that second. Builder.detach uses a callLater(0), either that should be done in-line (something else needed that behavior), or it should return a Deferred that fires when the builder is really offline. (Disconnect.testBuild3): same (Disconnect.testDisappear): same Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- test_run.py 11 Dec 2004 11:12:33 -0000 1.21 +++ test_run.py 2 Apr 2005 01:41:38 -0000 1.22 @@ -13,6 +13,16 @@ from buildbot.changes.changes import Change from buildbot.status import builder +def maybeWait(d, timeout="none"): + # this is required for oldtrial (twisted-1.3.0) compatibility. When we + # move to retrial (twisted-2.0.0), replace these with a simple 'return + # d'. + if timeout == "none": + unittest.deferredResult(d) + else: + unittest.deferredResult(d, timeout) + return None + config_1 = """ from buildbot.process import factory @@ -125,6 +135,8 @@ self.failUnless(b1.waiting) # now kill the timer b1.waiting.stopTimer() + d = defer.maybeDeferred(m.stopService) + maybeWait(d) class RunMixin: master = None @@ -173,31 +185,44 @@ def tearDown(self): log.msg("doing tearDown") - self.shutdownSlave() + d = self.shutdownSlave() + d.addCallback(self._tearDown_1) + d.addCallback(self._tearDown_2) + return maybeWait(d) + def _tearDown_1(self, res): if self.master: - dr(defer.maybeDeferred(self.master.stopService)) - self.master = None + return defer.maybeDeferred(self.master.stopService) + def _tearDown_2(self, res): + self.master = None log.msg("tearDown done") # various forms of slave death - def shutdownSlave(self, waitForMasterToo=True): + def shutdownSlave(self, whendone=None): # the slave has disconnected normally: they SIGINT'ed it, or it shut # down willingly. This will kill child processes and give them a - # chance to finish up. + # chance to finish up. We return a Deferred that will fire when + # everything is finished shutting down. + + # 'whendone' is an optional Deferred that will be fired when the + # shutdown is complete + log.msg("doing shutdownSlave") + dl = [] if self.slave: - d = self.slave.waitUntilDisconnected() - dr(defer.maybeDeferred(self.slave.stopService)) - dr(d) - self.slave = None + dl.append(self.slave.waitUntilDisconnected()) + dl.append(defer.maybeDeferred(self.slave.stopService)) if self.slave2: - d = self.slave2.waitUntilDisconnected() - dr(defer.maybeDeferred(self.slave2.stopService)) - dr(d) - self.slave2 = None - if waitForMasterToo: - d = self.master.botmaster.waitUntilBuilderDetached("dummy") - dr(d) + dl.append(self.slave2.waitUntilDisconnected()) + dl.append(defer.maybeDeferred(self.slave2.stopService)) + d = defer.DeferredList(dl) + d.addCallback(self._shutdownSlaveDone) + if whendone: + d.addCallback(whendone.callback) + return d + def _shutdownSlaveDone(self, res): + self.slave = None + self.slave2 = None + return self.master.botmaster.waitUntilBuilderDetached("dummy") def killSlave(self): # the slave has died, its host sent a FIN. The .notifyOnDisconnect @@ -413,8 +438,10 @@ def testIdle1(self): m,s,c,s1 = self.disconnectSetup() # disconnect the slave before the build starts - self.shutdownSlave() # dies before it gets started - + d = self.shutdownSlave() # dies before it gets started + d.addCallback(self._testIdle1_1, (m,s,c,s1)) + return d + def _testIdle1_1(self, res, (m,s,c,s1)): # trying to force a build now will cause an error. Regular builds # just wait for the slave to re-appear, but forced builds that # cannot be run right away trigger NoSlaveErrors @@ -502,11 +529,25 @@ # shutdown the slave while it's running the first step reactor.callLater(0.5, self.shutdownSlave) - dr(bs.waitUntilFinished(), 5) + d = bs.waitUntilFinished() + d.addCallback(self._testBuild2_1, s1, bs) + return maybeWait(d, 5) + testBuild2.timeout = 5 + + def _testBuild2_1(self, res, s1, bs): + # we hit here when the build has finished. The builder is still being + # torn down, however, so spin for another second to allow the + # callLater(0) in Builder.detached to fire. + d = defer.Deferred() + reactor.callLater(1, d.callback, None) + d.addCallback(self._testBuild2_2, s1, bs) + return d + def _testBuild2_2(self, res, s1, bs): self.failUnlessEqual(s1.getState()[0], "offline") self.verifyDisconnect(bs) + def testBuild3(self): m,s,c,s1 = self.disconnectSetup() # this next sequence is timing-dependent @@ -514,12 +555,23 @@ bs = bc.getStatus() # kill the slave while it's running the first step reactor.callLater(0.5, self.killSlave) + d = bs.waitUntilFinished() + d.addCallback(self._testBuild3_1, s1, bs) + return maybeWait(d, 5) + testBuild3.timeout = 5 - dr(bs.waitUntilFinished(), 5) + def _testBuild3_1(self, res, s1, bs): + # the builder is still being torn down, so give it another second + d = defer.Deferred() + reactor.callLater(1, d.callback, None) + d.addCallback(self._testBuild3_2, s1, bs) + return d + def _testBuild3_2(self, res, s1, bs): self.failUnlessEqual(s1.getState()[0], "offline") self.verifyDisconnect(bs) + def testBuild4(self): m,s,c,s1 = self.disconnectSetup() # this next sequence is timing-dependent @@ -551,7 +603,10 @@ # ping should succeed d = bc.ping(1) - res = dr(d) + d.addCallback(self._testDisappear_1, (m,s,c,s1,bc)) + return maybeWait(d) + + def _testDisappear_1(self, res, (m,s,c,s1,bc)): self.failUnlessEqual(res, True) # now, before any build is run, make the slave disappear @@ -560,7 +615,9 @@ # at this point, a ping to the slave should timeout d = bc.ping(1) - res = dr(d) + d.addCallback(self. _testDisappear_2) + return d + def _testDisappear_2(self, res): self.failUnlessEqual(res, False) def testDuplicate(self): From warner at users.sourceforge.net Sat Apr 2 20:20:18 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 02 Apr 2005 20:20:18 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process step_twisted.py,1.64,1.65 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20094/buildbot/process Modified Files: step_twisted.py Log Message: (countFailedTests): the new trial in Twisted-2.0 emits a slightly different status line than old trial ("PASSED.." instead of "OK.."). Handle it so we don't mistakenly think the test count is unparseable. (Trial.start): note that for some reason each build causes another copy of self.testpath to be prepended to PYTHONPATH. This needs to be fixed but I'm not sure quite where the problem is. Index: step_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step_twisted.py,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- step_twisted.py 9 Dec 2004 10:24:56 -0000 1.64 +++ step_twisted.py 2 Apr 2005 20:20:15 -0000 1.65 @@ -99,6 +99,7 @@ # lines[-2] is blank # lines[-1] is 'OK' or 'FAILED (failures=1, errors=12)' # or 'FAILED (failures=1)' + # or "PASSED (skips=N, successes=N)" (for Twisted-2.0) # there might be other lines dumped here. Scan all the lines. res = {'total': None, 'failures': 0, @@ -111,7 +112,9 @@ out = re.search(r'Ran (\d+) tests', l) if out: res['total'] = int(out.group(1)) - if l.startswith("OK") or l.startswith("FAILED "): + if (l.startswith("OK") or + l.startswith("FAILED ") or + l.startswith("PASSED")): # the extra space on FAILED_ is to distinguish the overall # status from an individual test which failed. The lack of a # space on the OK is because it may be printed without any @@ -126,6 +129,9 @@ if out: res['expectedFailures'] = int(out.group(1)) out = re.search(r'unexpectedSuccesses=(\d+)', l) if out: res['unexpectedSuccesses'] = int(out.group(1)) + # successes= is a Twisted-2.0 addition, and is not currently used + out = re.search(r'successes=(\d+)', l) + if out: res['successes'] = int(out.group(1)) return res @@ -349,6 +355,8 @@ if e is None: self.cmd.args['env'] = {'PYTHONPATH': self.testpath} else: + # TODO: somehow, each build causes another copy of + # self.testpath to get prepended if e.get('PYTHONPATH', "") == "": e['PYTHONPATH'] = self.testpath else: From warner at users.sourceforge.net Sat Apr 2 20:20:19 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 02 Apr 2005 20:20:19 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.343,1.344 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20094 Modified Files: ChangeLog Log Message: (countFailedTests): the new trial in Twisted-2.0 emits a slightly different status line than old trial ("PASSED.." instead of "OK.."). Handle it so we don't mistakenly think the test count is unparseable. (Trial.start): note that for some reason each build causes another copy of self.testpath to be prepended to PYTHONPATH. This needs to be fixed but I'm not sure quite where the problem is. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.343 retrieving revision 1.344 diff -u -d -r1.343 -r1.344 --- ChangeLog 2 Apr 2005 01:41:40 -0000 1.343 +++ ChangeLog 2 Apr 2005 20:20:16 -0000 1.344 @@ -1,3 +1,13 @@ +2005-04-02 Brian Warner + + * buildbot/process/step_twisted.py (countFailedTests): the new + trial in Twisted-2.0 emits a slightly different status line than + old trial ("PASSED.." instead of "OK.."). Handle it so we don't + mistakenly think the test count is unparseable. + (Trial.start): note that for some reason each build causes another + copy of self.testpath to be prepended to PYTHONPATH. This needs to + be fixed but I'm not sure quite where the problem is. + 2005-04-01 Brian Warner * buildbot/test/test_run.py (Run.testMaster): change some uses of From warner at users.sourceforge.net Mon Apr 4 07:10:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 04 Apr 2005 07:10:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.57,1.58 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv974/buildbot Modified Files: master.py Log Message: (BuildMaster.loadConfig): only call exec() with one dict, apparently exec has some scoping bugs when used with both global/local dicts. Thanks to Nathaniel Smith for the catch. Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- master.py 6 Dec 2004 07:36:34 -0000 1.57 +++ master.py 4 Apr 2005 07:10:22 -0000 1.58 @@ -657,10 +657,9 @@ f.close() def loadConfig(self, f): - globalDict = {} localDict = {'basedir': os.path.expanduser(self.basedir)} try: - exec f in globalDict, localDict + exec f in localDict except: log.msg("error while parsing config file") raise From warner at users.sourceforge.net Mon Apr 4 07:10:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 04 Apr 2005 07:10:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.344,1.345 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv974 Modified Files: ChangeLog Log Message: (BuildMaster.loadConfig): only call exec() with one dict, apparently exec has some scoping bugs when used with both global/local dicts. Thanks to Nathaniel Smith for the catch. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.344 retrieving revision 1.345 diff -u -d -r1.344 -r1.345 --- ChangeLog 2 Apr 2005 20:20:16 -0000 1.344 +++ ChangeLog 4 Apr 2005 07:10:30 -0000 1.345 @@ -1,3 +1,10 @@ +2005-04-03 Brian Warner + + * buildbot/master.py (BuildMaster.loadConfig): only call exec() + with one dict, apparently exec has some scoping bugs when used + with both global/local dicts. Thanks to Nathaniel Smith for the + catch. + 2005-04-02 Brian Warner * buildbot/process/step_twisted.py (countFailedTests): the new From warner at users.sourceforge.net Wed Apr 6 00:48:31 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 06 Apr 2005 00:48:31 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.19,1.20 bot.py,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6061/buildbot/slave Modified Files: commands.py bot.py Log Message: * buildbot/slave/commands.py (SourceBase.doCopy): use cp -p to preserve timestamps, helps incremental builds of large trees. Patch from Rene Rivera. * buildbot/slave/bot.py (SlaveBuilder.commandComplete): oops, log 'failure' and not the non-existent 'why'. Thanks to Rene Rivera for the catch. Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- bot.py 1 Apr 2005 06:02:24 -0000 1.7 +++ bot.py 6 Apr 2005 00:48:28 -0000 1.8 @@ -199,7 +199,7 @@ def commandComplete(self, failure): if failure: log.msg("SlaveBuilder.commandFailed", self.command) - log.err(why) + log.err(failure) # failure, if present, is a failure.Failure. To send it across # the wire, we must turn it into a pb.CopyableFailure. failure = pb.CopyableFailure(failure) Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- commands.py 6 Dec 2004 09:00:32 -0000 1.19 +++ commands.py 6 Apr 2005 00:48:28 -0000 1.20 @@ -331,7 +331,7 @@ def start(self): """Start the command. self.running will be set just before this is called. This method should return a Deferred that will fire when the - command has completed. + command has completed. The Deferred's argument will be ignored. This method should be overridden by subclasses.""" raise NotImplementedError, "You must implement this in a subclass" @@ -601,7 +601,7 @@ if runtime.platformType != "posix": shutil.copytree(fromdir, todir) return - command = ['cp', '-r', fromdir, todir] + command = ['cp', '-r', '-p', fromdir, todir] c = ShellCommand(self.builder, command, self.builder.basedir, sendRC=False, timeout=self.timeout) self.command = c From warner at users.sourceforge.net Wed Apr 6 00:48:31 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 06 Apr 2005 00:48:31 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.345,1.346 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6061 Modified Files: ChangeLog Log Message: * buildbot/slave/commands.py (SourceBase.doCopy): use cp -p to preserve timestamps, helps incremental builds of large trees. Patch from Rene Rivera. * buildbot/slave/bot.py (SlaveBuilder.commandComplete): oops, log 'failure' and not the non-existent 'why'. Thanks to Rene Rivera for the catch. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.345 retrieving revision 1.346 diff -u -d -r1.345 -r1.346 --- ChangeLog 4 Apr 2005 07:10:30 -0000 1.345 +++ ChangeLog 6 Apr 2005 00:48:29 -0000 1.346 @@ -1,3 +1,13 @@ +2005-04-05 Brian Warner + + * buildbot/slave/commands.py (SourceBase.doCopy): use cp -p to + preserve timestamps, helps incremental builds of large trees. + Patch from Rene Rivera. + + * buildbot/slave/bot.py (SlaveBuilder.commandComplete): oops, log + 'failure' and not the non-existent 'why'. Thanks to Rene Rivera + for the catch. + 2005-04-03 Brian Warner * buildbot/master.py (BuildMaster.loadConfig): only call exec() From warner at users.sourceforge.net Mon Apr 11 19:30:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 11 Apr 2005 19:30:32 +0000 Subject: [Buildbot-commits] buildbot .arch-inventory,NONE,1.1 ChangeLog,1.346,1.347 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29759 Modified Files: ChangeLog Added Files: .arch-inventory Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-32 Creator: Brian Warner merge epydoc work from org.apestaart at thomas/buildbot--doc--0--patch-3 * general: merge org.apestaart at thomas/buildbot--doc--0--patch-3, adding epydoc-format docstrings to many classes. Thanks to Thomas Vander Stichele for the patches. * docs/epyrun, docs/gen-reference: add epydoc-generating tools * buildbot/status/mail.py, buildbot/process/step_twisted.py: same * buildbot/slave/bot.py, commands.py, registry.py: same --- NEW FILE: .arch-inventory --- precious ^m$ precious ^s$ precious ^svn$ Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.346 retrieving revision 1.347 diff -u -d -r1.346 -r1.347 --- ChangeLog 6 Apr 2005 00:48:29 -0000 1.346 +++ ChangeLog 11 Apr 2005 19:30:30 -0000 1.347 @@ -1,3 +1,12 @@ +2005-04-11 Brian Warner + + * general: merge org.apestaart at thomas/buildbot--doc--0--patch-3, + adding epydoc-format docstrings to many classes. Thanks to Thomas + Vander Stichele for the patches. + * docs/epyrun, docs/gen-reference: add epydoc-generating tools + * buildbot/status/mail.py, buildbot/process/step_twisted.py: same + * buildbot/slave/bot.py, commands.py, registry.py: same + 2005-04-05 Brian Warner * buildbot/slave/commands.py (SourceBase.doCopy): use cp -p to From warner at users.sourceforge.net Mon Apr 11 19:30:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 11 Apr 2005 19:30:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave registry.py,1.1,1.2 bot.py,1.8,1.9 commands.py,1.20,1.21 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29759/buildbot/slave Modified Files: registry.py bot.py commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-32 Creator: Brian Warner merge epydoc work from org.apestaart at thomas/buildbot--doc--0--patch-3 * general: merge org.apestaart at thomas/buildbot--doc--0--patch-3, adding epydoc-format docstrings to many classes. Thanks to Thomas Vander Stichele for the patches. * docs/epyrun, docs/gen-reference: add epydoc-generating tools * buildbot/status/mail.py, buildbot/process/step_twisted.py: same * buildbot/slave/bot.py, commands.py, registry.py: same Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- bot.py 6 Apr 2005 00:48:28 -0000 1.8 +++ bot.py 11 Apr 2005 19:30:28 -0000 1.9 @@ -224,6 +224,7 @@ class Bot(pb.Referenceable, service.MultiService): + """I represent the slave-side bot.""" usePTY = None name = "bot" Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- commands.py 6 Apr 2005 00:48:28 -0000 1.20 +++ commands.py 11 Apr 2005 19:30:28 -0000 1.21 @@ -377,22 +377,22 @@ """This is a Command which runs a shell command. The args dict contains the following keys: - ['command'] (required): a shell command to run. If this is a string, - it will be run with /bin/sh (['/bin/sh', '-c', command]). If it is a - list (preferred), it will be used directly. - ['workdir'] (required): subdirectory in which the command will be run, - relative to the builder dir - ['env']: a dict of environment variables to augment/replace os.environ - ['want_stdout']: 0 if stdout should be thrown away - ['want_stderr']: 0 if stderr should be thrown away - ['not_really']: 1 to skip execution and return rc=0 - ['timeout']: seconds of silence to tolerate before killing command + - ['command'] (required): a shell command to run. If this is a string, + it will be run with /bin/sh (['/bin/sh', '-c', command]). If it is a + list (preferred), it will be used directly. + - ['workdir'] (required): subdirectory in which the command will be run, + relative to the builder dir + - ['env']: a dict of environment variables to augment/replace os.environ + - ['want_stdout']: 0 if stdout should be thrown away + - ['want_stderr']: 0 if stderr should be thrown away + - ['not_really']: 1 to skip execution and return rc=0 + - ['timeout']: seconds of silence to tolerate before killing command ShellCommand creates the following status messages: - {'stdout': data} : when stdout data is available - {'stderr': data} : when stderr data is available - {'header': data} : when headers (command start/stop) are available - {'rc': rc} : when the process has terminated + - {'stdout': data} : when stdout data is available + - {'stderr': data} : when stderr data is available + - {'header': data} : when headers (command start/stop) are available + - {'rc': rc} : when the process has terminated """ def start(self): @@ -458,26 +458,29 @@ and update). This class extracts the following arguments from the dictionary received from the master: - ['workdir'] (required): the subdirectory where the buildable sources - should be placed - - ['mode']: one of update/copy/clobber/export, defaults to 'update' + - ['workdir']: (required) the subdirectory where the buildable sources + should be placed - ['revision']: If not None, this is an int or string which indicates - which sources (along a time-like axis) should be used. It is the thing - you provide as the CVS -r or -D argument. + - ['mode']: one of update/copy/clobber/export, defaults to 'update' - ['patch']: If not None, this is a tuple of (striplevel, patch) which - contains a patch that should be applied after the checkout has - occurred. Once applied, the tree is no longer eligible for use with - mode='update', and it only makes sense to use this in conjunction with - a ['revision'] argument. striplevel is an int, and patch is a string in - standard unified diff format. The patch will be applied with 'patch - -p%d Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29759/buildbot/status Modified Files: mail.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-32 Creator: Brian Warner merge epydoc work from org.apestaart at thomas/buildbot--doc--0--patch-3 * general: merge org.apestaart at thomas/buildbot--doc--0--patch-3, adding epydoc-format docstrings to many classes. Thanks to Thomas Vander Stichele for the patches. * docs/epyrun, docs/gen-reference: add epydoc-generating tools * buildbot/status/mail.py, buildbot/process/step_twisted.py: same * buildbot/slave/bot.py, commands.py, registry.py: same Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- mail.py 11 Nov 2004 00:43:48 -0000 1.12 +++ mail.py 11 Apr 2005 19:30:31 -0000 1.13 @@ -46,57 +46,9 @@ To get a simple one-message-per-build (say, for a mailing list), use sendToInterestedUsers=False, extraRecipients=['listaddr at example.org'] - Parameters: - - fromaddr (required): the email address to be used in the 'From' header. - - sendToInterestedUsers: if True (the default), send mail to all of the - Interested Users. If False, only send mail to - the extraRecipients list. - - extraRecipients: a list of email addresses to which messages should be - sent (in addition to the InterestedUsers list, which - includes any developers who made Changes that went into - this build). It is a good idea to create a small - mailing list and deliver to that, then let subscribers - come and go as they please. - - subject: a string to be used as the subject line of the message. - %(builder)s will be replaced with the name of the builder - which provoked the message. - - mode: a string, one of the following (defaults to 'all'): - - 'all': send mail about all builds, passing and failing - 'failing': only send mail about builds which fail - 'problem': only send mail about a build which failed when the previous - build passed - - builders: a list of builder names for which mail should be sent. - Defaults to all builds. - - addLogs: if True, include all build logs as attachments to the messages. - These can be quite large. This can also be set to a list of log - names, to send a subset of the logs. Defaults to False. - - relayhost: the host to which the outbound SMTP connection should be - made. Defaults to 'localhost' - - lookup: this is an object which provides IEmailLookup, which is - responsible for mapping User names (which come from the VC - system) into valid email addresses. If not provided, the - notifier will only be able to send mail to the addresses in the - extraRecipients list. Most of the time you can use a simple - Domain instance. As a shortcut, you can pass as string: this - will be treated as if you had provided Domain(str). For example, - lookup='twistedmatrix.com' will allow mail to be sent to all - developers whose SVN usernames match their twistedmatrix.com - account names. - Each MailNotifier sends mail to a single set of recipients. To send different kinds of mail to different recipients, use multiple MailNotifiers. - """ __implements__ = (interfaces.IStatusReceiver, @@ -112,6 +64,63 @@ subject="buildbot %(result)s in %(builder)s", lookup=None, extraRecipients=[], sendToInterestedUsers=True): + """ + @type fromaddr: string + @param fromaddr: the email address to be used in the 'From' header. + @type sendToInterestedUsers: boolean + @param sendToInterestedUsers: if True (the default), send mail to all + of the Interested Users. If False, only + send mail to the extraRecipients list. + + @type extraRecipients: tuple of string + @param extraRecipients: a list of email addresses to which messages + should be sent (in addition to the + InterestedUsers list, which includes any + developers who made Changes that went into this + build). It is a good idea to create a small + mailing list and deliver to that, then let + subscribers come and go as they please. + + @type subject: string + @param subject: a string to be used as the subject line of the message. + %(builder)s will be replaced with the name of the + %builder which provoked the message. + + @type mode: string (defaults to all) + @param mode: one of: + - 'all': send mail about all builds, passing and failing + - 'failing': only send mail about builds which fail + - 'problem': only send mail about a build which failed + when the previous build passed + + @type builders: tuple of strings + @param builders: a list of builder names for which mail should be sent. + Defaults to all builds. + + @type addLogs: boolean. + @param addLogs: if True, include all build logs as attachments to the + messages. These can be quite large. This can also be + set to a list of log names, to send a subset of the + logs. Defaults to False. + + @type relayhost: string + @param relayhost: the host to which the outbound SMTP connection + should be made. Defaults to 'localhost' + + @type lookup: implementor of {IEmailLookup} + @param lookup: object which provides IEmailLookup, which is + responsible for mapping User names (which come from + the VC system) into valid email addresses. If not + provided, the notifier will only be able to send mail + to the addresses in the extraRecipients list. Most of + the time you can use a simple Domain instance. As a + shortcut, you can pass as string: this will be + treated as if you had provided Domain(str). For + example, lookup='twistedmatrix.com' will allow mail + to be sent to all developers whose SVN usernames + match their twistedmatrix.com account names. + """ + assert type(extraRecipients) in (list, tuple) for r in extraRecipients: assert type(r) is str From warner at users.sourceforge.net Mon Apr 11 19:30:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 11 Apr 2005 19:30:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process step_twisted.py,1.65,1.66 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29759/buildbot/process Modified Files: step_twisted.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-32 Creator: Brian Warner merge epydoc work from org.apestaart at thomas/buildbot--doc--0--patch-3 * general: merge org.apestaart at thomas/buildbot--doc--0--patch-3, adding epydoc-format docstrings to many classes. Thanks to Thomas Vander Stichele for the patches. * docs/epyrun, docs/gen-reference: add epydoc-generating tools * buildbot/status/mail.py, buildbot/process/step_twisted.py: same * buildbot/slave/bot.py, commands.py, registry.py: same Index: step_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step_twisted.py,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- step_twisted.py 2 Apr 2005 20:20:15 -0000 1.65 +++ step_twisted.py 11 Apr 2005 19:30:30 -0000 1.66 @@ -20,12 +20,7 @@ from recommended style is flagged and put in the output log. This step looks at .changes in the parent Build to extract a list of - Lore XHTML files to check. - - @param results: [warnings, output]. 'warnings' is the number of problems - that were found in the XHTML files (equal to the number of lines of - output that have colons in them), 0 if none were found. 'output' is a - string with all the warnings.""" + Lore XHTML files to check.""" name = "hlint" description = ["running", "hlint"] @@ -36,6 +31,15 @@ warnings = 0 def __init__(self, python=None, **kwargs): + """ + @type results: double of [int, string] + @keyword results: [warnings, output]. + - warnings: the number of problems that were found + in the XHTML files (equal to the number of lines of + output that have colons in them), 0 if none were + found. + - output: string with all the warnings. + """ ShellCommand.__init__(self, **kwargs) self.python = python @@ -201,53 +205,7 @@ exceptions) to a file named test.log . This file will be pulled up to the master where it can be seen as part of the status output. - - @param testpath: a string to use in PYTHONPATH when running the tests. If - None, do not set PYTHONPATH. Setting this to '.' will cause the source - files to be used in-place. - - @param python: which python executable to use. Must be a string (without - spaces) or a list, and will form the start of the argv array that will - launch trial. If you use this, you should set 'trial' to an explicit - path (like /usr/bin/trial or ./bin/trial). Defaults to None, which - leaves it out entirely (running 'trial args' instead of 'python - ./bin/trial args'). Likely values are 'python', ['python2.2'], - ['python', '-Wall'], etc. - - @param trial: which 'trial' executable to run. Defaults to 'trial', which - will cause $PATH to be searched and probably find /usr/bin/trial . If - you set 'python', this should be set to an explicit path (because - 'python2.3 trial' will not work). - - @param tests: a list of test modules to run, like - ['twisted.test.test_defer', 'twisted.test.test_process']. If this is - a string, it will be converted into a one-item list. - - @param testChanges: if True, ignore the 'tests' parameter and instead ask - the Build for all the files that make up the Changes going into this - build. Pass these filenames to trial and ask it to look for - test-case-name tags, running just the tests necessary to cover the - changes. - - @param recurse: If true, pass the --recurse option to trial, allowing - test cases to be found in deeper subdirectories of the modules listed in - 'tests'. This does not appear to be necessary when using testChanges. - - @param reactor: which reactor to use, like 'gtk' or 'java'. If not - provided, the Twisted's usual platform-dependent default is used. - - @param randomly: if True, add the --random=0 argument, which instructs - trial to run the unit tests in a random order each time. This - occasionally catches problems that might be masked when one module - always runs before another (like failing to make registerAdapter calls - before lookups are done). - - In addition, the following parameters are inherited from ShellCommand and - may be useful to set: workdir, haltOnFailure, flunkOnWarnings, - flunkOnFailure, warnOnWarnings, warnOnFailure, want_stdout, want_stderr, - timeout. - - Also, there are some class attributes which may be usefully overridden + There are some class attributes which may be usefully overridden by subclasses. 'trialMode' and 'trialArgs' can influence the trial command line. """ @@ -268,6 +226,68 @@ testpath=UNSPECIFIED, tests=None, testChanges=None, recurse=None, randomly=None, **kwargs): + """ + @type testpath: string + @param testpath: use in PYTHONPATH when running the tests. If + None, do not set PYTHONPATH. Setting this to '.' will + cause the source files to be used in-place. + + @type python: string (without spaces) or list + @param python: which python executable to use. Will form the start of + the argv array that will launch trial. If you use this, + you should set 'trial' to an explicit path (like + /usr/bin/trial or ./bin/trial). Defaults to None, which + leaves it out entirely (running 'trial args' instead of + 'python ./bin/trial args'). Likely values are 'python', + ['python2.2'], ['python', '-Wall'], etc. + + @type trial: string + @param trial: which 'trial' executable to run. + Defaults to 'trial', which will cause $PATH to be + searched and probably find /usr/bin/trial . If you set + 'python', this should be set to an explicit path (because + 'python2.3 trial' will not work). + + @type tests: list of strings + @param tests: a list of test modules to run, like + ['twisted.test.test_defer', 'twisted.test.test_process']. + If this is a string, it will be converted into a one-item + list. + + @type testChanges: boolean + @param testChanges: if True, ignore the 'tests' parameter and instead + ask the Build for all the files that make up the + Changes going into this build. Pass these filenames + to trial and ask it to look for test-case-name + tags, running just the tests necessary to cover the + changes. + + @type recurse: boolean + @param recurse: If True, pass the --recurse option to trial, allowing + test cases to be found in deeper subdirectories of the + modules listed in 'tests'. This does not appear to be + necessary when using testChanges. + + @type reactor: string + @param reactor: which reactor to use, like 'gtk' or 'java'. If not + provided, the Twisted's usual platform-dependent + default is used. + + @type randomly: boolean + @param randomly: if True, add the --random=0 argument, which instructs + trial to run the unit tests in a random order each + time. This occasionally catches problems that might be + masked when one module always runs before another + (like failing to make registerAdapter calls before + lookups are done). + + @type kwargs: dict + @param kwargs: parameters. The following parameters are inherited from + L{ShellCommand} and may be useful to set: workdir, + haltOnFailure, flunkOnWarnings, flunkOnFailure, + warnOnWarnings, warnOnFailure, want_stdout, want_stderr, + timeout. + """ ShellCommand.__init__(self, **kwargs) if python: @@ -579,13 +599,6 @@ """I build all docs. This requires some LaTeX packages to be installed. It will result in the full documentation book (dvi, pdf, etc). - @param workdir: the workdir to start from: must be the base of the - Twisted tree - - @param results: [rc, warnings, output]. rc==0 if all files were - converted successfully. warnings is a count of hlint warnings. 'output' - is the verbose output of the command. - """ name = "process-docs" @@ -595,6 +608,20 @@ descriptionDone = ["docs"] # TODO: track output and time + def __init__(self, **kwargs): + """ + @type workdir: string + @keyword workdir: the workdir to start from: must be the base of the + Twisted tree + + @type results: triple of (int, int, string) + @keyword results: [rc, warnings, output] + - rc==0 if all files were converted successfully. + - warnings is a count of hlint warnings. + - output is the verbose output of the command. + """ + ShellCommand.__init__(self, **kwargs) + def createSummary(self, log): output = log.getText() # hlint warnings are of the format: 'WARNING: file:line:col: stuff From warner at users.sourceforge.net Mon Apr 11 19:30:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 11 Apr 2005 19:30:32 +0000 Subject: [Buildbot-commits] buildbot/docs gen-reference,NONE,1.1 epyrun,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29759/docs Added Files: gen-reference epyrun Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-32 Creator: Brian Warner merge epydoc work from org.apestaart at thomas/buildbot--doc--0--patch-3 * general: merge org.apestaart at thomas/buildbot--doc--0--patch-3, adding epydoc-format docstrings to many classes. Thanks to Thomas Vander Stichele for the patches. * docs/epyrun, docs/gen-reference: add epydoc-generating tools * buildbot/status/mail.py, buildbot/process/step_twisted.py: same * buildbot/slave/bot.py, commands.py, registry.py: same --- NEW FILE: epyrun --- #!/usr/bin/env python import sys import os from twisted.python import reflect from twisted.internet import reactor # epydoc import epydoc assert epydoc.__version__[0] == '2', "You need epydoc 2.x!" from epydoc.cli import cli class FakeModule: def __init__(self, name, level): self.__level = level self.__name__ = name def __repr__(self): return '' % self.__name__ __str__ = __repr__ def __nonzero__(self): return 1 def __call__(self, *args, **kw): pass #print 'Called:', args def __getattr__(self, attr): if self.__level == 0: raise AttributeError return FakeModule(self.__name__+'.'+attr, self.__level-1) def __cmp__(self, other): if not hasattr(other, '___name__'): return -1 return cmp(self.__name__, other.__name__) def fakeOut(modname): modpath = modname.split('.') prevmod = None for m in range(len(modpath)): mp = '.'.join(modpath[:m+1]) nm = FakeModule(mp, 4) if prevmod: setattr(prevmod, modpath[m], nm) sys.modules[mp] = nm prevmod = nm #fakeOut("twisted") # HACK: Another "only doc what we tell you". We don't want epydoc to # automatically recurse into subdirectories: "twisted"'s presence was # causing "twisted/test" to be docced, even thought we explicitly # didn't put any twisted/test in our modnames. from epydoc import imports orig_find_modules = imports.find_modules import re def find_modules(dirname): if not os.path.isdir(dirname): return [] found_init = 0 modules = {} dirs = [] # Search for directories & modules, and check for __init__.py. # Don't include duplicates (like foo.py and foo.pyc), and give # precedance to the .py files. for file in os.listdir(dirname): filepath = os.path.join(dirname, file) if os.path.isdir(filepath): dirs.append(filepath) elif not re.match(r'\w+.py.?', file): continue # Ignore things like ".#foo.py" or "a-b.py" elif file[-3:] == '.py': modules[file] = os.path.join(dirname, file) if file == '__init__.py': found_init = 1 elif file[-4:-1] == '.py': modules.setdefault(file[:-1], file) if file[:-1] == '__init__.py': found_init = 1 modules = modules.values() # If there was no __init__.py, then this isn't a package # directory; return nothing. if not found_init: return [] # Recurse to the child directories. # **twisted** here's the change: commented next line out #for d in dirs: modules += find_modules(d) return modules imports.find_modules = find_modules # Now, set up the list of modules for epydoc to document modnames = [] def addMod(arg, path, files): for fn in files: file = os.path.join(path, fn).replace('%s__init__'%os.sep, '') if file[-3:] == '.py' and not file.count('%stest%s' % (os.sep,os.sep)): modName = file[:-3].replace(os.sep,'.') try: #print 'pre-loading', modName reflect.namedModule(modName) except ImportError: print 'import error:', modName except: print 'other error:', modName else: modnames.append(modName) document_all = True # are we doing a full build? names = ['buildbot/'] #default, may be overriden below #get list of modules/pkgs on cmd-line try: i = sys.argv.index("--modules") except: pass else: names = sys.argv[i+1:] document_all = False sys.argv[i:] = [] #sanity check on names for i in range(len(names)): try: j = names[i].rindex('buildbot/') except: raise SystemExit, 'You can only specify buildbot modules or packages' else: #strip off any leading directories before the 'twisted/' #dir. this makes it easy to specify full paths, such as #from TwistedEmacs names[i] = names[i][j:] old_out_dir = "html" #if -o was specified, we need to change it to point to a tmp dir #otherwise add our own -o option try: i = sys.argv.index('-o') old_out_dir = sys.argv[i+1] try: os.mkdir(tmp_dir) except OSError: pass sys.argv[i+1] = tmp_dir except ValueError: sys.argv[1:1] = ['-o', tmp_dir] osrv = sys.argv sys.argv=["IGNORE"] for name in names: if name.endswith(".py"): # turn it in to a python module name name = name[:-3].replace(os.sep, ".") try: reflect.namedModule(name) except ImportError: print 'import error:', name except: print 'other error:', name else: modnames.append(name) else: #assume it's a dir os.path.walk(name, addMod, None) sys.argv = osrv if 'buildbot.test' in modnames: modnames.remove('buildbot.test') ##if 'twisted' in modnames: ## modnames.remove('twisted') sys.argv.extend(modnames) import buildbot sys.argv[1:1] = [ '-n', 'BuildBot %s' % buildbot.version, '-u', 'http://buildbot.sourceforge.net/', '--no-private'] # Make it easy to profile epyrun if 0: import profile profile.run('cli()', 'epyrun.prof') else: cli() print 'Done!' --- NEW FILE: gen-reference --- cd .. && python docs/epyrun -o docs/reference From warner at users.sourceforge.net Tue Apr 12 00:28:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 12 Apr 2005 00:28:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process step.py,1.59,1.60 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11709/buildbot/process Modified Files: step.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-34 Creator: Brian Warner let each RemoteShellCommand gets its own .env dictionary * buildbot/process/step.py (RemoteShellCommand.__init__): let each RemoteShellCommand gets its own .env dictionary, so that code in start() doesn't mutate the original. I think this should fix the step_twisted.Trial problem where multiple identical components kept getting added to PYTHONPATH= over and over again. Index: step.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- step.py 9 Dec 2004 10:24:56 -0000 1.59 +++ step.py 12 Apr 2005 00:28:30 -0000 1.60 @@ -271,6 +271,11 @@ want_stdout=1, want_stderr=1, timeout=20*60, **kwargs): self.command = command # stash .command, set it later + if env is not None: + # avoid mutating the original master.cfg dictionary. Each + # ShellCommand gets its own copy, any start() methods won't be + # able to modify the original. + env = env.copy() args = {'workdir': workdir, 'env': env, 'want_stdout': want_stdout, From warner at users.sourceforge.net Tue Apr 12 00:28:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 12 Apr 2005 00:28:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.347,1.348 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11709 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-34 Creator: Brian Warner let each RemoteShellCommand gets its own .env dictionary * buildbot/process/step.py (RemoteShellCommand.__init__): let each RemoteShellCommand gets its own .env dictionary, so that code in start() doesn't mutate the original. I think this should fix the step_twisted.Trial problem where multiple identical components kept getting added to PYTHONPATH= over and over again. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.347 retrieving revision 1.348 diff -u -d -r1.347 -r1.348 --- ChangeLog 11 Apr 2005 19:30:30 -0000 1.347 +++ ChangeLog 12 Apr 2005 00:28:31 -0000 1.348 @@ -1,5 +1,11 @@ 2005-04-11 Brian Warner + * buildbot/process/step.py (RemoteShellCommand.__init__): let each + RemoteShellCommand gets its own .env dictionary, so that code in + start() doesn't mutate the original. I think this should fix the + step_twisted.Trial problem where multiple identical components + kept getting added to PYTHONPATH= over and over again. + * general: merge org.apestaart at thomas/buildbot--doc--0--patch-3, adding epydoc-format docstrings to many classes. Thanks to Thomas Vander Stichele for the patches. From warner at users.sourceforge.net Tue Apr 12 00:28:47 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 12 Apr 2005 00:28:47 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.348,1.349 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11834 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-35 Creator: Brian Warner use abspath() to make test_vc happier in certain environments * buildbot/test/test_vc.py (VCSupport.__init__): use abspath() to normalize the VC-repository location.. makes SVN happier with certain test environments. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.348 retrieving revision 1.349 diff -u -d -r1.348 -r1.349 --- ChangeLog 12 Apr 2005 00:28:31 -0000 1.348 +++ ChangeLog 12 Apr 2005 00:28:45 -0000 1.349 @@ -1,5 +1,9 @@ 2005-04-11 Brian Warner + * buildbot/test/test_vc.py (VCSupport.__init__): use abspath() to + normalize the VC-repository location.. makes SVN happier with + certain test environments. + * buildbot/process/step.py (RemoteShellCommand.__init__): let each RemoteShellCommand gets its own .env dictionary, so that code in start() doesn't mutate the original. I think this should fix the From warner at users.sourceforge.net Tue Apr 12 00:28:48 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 12 Apr 2005 00:28:48 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.20,1.21 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11834/buildbot/test Modified Files: test_vc.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-35 Creator: Brian Warner use abspath() to make test_vc happier in certain environments * buildbot/test/test_vc.py (VCSupport.__init__): use abspath() to normalize the VC-repository location.. makes SVN happier with certain test environments. Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- test_vc.py 2 Apr 2005 00:33:21 -0000 1.20 +++ test_vc.py 12 Apr 2005 00:28:45 -0000 1.21 @@ -56,6 +56,7 @@ vcdir = os.path.expanduser(os.environ.get("BUILDBOT_TEST_VC")) p = os.path.join(vcdir, "buildbot-test-vc-1") + p = os.path.abspath(p) if os.path.exists(os.path.join(p, "README")): self.RepositoryPath = p # some of them take a file: URI From warner at users.sourceforge.net Sun Apr 17 10:50:03 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 17 Apr 2005 10:50:03 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.50,1.51 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1926/buildbot/status Modified Files: html.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-38 Creator: Brian Warner fix memory leak involving buildbot.status.html.TextLog Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- html.py 1 Feb 2005 08:36:45 -0000 1.50 +++ html.py 17 Apr 2005 10:50:00 -0000 1.51 @@ -610,6 +610,9 @@ self.req.finish() except pb.DeadReferenceError: pass + # break the cycle, the Request's .notifications list includes the + # Deferred (from req.notifyFinish) that's pointing at us. + self.req = None components.registerAdapter(TextLog, interfaces.IStatusLog, IHTMLLog) From warner at users.sourceforge.net Sun Apr 17 10:50:03 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 17 Apr 2005 10:50:03 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.349,1.350 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1926 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-38 Creator: Brian Warner fix memory leak involving buildbot.status.html.TextLog Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.349 retrieving revision 1.350 diff -u -d -r1.349 -r1.350 --- ChangeLog 12 Apr 2005 00:28:45 -0000 1.349 +++ ChangeLog 17 Apr 2005 10:50:01 -0000 1.350 @@ -1,3 +1,11 @@ +2005-04-17 Brian Warner + + * buildbot/status/html.py (TextLog.finished): null out self.req + when we're done, otherwise the reference cycle of TextLog to .req + to .notifications to a Deferred to TextLog.stop keeps them from + being collected, and consumes a huge (610MB on pyramid at last + check) amount of memory. + 2005-04-11 Brian Warner * buildbot/test/test_vc.py (VCSupport.__init__): use abspath() to From warner at users.sourceforge.net Sun Apr 17 12:17:53 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 17 Apr 2005 12:17:53 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.350,1.351 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18508 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-40 Creator: Brian Warner accomodate Twisted split, setup.py now takes a sub-project name Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.350 retrieving revision 1.351 diff -u -d -r1.350 -r1.351 --- ChangeLog 17 Apr 2005 10:50:01 -0000 1.350 +++ ChangeLog 17 Apr 2005 12:17:48 -0000 1.351 @@ -1,5 +1,12 @@ 2005-04-17 Brian Warner + * buildbot/process/process_twisted.py (QuickTwistedBuildFactory): + update compile command to accomodate the Twisted split.. now + instead of './setup.py build_ext -i', you do './setup.py all + build_ext -i', to run build_ext over all sub-projects. + (FullTwistedBuildFactory): same + (TwistedReactorsBuildFactory): same + * buildbot/status/html.py (TextLog.finished): null out self.req when we're done, otherwise the reference cycle of TextLog to .req to .notifications to a Deferred to TextLog.stop keeps them from From warner at users.sourceforge.net Sun Apr 17 12:17:53 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 17 Apr 2005 12:17:53 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process process_twisted.py,1.35,1.36 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18508/buildbot/process Modified Files: process_twisted.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-40 Creator: Brian Warner accomodate Twisted split, setup.py now takes a sub-project name Index: process_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/process_twisted.py,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- process_twisted.py 15 Nov 2004 09:26:29 -0000 1.35 +++ process_twisted.py 17 Apr 2005 12:17:51 -0000 1.36 @@ -47,7 +47,7 @@ self.steps.append(s(HLint, python=python[0])) self.steps.append(s(RemovePYCs)) for p in python: - cmd = "%s setup.py build_ext -i" % p + cmd = [p, "setup.py", "all", "build_ext", "-i"] self.steps.append(s(step.Compile, command=cmd, flunkOnFailure=True)) self.steps.append(s(TwistedTrial, @@ -70,7 +70,7 @@ python = [python] assert type(compileOpts) is list assert type(compileOpts2) is list - cmd = (python + compileOpts + ["setup.py", "build_ext"] + cmd = (python + compileOpts + ["setup.py", "all", "build_ext"] + compileOpts2 + ["-i"]) self.steps.append(s(step.Compile, command=cmd, flunkOnFailure=True)) @@ -100,7 +100,7 @@ python = [python] assert type(compileOpts) is list assert type(compileOpts2) is list - cmd = (python + compileOpts + ["setup.py", "build_ext"] + cmd = (python + compileOpts + ["setup.py", "all", "build_ext"] + compileOpts2 + ["-i"]) self.steps.append(s(step.Compile, command=cmd, warnOnFailure=True)) From warner at users.sourceforge.net Mon Apr 18 00:26:58 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 18 Apr 2005 00:26:58 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave bot.py,1.9,1.10 commands.py,1.21,1.22 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8250/buildbot/slave Modified Files: bot.py commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-42 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-6] Merge epydoc changes from Thomas, add some hacks of my own. No code changes to the buildbot itself, although I hacked docs/epyrun a bit. Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- bot.py 11 Apr 2005 19:30:28 -0000 1.9 +++ bot.py 18 Apr 2005 00:26:56 -0000 1.10 @@ -114,8 +114,13 @@ log.msg("startBuild") def remote_startCommand(self, stepref, stepId, command, args): - """This is called multiple times by various master-side BuildSteps, - to start various commands that actually do the build.""" + """ + This gets invoked by L{buildbot.process.step.RemoteCommand.start}, as + part of various master-side BuildSteps, to start various commands + that actually do the build. I return nothing. Eventually I will call + .commandComplete() to notify the master-side RemoteCommand that I'm + done. + """ self.activity() @@ -162,13 +167,14 @@ self.command.interrupt() # die! self.command = None # forget you! - # sendUpdate is invoked by the Commands we spawn def sendUpdate(self, data): - """This sends the status update to the master-side BuildStep object, - giving it a sequence number in the process. It adds the update to - a queue, and asks the master to acknowledge the update so it can be - removed from that queue.""" + """This sends the status update to the master-side + L{buildbot.process.step.RemoteCommand} object, giving it a sequence + number in the process. It adds the update to a queue, and asks the + master to acknowledge the update so it can be removed from that + queue.""" + if not self.running: # .running comes from service.Service, and says whether the # service is running or not. If we aren't running, don't send any Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- commands.py 11 Apr 2005 19:30:28 -0000 1.21 +++ commands.py 18 Apr 2005 00:26:56 -0000 1.22 @@ -422,6 +422,11 @@ class DummyCommand(Command): + """ + I am a dummy no-op command that by default takes 5 seconds to complete. + See L{buildbot.process.step.RemoteDummy} + """ + def start(self): self.d = defer.Deferred() log.msg(" starting dummy command [%s]" % self.stepId) From warner at users.sourceforge.net Mon Apr 18 00:26:59 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 18 Apr 2005 00:26:59 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes changes.py,1.17,1.18 p4poller.py,1.2,1.3 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8250/buildbot/changes Modified Files: changes.py p4poller.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-42 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-6] Merge epydoc changes from Thomas, add some hacks of my own. No code changes to the buildbot itself, although I hacked docs/epyrun a bit. Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/changes.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- changes.py 30 Sep 2004 23:03:52 -0000 1.17 +++ changes.py 18 Apr 2005 00:26:57 -0000 1.18 @@ -144,14 +144,16 @@ They are expected to call self.changemaster.addChange() with Change objects. - There are several different variants of the second type of source. + There are several different variants of the second type of source: - MaildirSource watches a maildir for CVS commit mail. It uses DNotify if - available, or polls every 10 seconds if not. It parses incoming mail to - determine what files were changed. + - L{buildbot.changes.mail.MaildirSource} watches a maildir for CVS + commit mail. It uses DNotify if available, or polls every 10 + seconds if not. It parses incoming mail to determine what files + were changed. - FreshCVSSource makes a PB connection to the CVSToys 'freshcvs' daemon - and relays any changes it announces. + - L{buildbot.changes.freshcvs.FreshCVSSource} makes a PB + connection to the CVSToys 'freshcvs' daemon and relays any + changes it announces. """ Index: p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/p4poller.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- p4poller.py 7 Sep 2004 01:19:09 -0000 1.2 +++ p4poller.py 18 Apr 2005 00:26:57 -0000 1.3 @@ -13,21 +13,7 @@ class P4Source(service.Service, util.ComparableMixin): """This source will poll a perforce repository for changes and submit - them to the change master. - - @param p4port: p4 port definition (host:portno) - - @param p4user: p4 user - - @param p4client: name of p4 client to poll - - @param p4base: p4 file specification to limit a poll to (i.e., //...) - - - @param p4path: path to p4 binary, defaults to just 'p4' - @param pollinterval: interval in seconds between polls - @param histmax: maximum number of changes to look back through - """ + them to the change master.""" __implements__ = IChangeSource, service.Service.__implements__ compare_attrs = ["p4port", "p4user", "p4client", "p4base", @@ -40,6 +26,24 @@ def __init__(self, p4port, p4user, p4client, p4base, p4bin='p4', pollinterval=60 * 10, histmax=100): + """ + @type p4port: string + @param p4port: p4 port definition (host:portno) + @type p4user: string + @param p4user: p4 user + @type p4client: string + @param p4client: name of p4 client to poll + @type p4base: string + @param p4base: p4 file specification to limit a poll to + (i.e., //...) + @type p4bin: string + @param p4bin: path to p4 binary, defaults to just 'p4' + @type pollinterval: int + @param pollinterval: interval in seconds between polls + @type histmax: int + @param histmax: maximum number of changes to look back through + """ + self.p4port = p4port self.p4user = p4user self.p4client = p4client From warner at users.sourceforge.net Mon Apr 18 00:26:58 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 18 Apr 2005 00:26:58 +0000 Subject: [Buildbot-commits] buildbot/buildbot interfaces.py,1.21,1.22 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8250/buildbot Modified Files: interfaces.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-42 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-6] Merge epydoc changes from Thomas, add some hacks of my own. No code changes to the buildbot itself, although I hacked docs/epyrun a bit. Index: interfaces.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- interfaces.py 3 Dec 2004 22:54:50 -0000 1.21 +++ interfaces.py 18 Apr 2005 00:26:56 -0000 1.22 @@ -17,9 +17,9 @@ """Object which feeds Change objects to the changemaster. When files or directories are changed and the version control system provides some kind of notification, this object should turn it into a Change object - and pass it through: + and pass it through:: - self.changemaster.addChange(change) + self.changemaster.addChange(change) """ def start(self): @@ -433,9 +433,9 @@ These names are not guaranteed to be unique, however they are usually chosen to be useful within the scope of a single step (i.e. the Compile step might produce both 'log' and 'warnings'). The name may also have - spaces. If you want something more globally meaningful, try: + spaces. If you want something more globally meaningful, try:: - '%s.%s' % (log.getStep.getName(), log.getName()) + '%s.%s' % (log.getStep.getName(), log.getName()) The Log can be represented as plain text, or it can be accessed as a list of items, each of which has a channel indicator (header, stdout, From warner at users.sourceforge.net Mon Apr 18 00:27:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 18 Apr 2005 00:27:00 +0000 Subject: [Buildbot-commits] buildbot/docs epyrun,1.1,1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8250/docs Modified Files: epyrun Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-42 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-6] Merge epydoc changes from Thomas, add some hacks of my own. No code changes to the buildbot itself, although I hacked docs/epyrun a bit. Index: epyrun =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/epyrun,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- epyrun 11 Apr 2005 19:30:30 -0000 1.1 +++ epyrun 18 Apr 2005 00:26:58 -0000 1.2 @@ -106,10 +106,10 @@ try: #print 'pre-loading', modName reflect.namedModule(modName) - except ImportError: - print 'import error:', modName - except: - print 'other error:', modName + except ImportError, e: + print 'import error:', modName, e + except Exception, e: + print 'other error:', modName, e else: modnames.append(modName) From warner at users.sourceforge.net Mon Apr 18 00:27:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 18 Apr 2005 00:27:00 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.351,1.352 Makefile,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8250 Modified Files: ChangeLog Makefile Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-42 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-6] Merge epydoc changes from Thomas, add some hacks of my own. No code changes to the buildbot itself, although I hacked docs/epyrun a bit. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.351 retrieving revision 1.352 diff -u -d -r1.351 -r1.352 --- ChangeLog 17 Apr 2005 12:17:48 -0000 1.351 +++ ChangeLog 18 Apr 2005 00:26:57 -0000 1.352 @@ -1,5 +1,45 @@ 2005-04-17 Brian Warner + * docs/epyrun (addMod): when an import fails, say why + + * Makefile: Add a 'docs' target, hack on the PYTHONPATH stuff + +2005-04-17 Thomas Vander Stichele + + * buildbot/process/base.py: + * buildbot/process/builder.py: + * buildbot/status/builder.py: + new documentation while digging through the code + +2005-04-17 Thomas Vander Stichele + + * buildbot/changes/changes.py: + * buildbot/changes/p4poller.py: + * buildbot/interfaces.py: + * buildbot/process/base.py: + * buildbot/process/builder.py: + * buildbot/process/step.py: + * buildbot/process/step_twisted.py: + * buildbot/slave/bot.py: + * buildbot/slave/commands.py: + * buildbot/status/builder.py: + fix all docstrings to make epydoc happy. In the process of fixing + some, I also moved pieces of docs, and removed some deprecated + documentation + +2005-04-17 Thomas Vander Stichele + + * buildbot/process/builder.py: + * buildbot/process/interlock.py: + * buildbot/process/process_twisted.py: + * buildbot/process/step.py: + BuildProcess -> Build, as it looks like that's what happened + * buildbot/process/base.py: + * buildbot/process/factory.py: + update epydoc stuff + +2005-04-17 Brian Warner + * buildbot/process/process_twisted.py (QuickTwistedBuildFactory): update compile command to accomodate the Twisted split.. now instead of './setup.py build_ext -i', you do './setup.py all Index: Makefile =================================================================== RCS file: /cvsroot/buildbot/buildbot/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 23 Nov 2004 10:55:21 -0000 1.4 +++ Makefile 18 Apr 2005 00:26:57 -0000 1.5 @@ -4,10 +4,11 @@ BBBASE = ~/stuff/Projects/BuildBot/sourceforge ifdef SVN -PP = PYTHONPATH=$(BBBASE):~/stuff/python/twisted/Twisted-SVN +T=~/stuff/python/twisted/Twisted else -PP = PYTHONPATH=$(BBBASE) +T= endif +PP = PYTHONPATH=$(BBBASE):$(T) .PHONY: test TRIALARGS=-v @@ -25,6 +26,9 @@ "snapshot build" debuild binary +.PHONY: docs +docs: + PYTHONPATH=.:$(T) docs/epyrun -o docs/reference release: python ./setup.py clean From warner at users.sourceforge.net Mon Apr 18 00:27:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 18 Apr 2005 00:27:00 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py,1.47,1.48 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8250/buildbot/status Modified Files: builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-42 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-6] Merge epydoc changes from Thomas, add some hacks of my own. No code changes to the buildbot itself, although I hacked docs/epyrun a bit. Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- builder.py 1 Apr 2005 01:01:12 -0000 1.47 +++ builder.py 18 Apr 2005 00:26:58 -0000 1.48 @@ -287,6 +287,24 @@ class BuildStepStatus: + """ + I represent a collection of output status for a + L{buildbot.process.step.BuildStep}. + + @type color: string + @cvar color: color that this step feels best represents its + current mood. yellow,green,red,orange are the + most likely choices, although purple indicates + an exception + @type progress: L{buildbot.status.progress.StepProgress} + @cvar progress: tracks ETA for the step + @type text: list of strings + @cvar text: list of short texts that describe the command and its status + @type text2: list of strings + @cvar text2: list of short texts added to the overall build description + @type logs: dict of string -> L{buildbot.status.builder.LogFile} + @ivar logs: logs of steps + """ # note that these are created when the Build is set up, before each # corresponding BuildStep has started. __implements__ = interfaces.IBuildStepStatus, interfaces.IStatusEvent @@ -376,13 +394,18 @@ return self.color def getResults(self): - """Return a tuple describing the results of the step: (result, - strings). 'result' is one of the constants in buildbot.status.builder: - SUCCESS, WARNINGS, FAILURE, or SKIPPED. 'strings' is an optional - list of strings that the step wants to append to the overall build's - results. These strings are usually more terse than the ones returned - by getText(): in particular, successful Steps do not usually - contribute any text to the overall build.""" + """Return a tuple describing the results of the step. + 'result' is one of the constants in L{buildbot.status.builder}: + SUCCESS, WARNINGS, FAILURE, or SKIPPED. + 'strings' is an optional list of strings that the step wants to + append to the overall build's results. These strings are usually + more terse than the ones returned by getText(): in particular, + successful Steps do not usually contribute any text to the + overall build. + + @rtype: tuple of int, list of strings + @returns: (result, strings) + """ return (self.results, self.text2) # subscription interface @@ -1388,6 +1411,9 @@ builder_status.subscribe(t) def builderAdded(self, name, basedir): + """ + @rtype: L{BuilderStatus} + """ filename = os.path.join(self.basedir, basedir, "builder") log.msg("trying to load status pickle from %s" % filename) builder_status = None From warner at users.sourceforge.net Mon Apr 18 00:34:46 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 18 Apr 2005 00:34:46 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.352,1.353 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11884 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-44 Creator: Brian Warner try to fix file modes on all .py files Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.352 retrieving revision 1.353 diff -u -d -r1.352 -r1.353 --- ChangeLog 18 Apr 2005 00:26:57 -0000 1.352 +++ ChangeLog 18 Apr 2005 00:34:44 -0000 1.353 @@ -1,5 +1,8 @@ 2005-04-17 Brian Warner + * general: try to fix file modes on all .py files: a+r, a-x, + but let buildbot/clients/*.py be +x since they're tools + * docs/epyrun (addMod): when an import fails, say why * Makefile: Add a 'docs' target, hack on the PYTHONPATH stuff From warner at users.sourceforge.net Mon Apr 18 00:26:59 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 18 Apr 2005 00:26:59 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process factory.py,1.7,1.8 step.py,1.60,1.61 base.py,1.44,1.45 interlock.py,1.4,1.5 builder.py,1.21,1.22 process_twisted.py,1.36,1.37 step_twisted.py,1.66,1.67 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8250/buildbot/process Modified Files: factory.py step.py base.py interlock.py builder.py process_twisted.py step_twisted.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-42 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-6] Merge epydoc changes from Thomas, add some hacks of my own. No code changes to the buildbot itself, although I hacked docs/epyrun a bit. Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- base.py 3 Dec 2004 22:54:51 -0000 1.44 +++ base.py 18 Apr 2005 00:26:56 -0000 1.45 @@ -19,6 +19,19 @@ use subclasses of Build to hold status information unique to those build processes. + I am responsible for two things: + 1. deciding B{when} a build should occur. This involves knowing + which file changes to ignore (documentation or comments files, + for example), and deciding how long to wait for the tree to + become stable before starting. The base class pays attention + to all files, and waits 10 seconds for a stable tree. + + 2. controlling B{how} the build proceeds. The actual build is + broken up into a series of steps, saved in the .buildSteps[] + array as a list of L{buildbot.process.step.BuildStep} + objects. Each step is a single remote command, possibly a shell + command. + Before the build is started, I accumulate Changes and track the tree-stable timers and interlocks necessary to decide when I ought to start building. @@ -28,7 +41,11 @@ After the build, I hold historical data about the build, like how long it took, tree size, lines of code, etc. It is expected to be used to generate graphs and quantify long-term trends. It does not hold any - status events or build logs.""" + status events or build logs. + + I can be used by a factory by setting buildClass on + L{buildbot.process.factory.BuildFactory} + """ treeStableTimer = 10 #*60 workdir = "build" @@ -54,6 +71,11 @@ self.currentStep = None def setBuilder(self, builder): + """ + Set the given builder as our builder. + + @type builder: L{buildbot.process.builder.Builder} + """ self.builder = builder def setSourceStamp(self, baserev, patch, reason="try"): @@ -62,12 +84,24 @@ self.reason = reason def isFileImportant(self, filename): - """I return 1 if the given file is important enough to trigger a - rebuild, 0 if it should be ignored. Override me to ignore unimporant - files: documentation, .cvsignore files, etc. The timer is not - restarted,, so a checkout may occur in the middle of a set of - changes marked 'unimportant'. Also, the checkout may or may not pick - up the 'unimportant' changes.""" + """ + I check if the given file is important enough to trigger a rebuild. + + Override me to ignore unimporant files: documentation, .cvsignore + files, etc. + + The timer is not restarted, so a checkout may occur in the middle of + a set of changes marked 'unimportant'. Also, the checkout may or may + not pick up the 'unimportant' changes. The implicit assumption is + that any file marked 'unimportant' is incapable of affecting the + results of the build. + + @param filename: name of a file to check, relative to the VC base + @type filename: string + + @rtype: 0 or 1 + @returns: whether the change to this file should trigger a rebuild + """ return 1 def bumpMaxChangeNumber(self, change): @@ -75,7 +109,14 @@ self.maxChangeNumber = change.number if change.number > self.maxChangeNumber: self.maxChangeNumber = change.number + def addChange(self, change): + """ + Add the change, deciding if the change is important or not. + Called by L{buildbot.process.builder.filesChanged} + + @type change: L{buildbot.changes.changes.Change} + """ important = 0 for filename in change.files: if self.isFileImportant(filename): Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/builder.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- builder.py 9 Dec 2004 10:24:56 -0000 1.21 +++ builder.py 18 Apr 2005 00:26:56 -0000 1.22 @@ -12,36 +12,50 @@ class Builder(pb.Referenceable): - """This class defines how and when a given kind of build is performed. - Each Builder has an associated BuildProcess object. This class should be - subclassed by the user to define how their build ought to work. + """I manage all Builds of a given type. - The BuildProcess object is responsible for two things. The first is - deciding *when* a build ought to occur. This involves knowing which file - changes to ignore (documentation or comments files, for example), and - deciding how long to wait for the tree to become stable before starting. - The base class pays attention to all files, and waits 10 minutes for a - stable tree: + Each Builder is created by an entry in the config file (the c['builders'] + list), with a number of parameters. - .fileChanged(filename, when) is called when a file has been modified. + One of these parameters is the L{buildbot.process.factory.BuildFactory} + object that is associated with this Builder. The factory is responsible + for creating new L{Build} objects. Each + Build object defines when and how the build is performed, so a new + Factory or Builder should be defined to control this behavior. - .startBuild(when) should be called when the build should begin. The - build should use a tree checked out with a timestamp of 'when' to make - sure no partial commits are picked up. 'when' should be in the middle - of the 10-minute stable window. + The Builder holds on to a number of these Build + objects, in various slots like C{.waiting}, C{.interlocked}, + C{.buildable}, and C{.currentBuild}. Incoming + L{Change} objects are passed to the + C{.waiting} build, and when it decides it is ready to go, I move it to + the C{.buildable} slot. When a slave becomes available, I move it to the + C{.currentBuild} slot and start it running. - The second is controlling *how* the build proceeds. The actual build is - broken up into a series of steps, saved in the .buildSteps[] array as a - list of BuildStep objects. Each step is a single remote command, possibly - a shell command. + The Builder is also the master-side representative for one of the + L{buildbot.slave.bot.SlaveBuilder} objects that lives in a remote + buildbot. When a remote builder connects, I query it for command versions + and then make it available to any Builds that are ready to run. - """ + I also manage Interlocks, periodic build timers, forced builds, progress + expectation (ETA) management, and some status delivery chores. - """This is the master-side representative for one of the SlaveBuilder - objects that lives in a remote buildbot. Change notifications are - delivered to it with .fileChanged(), which influences the enclosed - BuildProcess state machine. When a remote builder is available, this - object sends it commands to be executed in the slave process.""" + @type waiting: L{buildbot.process.base.Build} + @ivar waiting: a slot for a Build waiting for its 'tree stable' timer to + expire + + @type interlocked: list of L{buildbot.process.base.Build} + @ivar interlocked: a slot for the Builds that are stable, but which must + wait for other Builds to complete successfully before + they can be run. + + @type buildable: L{buildbot.process.base.Build} + @ivar buildable: a slot for a Build that is stable and ready to build, + but which is waiting for a buildslave to be available. + + @type currentBuild: L{buildbot.process.base.Build} + @ivar currentBuild: a slot for the Build that actively running + + """ remote = None lastChange = None @@ -55,6 +69,13 @@ expectations = None # this is created the first time we get a good build def __init__(self, setup, builder_status): + """ + @type setup: dict + @param setup: builder setup data, as stored in + BuildmasterConfig['builders']. Contains name, + slavename, builddir, factory. + @type builder_status: L{buildbot.status.builder.BuilderStatus} + """ self.name = setup['name'] self.slavename = setup['slavename'] self.builddir = setup['builddir'] @@ -93,6 +114,12 @@ return diffs def newBuild(self): + """ + Create a new build from our build factory and set ourself as the + builder. + + @rtype: L{buildbot.process.base.Build} + """ b = self.buildFactory.newBuild() b.setBuilder(self) return b @@ -222,6 +249,12 @@ self.builder_status.currentlyOffline() def filesChanged(self, change): + """ + Tell the waiting L{buildbot.process.base.Build} that files have + changed. + + @type change: L{buildbot.changes.changes.Change} + """ # this is invoked by the BotMaster to distribute change notification # we assume they are added in strictly increasing order if not self.waiting: Index: factory.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/factory.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- factory.py 23 Nov 2004 04:03:25 -0000 1.7 +++ factory.py 18 Apr 2005 00:26:56 -0000 1.8 @@ -10,6 +10,10 @@ return (steptype, kwargs) class BuildFactory(util.ComparableMixin): + """ + @cvar buildClass: class to use when creating builds + @type buildClass: L{buildbot.process.base.Build} + """ buildClass = Build treeStableTimer = None steps = [] Index: interlock.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/interlock.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- interlock.py 25 Sep 2003 19:09:48 -0000 1.4 +++ interlock.py 18 Apr 2005 00:26:56 -0000 1.5 @@ -19,7 +19,7 @@ self.feeders = {} for n in feeders: self.feeders[n] = (None, 0) - # feeders.keys are .names of BuildProcess objects that we watch + # feeders.keys are .names of Build objects that we watch # feeders.values are Change numbers that have been successfully built self.watchers = {} # watchers.keys are Change numbers that a builder cares about Index: process_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/process_twisted.py,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- process_twisted.py 17 Apr 2005 12:17:51 -0000 1.36 +++ process_twisted.py 18 Apr 2005 00:26:56 -0000 1.37 @@ -1,6 +1,6 @@ #! /usr/bin/python -# BuildProcesses specific to the Twisted codebase +# Build classes specific to the Twisted codebase from buildbot.process.base import Build from buildbot.process.factory import BuildFactory, s Index: step.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- step.py 12 Apr 2005 00:28:30 -0000 1.60 +++ step.py 18 Apr 2005 00:26:56 -0000 1.61 @@ -13,30 +13,52 @@ from buildbot.status import progress, builder from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, SKIPPED -class RemoteCommand(pb.Referenceable): +""" +BuildStep and RemoteCommand classes for master-side representation of the +build process +""" - """This base class represents a single command to be run on the slave. It - handles the details of reliably gathering status updates from the slave - (acknowledging each), and (eventually) recovering from interrupted - builds. +class RemoteCommand(pb.Referenceable): + """ + I represent a single command to be run on the slave. I handle the details + of reliably gathering status updates from the slave (acknowledging each), + and (eventually, in a future release) recovering from interrupted builds. + This is the master-side object that is known to the slave-side + L{buildbot.slave.bot.SlaveBuilder}, to which status update are sent. - The command should be started by calling .run(), which returns a Deferred - that will fire when the command has finished, or will errback if an - exception is raised. Typically __init__ or run() will set up - self.remote_command to be a string which corresponds to one of the - SlaveCommands registered in the buildslave, and self.args to a dictionary - of arguments that will be passed to the SlaveCommand instance. + My command should be started by calling .run(), which returns a + Deferred that will fire when the command has finished, or will + errback if an exception is raised. + + Typically __init__ or run() will set up self.remote_command to be a + string which corresponds to one of the SlaveCommands registered in + the buildslave, and self.args to a dictionary of arguments that will + be passed to the SlaveCommand instance. start, remoteUpdate, and remoteComplete are available to be overridden + @type commandCounter: list of one int + @cvar commandCounter: provides a unique value for each + RemoteCommand executed across all slaves + @type active: boolean + @cvar active: whether the command is currently running """ - - # this counter provides a unique value for each RemoteCommand executed - # across all slaves. It is a class attribute. - commandCounter = [0] + commandCounter = [0] # we use a list as a poor man's singleton active = False def __init__(self, remote_command, args): + """ + @type remote_command: string + @param remote_command: remote command to start. This will be + passed to + L{buildbot.slave.bot.SlaveBuilder.remote_startCommand} + and needs to have been registered + slave-side by + L{buildbot.slave.registry.registerSlaveCommand} + @type args: dict + @param args: arguments to send to the remote command + """ + self.remote_command = remote_command self.args = args @@ -74,6 +96,14 @@ return self.deferred def start(self): + """ + Tell the slave to start executing the remote command. + + @rtype: L{twisted.internet.defer.Deferred} + @returns: a deferred that will fire when the remote command is + done (with None as the result) + """ + # This method only initiates the remote command. # We will receive remote_update messages as the command runs. # We will get a single remote_complete when it finishes. # We should fire self.deferred when the command is done. @@ -115,6 +145,13 @@ return None def remote_update(self, updates): + """ + I am called by the slave's L{buildbot.slave.bot.SlaveBuilder} so + I can receive updates from the running remote command. + + @type updates: list of [object, int] + @param updates: list of updates from the remote command + """ max_updatenum = 0 for (update, num) in updates: #log.msg("update[%d]:" % num) @@ -134,6 +171,14 @@ raise NotImplementedError("You must implement this in a subclass") def remote_complete(self, failure=None): + """ + Called by the slave's L{buildbot.slave.bot.SlaveBuilder} to + notify me the remote command has finished. + + @type failure: L{twisted.python.failure.Failure} or None + + @rtype: None + """ # call the real remoteComplete a moment later, but first return an # acknowledgement so the slave can retire the completion message. if self.active: @@ -151,6 +196,8 @@ # arrange for the callback to get this RemoteCommand instance # instead of just None d.addCallback(lambda r: self) + # this fires the original deferred we returned from .run(), + # with self as the result, or a failure d.addBoth(self.deferred.callback) def remoteComplete(self, maybeFailure): @@ -160,32 +207,32 @@ will be None if the command completed normally, or a Failure instance in one of the following situations: - # the slave was lost before the command was started - # the slave didn't respond to the startCommand message - # the slave raised an exception while starting the command - # (bad command name, bad args, OSError from missing executable) - # the slave raised an exception while finishing the command - # (they send back a remote_complete message with a Failure payload) - # and also (for now): - # slave disconnected while the command was running + - the slave was lost before the command was started + - the slave didn't respond to the startCommand message + - the slave raised an exception while starting the command + (bad command name, bad args, OSError from missing executable) + - the slave raised an exception while finishing the command + (they send back a remote_complete message with a Failure payload) + + and also (for now): + - slave disconnected while the command was running This method should do cleanup, like closing log files. It should normally return the 'failure' argument, so that any exceptions will be propagated to the Step. If it wants to consume them, return None instead.""" - return failure + return maybeFailure class LoggedRemoteCommand(RemoteCommand): - """This is a RemoteCommand which expects the slave to send back - stdout/stderr/rc updates. It gathers these updates into a - builder.LogFile named self.log . You can give it a LogFile to use by - calling useLog(), or it will create its own when the command is started. - Unless you tell it otherwise, it will close the log when the command is - complete. - - The constructor takes an 'args' parameter which is a dictionary of - arguments to send to the remote command.""" + """ + I am a L{RemoteCommand} which expects the slave to send back + stdout/stderr/rc updates. I gather these updates into a + L{buildbot.status.builder.LogFile} named C{self.log}. You can give me a + LogFile to use by calling useLog(), or I will create my own when the + command is started. Unless you tell me otherwise, I will close the log + when the command is complete. + """ log = None closeWhenFinished = False @@ -237,39 +284,50 @@ """This class helps you run a shell command on the build slave. It will accumulate all the command's output into a Log. When the command is finished, it will fire a Deferred. You can then check the results of the - command and parse the output however you like. - - @param workdir: the directory where the command ought to run, relative to - the Builder's home directory. If missing or 'None', it will default to - '.': the same as the Builder's homedir. This should probably be '.' for - the initial 'cvs checkout' command (which creates a workdir), and the - workdir for all subsequent commands (including compiles and 'cvs - update'). - - @param command: the shell command to run, like 'make all' or 'cvs - update'. This should be a list or tuple which can be used directly as the - argv array. For backwards compatibility, if this is a string, the text - will be given to '/bin/sh -c %s'. + command and parse the output however you like.""" - @param env: a dict of environment variables to add or change, or None - to leave the slave's environment alone. Each command gets a separate - environment; all inherit the slave's initial one. - TODO: make it possible to delete some or all of the slave's environment. + def __init__(self, workdir, command, env=None, + want_stdout=1, want_stderr=1, + timeout=20*60, **kwargs): + """ + @type workdir: string + @param workdir: directory where the command ought to run, + relative to the Builder's home directory. Defaults to + '.': the same as the Builder's homedir. This should + probably be '.' for the initial 'cvs checkout' + command (which creates a workdir), and the Build-wide + workdir for all subsequent commands (including + compiles and 'cvs update'). - @param want_stdout: defaults to 1. Set to 0 if stdout should be thrown - away. Do this to avoid storing or sending large amounts of useless data. + @type command: list of strings (or string) + @param command: the shell command to run, like 'make all' or + 'cvs update'. This should be a list or tuple + which can be used directly as the argv array. + For backwards compatibility, if this is a + string, the text will be given to '/bin/sh -c + %s'. - @param want_stderr: Set to 0 if stderr should be thrown away. + @type env: dict of string->string + @param env: environment variables to add or change for the + slave. Each command gets a separate + environment; all inherit the slave's initial + one. TODO: make it possible to delete some or + all of the slave's environment. - @param timeout: tell the remote that if the command fails to produce any - output for this number of seconds, the command is hung and should be - killed. Use None to disable the timeout. + @type want_stdout: bool + @param want_stdout: defaults to True. Set to False if stdout should + be thrown away. Do this to avoid storing or + sending large amounts of useless data. - """ + @type want_stderr: bool + @param want_stderr: False if stderr should be thrown away - def __init__(self, workdir, command, env=None, - want_stdout=1, want_stderr=1, - timeout=20*60, **kwargs): + @type timeout: int + @param timeout: tell the remote that if the command fails to + produce any output for this number of seconds, + the command is hung and should be killed. Use + None to disable the timeout. + """ self.command = command # stash .command, set it later if env is not None: # avoid mutating the original master.cfg dictionary. Each @@ -299,15 +357,16 @@ def __repr__(self): return "" % self.command - - class BuildStep: - """This class represents a single step of the build process. This step - may involve multiple commands to be run in the build slave, as well as - arbitrary processing on the master side. + """ + I represent a single step of the build process. This step may involve + zero or more commands to be run in the build slave, as well as arbitrary + processing on the master side. Regardless of how many slave commands are + run, the BuildStep will result in a single status value. The step is started by calling startStep(), which returns a Deferred that - fires when the step finishes. + fires when the step finishes. See C{startStep} for a description of the + results provided by that Deferred. __init__ and start are good methods to override. Don't forget to upcall BuildStep.__init__ or bad things will happen. @@ -315,20 +374,22 @@ To launch a RemoteCommand, pass it to .runCommand and wait on the Deferred it returns. - Each BuildStep has a collection of output status. These will all be put - into the 'step_status' (a BuildStepStatus instance). 'results' is also - passed to the first callback of the Deferred that is returned by - .startStep(): + Each BuildStep generates status as it runs. This status data is fed to + the L{buildbot.status.builder.BuildStepStatus} listener that sits in + C{self.step_status}. It can also feed progress data (like how much text + is output by a shell command) to the + L{buildbot.status.progress.StepProgress} object that lives in + C{self.progress}, by calling C{progress.setProgress(metric, value)} as it + runs. - results: this is one of SUCCESS/WARNINGS/FAILURE/SKIPPED - progress: a StepProgress instance, which tracks ETA - logs={}: a set of named status.builder.LogFile objects, holding text - color: a string indicating the color that this step feels best - represents its current mood. yellow,green,red,orange are the - most likely choices, although purple indicates an exception - text=[]: short text strings that describe the command and its status - text2=[]: short text that is added to the overall build description + @type build: L{buildbot.process.base.Build} + @ivar build: the parent Build which is executing this step + @type progress: L{buildbot.status.progress.StepProgress} + @ivar progress: tracks ETA for the step + + @type step_status: L{buildbot.status.builder.BuildStepStatus} + @ivar step_status: collects output status """ # these parameters are used by the parent Build object to decide how to @@ -380,15 +441,29 @@ return None def startStep(self, remote): - """Begin the step. This returns a Deferred that will fire with a - constant of: SUCCESS, WARNINGS, FAILURE, SKIPPED. Any other status - can be read out of our attributes. + """Begin the step. This returns a Deferred that will fire when the + step finishes. - 'status' is a BuildStepStatus object to which I will send status - updates. 'progress' is a StepProgress object: I will call - progress.setProgress(metric, value) as I work. 'remote' is a - RemoteReference to a buildslave that will execute any RemoteCommands - I want to run.""" + This deferred fires with a tuple of (result, [extra text]), although + older steps used to return just the 'result' value, so the receiving + L{base.Build} needs to be prepared to handle that too. C{result} is + one of the SUCCESS/WARNINGS/FAILURE/SKIPPED constants from + L{buildbot.status.builder}, and the extra text is a list of short + strings which should be appended to the Build's text results. This + text allows a test-case step which fails to append B{17 tests} to the + Build's status, in addition to marking the build as failing. + + The deferred will errback if the step encounters an exception, + including an exception on the slave side (or if the slave goes away + altogether). Failures in shell commands (rc!=0) will B{not} cause an + errback, in general the BuildStep will evaluate the results and + decide whether to treat it as a WARNING or FAILURE. + + @type remote: L{twisted.spread.pb.RemoteReference} + @param remote: a reference to the slave's + L{buildbot.slave.bot.SlaveBuilder} instance where any + RemoteCommands may be run + """ self.remote = remote self.deferred = defer.Deferred() @@ -405,39 +480,40 @@ return self.deferred def start(self): - """Begin the step. Add code here to do local processing, fire off - remote commands, etc. + """Begin the step. Override this method and add code to do local + processing, fire off remote commands, etc. To spawn a command in the buildslave, create a RemoteCommand instance - and run it with self.runCommand: + and run it with self.runCommand:: - c = RemoteCommandFoo(args) - d = self.runCommand(c) - d.addCallback(self.fooDone).addErrback(self.failed) + c = RemoteCommandFoo(args) + d = self.runCommand(c) + d.addCallback(self.fooDone).addErrback(self.failed) As the step runs, it should send status information to the - BuildStepStatus. + BuildStepStatus:: - self.step_status.setColor('red') - self.step_status.setText(['compile', 'failed']) - self.step_status.setText2(['4', 'warnings']) + self.step_status.setColor('red') + self.step_status.setText(['compile', 'failed']) + self.step_status.setText2(['4', 'warnings']) To add a LogFile, use self.addLog. Make sure it gets closed when it finishes. When giving a Logfile to a RemoteShellCommand, just ask it - to close the log when the command completes: + to close the log when the command completes:: - log = self.addLog('output') - cmd = RemoteShellCommand - cmd.useLog(log, closeWhenFinished=True) + log = self.addLog('output') + cmd = RemoteShellCommand(args) + cmd.useLog(log, closeWhenFinished=True) You can also create complete Logfiles with generated text in a single - step: + step:: - self.addCompleteLog('warnings', text) + self.addCompleteLog('warnings', text) When the step is done, it should call self.finished(result). 'result' - will be provided to the BuildProcess, and should one of the constants - defined above: SUCCESS, WARNINGS, FAILURE, or SKIPPED. + will be provided to the L{buildbot.process.base.Build}, and should be + one of the constants defined above: SUCCESS, WARNINGS, FAILURE, or + SKIPPED. If the step encounters an exception, it should call self.failed(why). 'why' should be a Failure object. This automatically fails the whole @@ -518,7 +594,7 @@ class ShellCommand(BuildStep): """I run a single shell command on the buildslave. I return FAILURE if the exit code of that command is non-zero, SUCCESS otherwise. To change - this behavior, override my .commandFinished method. + this behavior, override my .evaluateCommand method. I create a single Log named 'log' which contains the output of the command. To create additional summary Logs, override my .createSummary @@ -526,12 +602,9 @@ The shell command I run (a list of argv strings) can be provided in several ways: - - a class-level .command attribute - - a command= parameter to my constructor (overrides .command) - - set explicitly with my .setCommand() method (overrides both) + - a class-level .command attribute + - a command= parameter to my constructor (overrides .command) + - set explicitly with my .setCommand() method (overrides both) """ @@ -559,16 +632,21 @@ self.cmd.command = command def describe(self, done=False): - """Return a list of short strings to describe this step. This uses - the first few words of the shell command. You can replace this by - setting .description in your subclass, or by overriding this method - to describe the step better. + """Return a list of short strings to describe this step, for the + status display. This uses the first few words of the shell command. + You can replace this by setting .description in your subclass, or by + overriding this method to describe the step better. - done=False is used to describe the step while it is running, so a - single imperfect-tense verb is appropriate ('compiling', 'testing', - etc). done=True is used when the step has finished, and the default - getText() method adds some text, so a noun is appropriate - ('compile', 'tests', etc).""" + @type done: boolean + @param done: whether the command is complete or not, to improve the + way the command is described. C{done=False} is used + while the command is still running, so a single + imperfect-tense verb is appropriate ('compiling', + 'testing', ...) C{done=True} is used when the command + has finished, and the default getText() method adds some + text, so a simple noun is appropriate ('compile', + 'tests' ...) + """ if done and self.descriptionDone is not None: return self.descriptionDone @@ -752,69 +830,83 @@ startVC(). The class as a whole builds up the self.args dictionary, then starts a LoggedRemoteCommand with those arguments. - @param workdir: a string giving the local directory (relative to the - Builder's root) where the tree should be placed. + """ - @param mode: a string describing the kind of VC operation that is - desired. + # if the checkout fails, there's no point in doing anything else + haltOnFailure = True + notReally = False - 'update' specifies that the checkout/update should be performed - directly into the workdir. Each build is performed in the same - directory, allowing for incremental builds. This minimizes disk space, - bandwidth, and CPU time. However, it may encounter problems if the - build process does not handle dependencies properly (if you must - sometimes do a 'clean build' to make sure everything gets compiled), or - if source files are deleted but generated files can influence test - behavior (e.g. python's .pyc files), or when source directories are - deleted but generated files prevent CVS from removing them. + def __init__(self, workdir, mode='update', alwaysUseLatest=False, + timeout=20*60, **kwargs): + """ + @type workdir: string + @param workdir: local directory (relative to the Builder's root) + where the tree should be placed - 'copy' specifies that the source-controlled workspace should be - maintained in a separate directory (called the 'copydir'), using - checkout or update as necessary. For each build, a new workdir is - created with a copy of the source tree (rm -rf workdir; cp -r copydir - workdir). This doubles the disk space required, but keeps the bandwidth - low (update instead of a full checkout). A full 'clean' build is - performed each time. This avoids any generated-file build problems, but - is still occasionally vulnerable to problems such as a CVS repository - being manually rearranged (causing CVS errors on update) which are not - an issue with a full checkout. + @type mode: string + @param mode: the kind of VC operation that is desired: + - 'update': specifies that the checkout/update should be + performed directly into the workdir. Each build is performed + in the same directory, allowing for incremental builds. This + minimizes disk space, bandwidth, and CPU time. However, it + may encounter problems if the build process does not handle + dependencies properly (if you must sometimes do a 'clean + build' to make sure everything gets compiled), or if source + files are deleted but generated files can influence test + behavior (e.g. python's .pyc files), or when source + directories are deleted but generated files prevent CVS from + removing them. - 'clobber' specifes that the working directory should be deleted each - time, necessitating a full checkout for each build. This insures a - clean build off a complete checkout, avoiding any of the problems - described above, but is bandwidth intensive, as the whole source tree - must be pulled down for each build. + - 'copy': specifies that the source-controlled workspace + should be maintained in a separate directory (called the + 'copydir'), using checkout or update as necessary. For each + build, a new workdir is created with a copy of the source + tree (rm -rf workdir; cp -r copydir workdir). This doubles + the disk space required, but keeps the bandwidth low + (update instead of a full checkout). A full 'clean' build + is performed each time. This avoids any generated-file + build problems, but is still occasionally vulnerable to + problems such as a CVS repository being manually rearranged + (causing CVS errors on update) which are not an issue with + a full checkout. - 'export' is like 'clobber', except that e.g. the 'cvs export' command - is used to create the working directory. This command removes all VC - metadata files (the CVS/.svn/{arch} directories) from the tree, which - is sometimes useful for creating source tarballs (to avoid including - the metadata in the tar file). Not all VC systems support export. + - 'clobber': specifies that the working directory should be + deleted each time, necessitating a full checkout for each + build. This insures a clean build off a complete checkout, + avoiding any of the problems described above, but is + bandwidth intensive, as the whole source tree must be + pulled down for each build. - @param alwaysUseLatest: normally the Source step asks its Build for a - list of all Changes that are supposed to go into the build, then - computes a 'source stamp' (revision number or timestamp) that will - cause exactly that set of changes to be present in the checked out - tree. This is turned into, e.g., 'cvs update -D timestamp', or 'svn - update -r revnum'. If alwaysUseLatest=True, bypass this computation and - always update to the latest available sources for each build. + - 'export': is like 'clobber', except that e.g. the 'cvs + export' command is used to create the working directory. + This command removes all VC metadata files (the + CVS/.svn/{arch} directories) from the tree, which is + sometimes useful for creating source tarballs (to avoid + including the metadata in the tar file). Not all VC systems + support export. - The source stamp helps avoid a race condition in which someone commits - a change after the master has decided to start a build but before the - slave finishes checking out the sources. At best this results in a - build which contains more changes than the buildmaster thinks it has - (possibly resulting in the wrong person taking the blame for any - problems that result), at worst is can result in an incoherent set of - sources (splitting a non-atomic commit) which may not build at all. + @type alwaysUseLatest: boolean + @param alwaysUseLatest: whether to always update to the most + recent available sources for this build. - """ + Normally the Source step asks its Build for a list of all + Changes that are supposed to go into the build, then computes a + 'source stamp' (revision number or timestamp) that will cause + exactly that set of changes to be present in the checked out + tree. This is turned into, e.g., 'cvs update -D timestamp', or + 'svn update -r revnum'. If alwaysUseLatest=True, bypass this + computation and always update to the latest available sources + for each build. - # if the checkout fails, there's no point in doing anything else - haltOnFailure = True - notReally = False + The source stamp helps avoid a race condition in which someone + commits a change after the master has decided to start a build + but before the slave finishes checking out the sources. At best + this results in a build which contains more changes than the + buildmaster thinks it has (possibly resulting in the wrong + person taking the blame for any problems that result), at worst + is can result in an incoherent set of sources (splitting a + non-atomic commit) which may not build at all. """ - def __init__(self, workdir, mode='update', alwaysUseLatest=False, - timeout=20*60, **kwargs): BuildStep.__init__(self, **kwargs) assert mode in ("update", "copy", "clobber", "export") self.args = {'mode': mode, @@ -868,38 +960,6 @@ class CVS(Source): """I do CVS checkout/update operations. - @param cvsroot (required): a string which describes the CVS Repository - from which the source tree should be obtained. '/home/warner/Repository' - for local or NFS-reachable repositories, ':pserver:anon at foo.com:/cvs' - for anonymous CVS, 'user at host.com:/cvs' for non-anonymous CVS or CVS - over ssh. Lots of possibilities, check the CVS documentation for more. - - @param cvsmodule (required): a string giving the subdirectory of the CVS - repository that should be retrieved. - - @param login: if not None, a string which will be provided as a password - to the 'cvs login' command, used when a :pserver: method is used to - access the repository. This login is only needed once, but must be run - each time (just before the CVS operation) because there is no way for - the buildslave to tell whether it was previously performed or not. - - @param branch: a string to be used in a '-r' argument to specify which - named branch of the source tree should be used for this checkout. - Defaults to 'HEAD'. - - @param checkoutDelay: if not None, the number of seconds to put between - the last known Change and the timestamp given to the -D argument. This - defaults to exactly half of the parent Build's .treeStableTimer, but it - could be set to something else if your CVS change notification has - particularly weird latency characteristics. - - @param global_options=[]: these arguments are inserted in the cvs - command line, before the 'checkout'/'update' command word. See 'cvs - --help-options' for a list of what may be accepted here. ['-r'] will - make the checked out files read only. ['-r', '-R'] will also assume the - repository is read-only (I assume this means it won't use locks to - insure atomic access to the ,v files). - Note: if you are doing anonymous/pserver CVS operations, you will need to manually do a 'cvs login' on each buildslave before the slave has any hope of success. XXX: fix then, take a cvs password as an argument and @@ -924,6 +984,56 @@ clobber=0, export=0, copydir=None, **kwargs): + """ + @type cvsroot: string + @param cvsroot: CVS Repository from which the source tree should + be obtained. '/home/warner/Repository' for local + or NFS-reachable repositories, + ':pserver:anon at foo.com:/cvs' for anonymous CVS, + 'user at host.com:/cvs' for non-anonymous CVS or + CVS over ssh. Lots of possibilities, check the + CVS documentation for more. + + @type cvsmodule: string + @param cvsmodule: subdirectory of CVS repository that should be + retrieved + + @type login: string or None + @param login: if not None, a string which will be provided as a + password to the 'cvs login' command, used when a + :pserver: method is used to access the repository. + This login is only needed once, but must be run + each time (just before the CVS operation) because + there is no way for the buildslave to tell whether + it was previously performed or not. + + @type branch: string + @param branch: a string to be used in a '-r' argument to specify + which named branch of the source tree should be + used for this checkout. Defaults to 'HEAD'. + + @type checkoutDelay: int or None + @param checkoutDelay: if not None, the number of seconds to put + between the last known Change and the + timestamp given to the -D argument. This + defaults to exactly half of the parent + Build's .treeStableTimer, but it could be + set to something else if your CVS change + notification has particularly weird + latency characteristics. + + @type global_options: list of strings + @param global_options: these arguments are inserted in the cvs + command line, before the + 'checkout'/'update' command word. See + 'cvs --help-options' for a list of what + may be accepted here. ['-r'] will make + the checked out files read only. ['-r', + '-R'] will also assume the repository is + read-only (I assume this means it won't + use locks to insure atomic access to the + ,v files).""" + self.checkoutDelay = checkoutDelay if not kwargs.has_key('mode') and (clobber or export or copydir): @@ -983,17 +1093,19 @@ class SVN(Source): - """I perform Subversion checkout/update operations. - - @param svnurl (required): the URL which points to the Subversion server. - This one string combines the access method (HTTP, ssh, local file), the - repository host/port, the repository path, the sub-tree within the - repository, and which branch to check out. - """ + """I perform Subversion checkout/update operations.""" name = 'svn' def __init__(self, svnurl, directory=None, **kwargs): + """ + @type svnurl: string + @param svnurl: the URL which points to the Subversion server, + combining the access method (HTTP, ssh, local file), + the repository host/port, the repository path, + the sub-tree within the repository, and the branch + to check out. + """ if not kwargs.has_key('workdir') and directory is not None: # deal with old configs @@ -1044,12 +1156,16 @@ means the eXecute-bit will be cleared on all source files. As a result, you may need to invoke configuration scripts with something like: - s(step.Configure, command=['/bin/sh', './configure']) + C{s(step.Configure, command=['/bin/sh', './configure'])} """ name = "darcs" def __init__(self, repourl, **kwargs): + """ + @type repourl: string + @param repourl: the URL which points at the Darcs repository + """ assert kwargs['mode'] != "export", \ "Darcs does not have an 'export' mode" Source.__init__(self, **kwargs) @@ -1069,18 +1185,29 @@ This step will first register the archive, which requires a per-user 'archive name' to correspond to the URL from which the sources can be fetched. The archive's default name will be used for this unless you - override it by setting the 'archive' parameter. You might want to do - this if, for some reason, you are hosting the archive on the same - machine (and in the same account) as the build slave, and you don't want - to confuse local access with remote access. - - [forgive the confusion expressed in the previous paragraph, I'm still - trying to get my head around Arch.. -warner] + override it by setting the 'archive' parameter. """ name = "arch" def __init__(self, url, version, archive=None, **kwargs): + """ + @type url: string + @param url: the Arch coordinates of the repository. This is + typically an http:// URL, but could also be the absolute + pathname of a local directory instead. + + @type version: string + @param version: the category--branch--version to check out + + @type archive: string + @param archive: an optional archive name, to override the one + provided by the repository. You might want to do this + if, for some reason, you are hosting the archive on + the same machine (and in the same account) as the + build slave, and you don't want to confuse local + access with remote access. + """ Source.__init__(self, **kwargs) self.args.update({'url': url, 'version': version, @@ -1123,9 +1250,9 @@ Each slave needs the following environment: - PATH: the 'p4' binary must be on the slave's PATH - P4USER: each slave needs a distinct user account - P4CLIENT: each slave needs a distinct client specification + - PATH: the 'p4' binary must be on the slave's PATH + - P4USER: each slave needs a distinct user account + - P4CLIENT: each slave needs a distinct client specification You should use 'p4 client' (?) to set up a client view spec which maps the desired files into $SLAVEBASE/$BUILDERBASE/source . @@ -1152,14 +1279,18 @@ class Dummy(BuildStep): - """I am a dummy no-op step that takes 5 seconds to complete. - @param timeout: the number of seconds to delay + """I am a dummy no-op step, which runs entirely on the master, and simply + waits 5 seconds before finishing with SUCCESS """ haltOnFailure = True name = "dummy" def __init__(self, timeout=5, **kwargs): + """ + @type timeout: int + @param timeout: the number of seconds to delay before completing + """ BuildStep.__init__(self, **kwargs) self.timeout = timeout self.timer = None @@ -1182,9 +1313,8 @@ self.finished(SUCCESS) class FailingDummy(Dummy): - """I am a dummy step that raises an Exception after 5 seconds - @param timeout: the number of seconds to delay - """ + """I am a dummy no-op step that 'runs' master-side and raises an + Exception after by default 5 seconds.""" name = "failing dummy" @@ -1202,18 +1332,21 @@ f = Failure() self.failed(f) +# subclasses from Shell Command to get the output reporting class RemoteDummy(ShellCommand): - """I am a dummy no-op step that runs on the remote side and takes 5 - seconds to complete. - - @param timeout: the number of seconds to delay - @param results: None + """I am a dummy no-op step that runs on the remote side and + simply waits 5 seconds before completing with success. + See L{buildbot.slave.commands.DummyCommand} """ haltOnFailure = True name = "remote dummy" def __init__(self, timeout=5, **kwargs): + """ + @type timeout: int + @param timeout: the number of seconds to delay + """ BuildStep.__init__(self, **kwargs) args = {'timeout': timeout} self.cmd = LoggedRemoteCommand("dummy", args) Index: step_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step_twisted.py,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- step_twisted.py 11 Apr 2005 19:30:30 -0000 1.66 +++ step_twisted.py 18 Apr 2005 00:26:57 -0000 1.67 @@ -31,15 +31,6 @@ warnings = 0 def __init__(self, python=None, **kwargs): - """ - @type results: double of [int, string] - @keyword results: [warnings, output]. - - warnings: the number of problems that were found - in the XHTML files (equal to the number of lines of - output that have colons in them), 0 if none were - found. - - output: string with all the warnings. - """ ShellCommand.__init__(self, **kwargs) self.python = python @@ -657,22 +648,26 @@ class BuildDebs(ShellCommand): - """I build the .deb packages. - - @param workdir: the workdir to start from: must be the base of the - Twisted tree - - @param results: [rc, output]. rc==0 if all .debs were created - successfully. 'output' is a string with any errors or warnings. - - """ - + """I build the .deb packages.""" + name = "debuild" flunkOnFailure = 1 command = ["debuild", "-uc", "-us"] description = ["building", "debs"] descriptionDone = ["debs"] + def __init__(self, **kwargs): + """ + @type workdir: string + @keyword workdir: the workdir to start from (must be the base of the + Twisted tree) + @type results: double of [int, string] + @keyword results: [rc, output]. + - rc == 0 if all .debs were created successfully + - output: string with any errors or warnings + """ + ShellCommand.__init__(self, **kwargs) + def commandComplete(self, cmd): errors, warnings = 0, 0 output = cmd.log.getText() From warner at users.sourceforge.net Tue Apr 19 07:45:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 07:45:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.58,1.59 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1721/buildbot Modified Files: master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-47 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-7] more docs from Thomas, a few edits of my own. Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- master.py 4 Apr 2005 07:10:22 -0000 1.58 +++ master.py 19 Apr 2005 07:45:20 -0000 1.59 @@ -632,6 +632,9 @@ reactor.callLater(0, self.loadTheConfigFile) def getStatus(self): + """ + @rtype: L{buildbot.status.builder.Status} + """ return self.status def loadTheConfigFile(self, configFile=None): From warner at users.sourceforge.net Tue Apr 19 07:45:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 07:45:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.51,1.52 words.py,1.32,1.33 builder.py,1.48,1.49 mail.py,1.13,1.14 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1721/buildbot/status Modified Files: html.py words.py builder.py mail.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-47 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-7] more docs from Thomas, a few edits of my own. Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- builder.py 18 Apr 2005 00:26:58 -0000 1.48 +++ builder.py 19 Apr 2005 07:45:19 -0000 1.49 @@ -1375,9 +1375,25 @@ return self.connected class Status: + """ + I represent the status of the buildmaster. + """ __implements__ = interfaces.IStatus, def __init__(self, botmaster, basedir): + """ + @type botmaster: L{buildbot.master.BotMaster} + @param botmaster: the Status object uses C{.botmaster} to get at + both the L{buildbot.master.BuildMaster} (for + various buildbot-wide parameters) and the + actual Builders (to get at their L{BuilderStatus} + objects). It is not allowed to change or influence + anything through this reference. + @type basedir: string + @param basedir: this provides a base directory in which saved status + information (changes.pck, saved Build status + pickles) can be stored + """ self.botmaster = botmaster self.basedir = basedir self.watchers = [] @@ -1393,6 +1409,9 @@ def getBuilderNames(self): return self.botmaster.builderNames[:] # don't let them break it def getBuilder(self, name): + """ + @rtype: L{BuilderStatus} + """ return self.botmaster.builders[name].builder_status def getSlave(self, slavename): Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- html.py 17 Apr 2005 10:50:00 -0000 1.51 +++ html.py 19 Apr 2005 07:45:19 -0000 1.52 @@ -1257,6 +1257,11 @@ control = None def __init__(self, status, control, changemaster): + """ + @type status: L{buildbot.status.builder.Status} + @type control: L{buildbot.master.Control} + @type changemaster: L{buildbot.changes.changes.ChangeMaster} + """ Resource.__init__(self) self.status = status self.control = control @@ -1281,11 +1286,58 @@ class Waterfall(service.MultiService, util.ComparableMixin): + """I implement the primary web-page status interface, called a 'Waterfall + Display' because builds and steps are presented in a grid of boxes which + move downwards over time. The top edge is always the present. Each column + represents a single builder. Each box describes a single Step, which may + have logfiles or other status information. + + All these pages are served via a web server of some sort. The simplest + approach is to let the buildmaster run its own webserver, on a given TCP + port, but it can also publish its pages to a L{twisted.web.distrib} + distributed web server (which lets the buildbot pages be a subset of some + other web server). + + @type parent: L{buildbot.master.BuildMaster} + @ivar parent: like all status plugins, this object is a child of the + BuildMaster, so C{.parent} points to a + L{buildbot.master.BuildMaster} instance, through which + the status-reporting object is acquired. + """ __implements__ = (interfaces.IStatusReceiver, service.MultiService.__implements__) compare_attrs = ["http_port", "distrib_port", "allowForce"] def __init__(self, http_port=None, distrib_port=None, allowForce=True): + """ + + xxxTo have the buildbot run its own web server, pass a port number to + C{http_port}. To have it run a web.distrib server + + @type http_port: int + @param http_port: the TCP port number on which the buildbot should + run its own web server, with the Waterfall display + as the root page + + @type distrib_port: string or int + @param distrib_port: Use this if you want to publish the Waterfall + page using web.distrib instead. The most common + case is to provide a string that is a pathname + to the unix socket on which the publisher should + listen (C{os.path.expanduser(~/.twistd-web-pb)} + will match the default settings of a standard + twisted.web 'personal web server'). Another + possibility is to pass an integer, which means + the publisher should listen on a TCP socket, + allowing the web server to be on a different + machine entirely. + + @type allowForce: bool + @param allowForce: if True, present a 'Force Build' button on the + per-Builder page that allows visitors to the web + site to initiate a build. If False, don't provide + this button. + """ service.MultiService.__init__(self) assert allowForce in (True, False) # TODO: implement others self.http_port = http_port @@ -1301,6 +1353,9 @@ self.distrib_port) def setServiceParent(self, parent): + """ + @type parent: L{buildbot.master.BuildMaster} + """ service.MultiService.setServiceParent(self, parent) self.setup() Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- mail.py 11 Apr 2005 19:30:31 -0000 1.13 +++ mail.py 19 Apr 2005 07:45:19 -0000 1.14 @@ -139,8 +139,12 @@ assert components.implements(lookup, interfaces.IEmailLookup) self.lookup = lookup self.watched = [] + self.status = None def setServiceParent(self, parent): + """ + @type parent: L{buildbot.master.BuildMaster} + """ service.Service.setServiceParent(self, parent) self.setup() Index: words.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/words.py,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- words.py 8 Dec 2004 04:15:23 -0000 1.32 +++ words.py 19 Apr 2005 07:45:19 -0000 1.33 @@ -28,6 +28,15 @@ "HA HA HA HA ...."], } def __init__(self, nickname, channels, status): + """ + @type nickname: string + @param nickname: the nickname by which this bot should be known + @type channels: list of strings + @param channels: the bot will maintain a presence in these channels + @type status: L{buildbot.status.builder.Status} + @param status: the build master's Status object, through which the + bot retrieves all status information + """ self.nickname = nickname self.channels = channels self.status = status @@ -119,6 +128,9 @@ return bc def getAllBuilders(self): + """ + @rtype: list of L{buildbot.process.builder.Builder} + """ names = self.status.getBuilderNames() names.sort() builders = [self.status.getBuilder(n) for n in names] From warner at users.sourceforge.net Tue Apr 19 07:45:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 07:45:21 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process base.py,1.45,1.46 interlock.py,1.5,1.6 builder.py,1.22,1.23 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1721/buildbot/process Modified Files: base.py interlock.py builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-47 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-7] more docs from Thomas, a few edits of my own. Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- base.py 18 Apr 2005 00:26:56 -0000 1.45 +++ base.py 19 Apr 2005 07:45:11 -0000 1.46 @@ -179,6 +179,9 @@ self.timer = None def fireTimer(self): + """ + Fire the build timer on the builder. + """ self.timer = None self.nextBuildTime = None # tell the Builder to deal with us Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/builder.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- builder.py 18 Apr 2005 00:26:56 -0000 1.22 +++ builder.py 19 Apr 2005 07:45:19 -0000 1.23 @@ -263,6 +263,13 @@ # eventually, our buildTimerFired() method will be called def buildTimerFired(self, wb): + """ + Called by the Build when the build timer fires. + + @type wb: L{buildbot.process.base.Build} + @param wb: the waiting build that fires the timer + """ + if not self.interlocks: # move from .waiting to .buildable if self.buildable: Index: interlock.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/interlock.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- interlock.py 18 Apr 2005 00:26:56 -0000 1.5 +++ interlock.py 19 Apr 2005 07:45:19 -0000 1.6 @@ -13,13 +13,21 @@ debug = 0 def __init__(self, name, feeders, watchers): + """ + @type name: string + @param name: name of the interlock + @type feeders: list of strings + @param feeders: names of the builders that feed this interlock + @type watchers: list of strings + @param watchers: names of the builders that wait on this interlock + """ self.name = name self.feederNames = feeders # these feed me self.watcherNames = watchers # these watch me self.feeders = {} for n in feeders: self.feeders[n] = (None, 0) - # feeders.keys are .names of Build objects that we watch + # feeders.keys are .names of Builder objects that we watch # feeders.values are Change numbers that have been successfully built self.watchers = {} # watchers.keys are Change numbers that a builder cares about @@ -57,7 +65,25 @@ for watcherName in self.watcherNames: builders[watcherName].stopWatchingInterlock(self) + # FIXME: maybe rename to changeProcessed instead ? + # that way it can be used for builders with unimportant changes + # to pass interlocks def buildFinished(self, feederName, changenum, successful): + """ + Tell the interlock the build on the given builder with the given + changenum has finished. + In practice, this just informs the interlock that the given builder + has processed changes up to the given changenum, with the given + result. + + @type feederName: string + @param feederName: name of the builder that finished a build + @type changenum: int + @param changenum: number of the L{buildbot.changes.changes.Change} + that this builder finished a build for + @type successful: bool + @param successful: whether the build succeeded + """ # we assume that any given build will process Changes in strict order self.feeders[feederName] = (changenum, successful) if self.debug: From warner at users.sourceforge.net Tue Apr 19 07:45:23 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 07:45:23 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.353,1.354 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1721 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-47 Creator: Brian Warner merge doc updates [org.apestaart at thomas/buildbot--doc--0--patch-7] more docs from Thomas, a few edits of my own. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.353 retrieving revision 1.354 diff -u -d -r1.353 -r1.354 --- ChangeLog 18 Apr 2005 00:34:44 -0000 1.353 +++ ChangeLog 19 Apr 2005 07:45:20 -0000 1.354 @@ -1,3 +1,15 @@ +2005-04-18 Thomas Vander Stichele + + * buildbot/master.py: + * buildbot/process/base.py: + * buildbot/process/builder.py: + * buildbot/process/interlock.py: + * buildbot/status/builder.py: + * buildbot/status/html.py: + * buildbot/status/mail.py: + * buildbot/status/words.py: + new documentation while digging through the code + 2005-04-17 Brian Warner * general: try to fix file modes on all .py files: a+r, a-x, From warner at users.sourceforge.net Tue Apr 19 08:22:44 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 08:22:44 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.52,1.53 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19858/buildbot/status Modified Files: html.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-49 Creator: Brian Warner add favicon.ico, remove some deprecated web tests 2005-04-19 Brian Warner * buildbot/slave/commands.py (ShellCommand._startCommand): log the environment used by the command, at least on the child side. * buildbot/status/html.py (TextLog.pauseProducing): add a note, this method needs to be added and implemented because it gets called under heavy load. I don't quite understand the producer/consumer API enough to write it. (StatusResource.getChild): add a resource for /favicon.ico (Waterfall.__init__): add favicon= argument * buildbot/test/test_web.py (WebTest.test_waterfall): test it (WebTest.test_webPortnum): stop using deprecated 'webPortnum' (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same * docs/config.xhtml: mention favicon= * buildbot/buildbot.png: add a default icon, dorky as it is Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- html.py 19 Apr 2005 07:45:19 -0000 1.52 +++ html.py 19 Apr 2005 08:22:42 -0000 1.53 @@ -3,6 +3,7 @@ from __future__ import generators from twisted.python import log, components +from twisted.python.util import sibpath import urllib from twisted.internet import defer, reactor @@ -13,7 +14,7 @@ from twisted.application import service, internet from twisted.spread import pb -import string, types, time +import string, types, time, os.path from buildbot import interfaces, util from buildbot import version @@ -565,6 +566,12 @@ d = self.original.waitUntilFinished() d.addCallback(self.finished) + # TODO: under heavy load (a rogue web crawler hammering all the build log + # pages), this method gets called, and we don't implement it, which is + # bad. + #def pauseProducing(self): + # pass + def stopProducing(self): pass @@ -1255,6 +1262,7 @@ class StatusResource(Resource): status = None control = None + favicon = None def __init__(self, status, control, changemaster): """ @@ -1282,8 +1290,14 @@ return StatusResourceBuilder(builder, control) if path == "changes": return StatusResourceChanges(self.changemaster) + if path == "favicon.ico": + if self.favicon: + return static.File(self.favicon) + return NoResource("No favicon.ico registered") return NoResource("No such Builder '%s'" % path) +# TODO: this hack probably doesn't work under windows +buildbot_icon = os.path.abspath(sibpath(__file__, "../buildbot.png")) class Waterfall(service.MultiService, util.ComparableMixin): """I implement the primary web-page status interface, called a 'Waterfall @@ -1308,7 +1322,8 @@ service.MultiService.__implements__) compare_attrs = ["http_port", "distrib_port", "allowForce"] - def __init__(self, http_port=None, distrib_port=None, allowForce=True): + def __init__(self, http_port=None, distrib_port=None, allowForce=True, + favicon=buildbot_icon): """ xxxTo have the buildbot run its own web server, pass a port number to @@ -1337,12 +1352,23 @@ per-Builder page that allows visitors to the web site to initiate a build. If False, don't provide this button. + + @type favicon: string + @param favicon: if set, provide the pathname of an image file that + will be used for the 'favicon.ico' resource. Many + browsers automatically request this file and use it + as an icon in any bookmark generated from this site. + Defaults to the L{buildbot.png} image provided in the + distribution. Can be set to None to avoid using + a favicon at all. + """ service.MultiService.__init__(self) assert allowForce in (True, False) # TODO: implement others self.http_port = http_port self.distrib_port = distrib_port self.allowForce = allowForce + self.favicon = favicon def __repr__(self): if self.http_port is None: @@ -1366,7 +1392,9 @@ else: control = None change_svc = self.parent.change_svc - self.site = server.Site(StatusResource(status, control, change_svc)) + sr = StatusResource(status, control, change_svc) + sr.favicon = self.favicon + self.site = server.Site(sr) if self.http_port is not None: s = internet.TCPServer(self.http_port, self.site) From warner at users.sourceforge.net Tue Apr 19 08:22:45 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 08:22:45 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.6,1.7 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19858/buildbot/test Modified Files: test_web.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-49 Creator: Brian Warner add favicon.ico, remove some deprecated web tests 2005-04-19 Brian Warner * buildbot/slave/commands.py (ShellCommand._startCommand): log the environment used by the command, at least on the child side. * buildbot/status/html.py (TextLog.pauseProducing): add a note, this method needs to be added and implemented because it gets called under heavy load. I don't quite understand the producer/consumer API enough to write it. (StatusResource.getChild): add a resource for /favicon.ico (Waterfall.__init__): add favicon= argument * buildbot/test/test_web.py (WebTest.test_waterfall): test it (WebTest.test_webPortnum): stop using deprecated 'webPortnum' (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same * docs/config.xhtml: mention favicon= * buildbot/buildbot.png: add a default icon, dorky as it is Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- test_web.py 2 Apr 2005 00:56:46 -0000 1.6 +++ test_web.py 19 Apr 2005 08:22:43 -0000 1.7 @@ -1,7 +1,7 @@ #! /usr/bin/python -import sys, os -from twisted.python import log, components +import sys, os, os.path +from twisted.python import log, components, util #log.startLogging(sys.stderr) from twisted.trial import unittest @@ -80,10 +80,19 @@ list(master)) def test_webPortnum(self): - cfg = config1 % {'k': 'webPortnum', - 'v': "0"} + # run a regular web server on a TCP socket + config = """ +from buildbot.status import html +BuildmasterConfig = { + 'bots': [], + 'sources': [], + 'builders': [], + 'slavePortnum': 0, + 'status': [html.Waterfall(http_port=0)], + } +""" os.mkdir("test_web1") - m = ConfiguredMaster("test_web1", cfg) + m = ConfiguredMaster("test_web1", config) m.startService() # hack to find out what randomly-assigned port it is listening on port = list(self.find_waterfall(m)[0])[0]._port.getHost().port @@ -98,12 +107,18 @@ # running a t.web.distrib server over a UNIX socket if not components.implements(reactor, IReactorUNIX): raise unittest.SkipTest("UNIX sockets not supported here") - - cfg = config1 % {'k': 'webPathname', - 'v': "'.web-pb'"} - + config = """ +from buildbot.status import html +BuildmasterConfig = { + 'bots': [], + 'sources': [], + 'builders': [], + 'slavePortnum': 0, + 'status': [html.Waterfall(distrib_port='.web-pb')], + } +""" os.mkdir("test_web2") - m = ConfiguredMaster("test_web2", cfg) + m = ConfiguredMaster("test_web2", config) m.startService() p = DistribUNIX("test_web2/.web-pb") @@ -118,11 +133,18 @@ def test_webPathname_port(self): # running a t.web.distrib server over TCP - cfg = config1 % {'k': 'webPathname', - 'v': "0"} - + config = """ +from buildbot.status import html +BuildmasterConfig = { + 'bots': [], + 'sources': [], + 'builders': [], + 'slavePortnum': 0, + 'status': [html.Waterfall(distrib_port=0)], + } +""" os.mkdir("test_web3") - m = ConfiguredMaster("test_web3", cfg) + m = ConfiguredMaster("test_web3", config) m.startService() dport = list(self.find_waterfall(m)[0])[0]._port.getHost().port @@ -134,3 +156,40 @@ self.failUnless(page) dr(p.shutdown()) dr(m.stopService()) + + def test_waterfall(self): + # this is the right way to configure the Waterfall status + config1 = """ +from buildbot.status import html +BuildmasterConfig = { + 'bots': [], + 'sources': [], + 'builders': [], + 'slavePortnum': 0, + 'status': [html.Waterfall(http_port=0, favicon='%s')], + } +""" + favicon = util.sibpath(__file__, "../buildbot.png") + #print favicon + cfg = config1 % os.path.abspath(favicon) + #print "config file is" + #print cfg + + os.mkdir("test_web4") + m = ConfiguredMaster("test_web4", cfg) + m.startService() + # hack to find out what randomly-assigned port it is listening on + port = list(self.find_waterfall(m)[0])[0]._port.getHost().port + + d = client.getPage("http://localhost:%d/" % port) + page = dr(d) + self.failUnless(page) + self.failUnless("current activity" in page) + self.failUnless("" in page) + + d = client.getPage("http://localhost:%d/favicon.ico" % port) + icon = dr(d) + expected = open(favicon,"r").read() + self.failUnless(icon == expected) + + dr(m.stopService()) From warner at users.sourceforge.net Tue Apr 19 08:22:45 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 08:22:45 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.354,1.355 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19858 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-49 Creator: Brian Warner add favicon.ico, remove some deprecated web tests 2005-04-19 Brian Warner * buildbot/slave/commands.py (ShellCommand._startCommand): log the environment used by the command, at least on the child side. * buildbot/status/html.py (TextLog.pauseProducing): add a note, this method needs to be added and implemented because it gets called under heavy load. I don't quite understand the producer/consumer API enough to write it. (StatusResource.getChild): add a resource for /favicon.ico (Waterfall.__init__): add favicon= argument * buildbot/test/test_web.py (WebTest.test_waterfall): test it (WebTest.test_webPortnum): stop using deprecated 'webPortnum' (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same * docs/config.xhtml: mention favicon= * buildbot/buildbot.png: add a default icon, dorky as it is Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.354 retrieving revision 1.355 diff -u -d -r1.354 -r1.355 --- ChangeLog 19 Apr 2005 07:45:20 -0000 1.354 +++ ChangeLog 19 Apr 2005 08:22:43 -0000 1.355 @@ -1,3 +1,21 @@ +2005-04-19 Brian Warner + + * buildbot/slave/commands.py (ShellCommand._startCommand): log the + environment used by the command, at least on the child side. + + * buildbot/status/html.py (TextLog.pauseProducing): add a note, + this method needs to be added and implemented because it gets + called under heavy load. I don't quite understand the + producer/consumer API enough to write it. + (StatusResource.getChild): add a resource for /favicon.ico + (Waterfall.__init__): add favicon= argument + * buildbot/test/test_web.py (WebTest.test_waterfall): test it + (WebTest.test_webPortnum): stop using deprecated 'webPortnum' + (WebTest.test_webPathname): same + (WebTest.test_webPathname_port): same + * docs/config.xhtml: mention favicon= + * buildbot/buildbot.png: add a default icon, dorky as it is + 2005-04-18 Thomas Vander Stichele * buildbot/master.py: From warner at users.sourceforge.net Tue Apr 19 08:22:46 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 08:22:46 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.22,1.23 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19858/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-49 Creator: Brian Warner add favicon.ico, remove some deprecated web tests 2005-04-19 Brian Warner * buildbot/slave/commands.py (ShellCommand._startCommand): log the environment used by the command, at least on the child side. * buildbot/status/html.py (TextLog.pauseProducing): add a note, this method needs to be added and implemented because it gets called under heavy load. I don't quite understand the producer/consumer API enough to write it. (StatusResource.getChild): add a resource for /favicon.ico (Waterfall.__init__): add favicon= argument * buildbot/test/test_web.py (WebTest.test_waterfall): test it (WebTest.test_webPortnum): stop using deprecated 'webPortnum' (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same * docs/config.xhtml: mention favicon= * buildbot/buildbot.png: add a default icon, dorky as it is Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- commands.py 18 Apr 2005 00:26:56 -0000 1.22 +++ commands.py 19 Apr 2005 08:22:43 -0000 1.23 @@ -147,6 +147,7 @@ msg += " (timeout %d secs)" % self.timeout log.msg(" " + msg) self.sendStatus({'header': msg+"\n"}) + log.msg(" env is: %s" % self.environ) if self.notreally: self.sendStatus({'header': "(not really)\n"}) self.finished(None, 0) From warner at users.sourceforge.net Tue Apr 19 08:22:45 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 08:22:45 +0000 Subject: [Buildbot-commits] buildbot/buildbot buildbot.png,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19858/buildbot Added Files: buildbot.png Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-49 Creator: Brian Warner add favicon.ico, remove some deprecated web tests 2005-04-19 Brian Warner * buildbot/slave/commands.py (ShellCommand._startCommand): log the environment used by the command, at least on the child side. * buildbot/status/html.py (TextLog.pauseProducing): add a note, this method needs to be added and implemented because it gets called under heavy load. I don't quite understand the producer/consumer API enough to write it. (StatusResource.getChild): add a resource for /favicon.ico (Waterfall.__init__): add favicon= argument * buildbot/test/test_web.py (WebTest.test_waterfall): test it (WebTest.test_webPortnum): stop using deprecated 'webPortnum' (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same * docs/config.xhtml: mention favicon= * buildbot/buildbot.png: add a default icon, dorky as it is --- NEW FILE: buildbot.png --- (This appears to be a binary file; contents omitted.) From warner at users.sourceforge.net Tue Apr 19 08:22:44 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 08:22:44 +0000 Subject: [Buildbot-commits] buildbot/docs config.xhtml,1.6,1.7 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19858/docs Modified Files: config.xhtml Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-49 Creator: Brian Warner add favicon.ico, remove some deprecated web tests 2005-04-19 Brian Warner * buildbot/slave/commands.py (ShellCommand._startCommand): log the environment used by the command, at least on the child side. * buildbot/status/html.py (TextLog.pauseProducing): add a note, this method needs to be added and implemented because it gets called under heavy load. I don't quite understand the producer/consumer API enough to write it. (StatusResource.getChild): add a resource for /favicon.ico (Waterfall.__init__): add favicon= argument * buildbot/test/test_web.py (WebTest.test_waterfall): test it (WebTest.test_webPortnum): stop using deprecated 'webPortnum' (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same * docs/config.xhtml: mention favicon= * buildbot/buildbot.png: add a default icon, dorky as it is Index: config.xhtml =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/config.xhtml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- config.xhtml 15 Sep 2004 10:00:49 -0000 1.6 +++ config.xhtml 19 Apr 2005 08:22:35 -0000 1.7 @@ -82,21 +82,22 @@
  • buildbot.status.html.Waterfall(http_port=int, - distrib_port=int/str): + distrib_port=int/str, favicon=str): This creates an HTML waterfall display, which shows a time-based - chart of events. This display provides detailed information about all - steps of all recent builds, and provides hyperlinks to look at individual - build logs and source changes. If the http_port argument is + chart of events. This display provides detailed information about all steps + of all recent builds, and provides hyperlinks to look at individual build + logs and source changes. If the http_port argument is provided, it represents the TCP port number on which the web server should listen. If instead distrib_port is provided, a twisted.web distributed server will be started either on a TCP port (if distrib_port is an int) or more likely on a UNIX socket (if - distrib_port is a string). -
  • + distrib_port is a string). favicon can be used to + point at an image that many browsers will use as an icon in any bookmarks + made to pages on the site.
  • buildbot.status.words.IRC(stuff): From warner at users.sourceforge.net Tue Apr 19 08:37:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 08:37:27 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.21,1.22 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28215/buildbot/test Modified Files: test_vc.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-51 Creator: Brian Warner install buildbot.png, fix test_vc-vs-Twisted-1.3.0 2005-04-19 Brian Warner * buildbot/test/test_vc.py (SetupMixin.setUpClass): fix the skip-if-repositories-are-unavailable test to not kill the trial that comes with Twisted-1.3.0 * setup.py: install buildbot.png icon file when installing code Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- test_vc.py 12 Apr 2005 00:28:45 -0000 1.21 +++ test_vc.py 19 Apr 2005 08:37:25 -0000 1.22 @@ -167,16 +167,19 @@ httpPort = None def setUpClass(self): + global VCS if VCS is None: - global VCS + print "doing VCSupport" VCS = VCSupport() SignalMixin.setUpClass(self) + + def setUp(self): if not VCS.RepositoryPath: + # this wants to be in setUpClass instead, but the trial in + # twisted-1.3.0 can't handle that raise unittest.SkipTest("provide " "BUILDBOT_TEST_VC=path/to/repositories " "to run this") - - def setUp(self): self.serveHTTP() shutil.rmtree("basedir", ignore_errors=1) os.mkdir("basedir") From warner at users.sourceforge.net Tue Apr 19 08:37:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 19 Apr 2005 08:37:27 +0000 Subject: [Buildbot-commits] buildbot setup.py,1.30,1.31 ChangeLog,1.355,1.356 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28215 Modified Files: setup.py ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-51 Creator: Brian Warner install buildbot.png, fix test_vc-vs-Twisted-1.3.0 2005-04-19 Brian Warner * buildbot/test/test_vc.py (SetupMixin.setUpClass): fix the skip-if-repositories-are-unavailable test to not kill the trial that comes with Twisted-1.3.0 * setup.py: install buildbot.png icon file when installing code Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.355 retrieving revision 1.356 diff -u -d -r1.355 -r1.356 --- ChangeLog 19 Apr 2005 08:22:43 -0000 1.355 +++ ChangeLog 19 Apr 2005 08:37:24 -0000 1.356 @@ -1,5 +1,11 @@ 2005-04-19 Brian Warner + * buildbot/test/test_vc.py (SetupMixin.setUpClass): fix the + skip-if-repositories-are-unavailable test to not kill the trial + that comes with Twisted-1.3.0 + + * setup.py: install buildbot.png icon file when installing code + * buildbot/slave/commands.py (ShellCommand._startCommand): log the environment used by the command, at least on the child side. Index: setup.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/setup.py,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- setup.py 8 Nov 2004 09:03:21 -0000 1.30 +++ setup.py 19 Apr 2005 08:37:24 -0000 1.31 @@ -52,7 +52,8 @@ "buildbot.slave", "buildbot.scripts", "buildbot.test"], - data_files=[("buildbot", ["buildbot/plugins.tml"]), + data_files=[("buildbot", ["buildbot/plugins.tml", + "buildbot/buildbot.png"]), ("buildbot/scripts", ["buildbot/scripts/sample.cfg", "buildbot/scripts/sample.mk"]),], scripts = scripts, From warner at users.sourceforge.net Wed Apr 20 19:32:49 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 20 Apr 2005 19:32:49 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.22,1.23 test_slavecommand.py,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5685/buildbot/test Modified Files: test_vc.py test_slavecommand.py Log Message: * buildbot/test/test_slavecommand.py (SlaveCommandTestCase.testShellZ): win32-compatibility fixes from Nick Trout, the "file not found" message is different under windows (FakeSlaveBuilder.__init__): clean up setup a bit * buildbot/test/test_vc.py (VCSupport.__init__): win32: use os.pathsep Index: test_slavecommand.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- test_slavecommand.py 4 Dec 2004 22:30:23 -0000 1.7 +++ test_slavecommand.py 20 Apr 2005 19:32:46 -0000 1.8 @@ -1,8 +1,7 @@ #! /usr/bin/python from twisted.trial import unittest -from twisted.internet import reactor -from twisted.internet.defer import Deferred +from twisted.internet import reactor, defer from twisted.python import util noisy = False @@ -29,10 +28,10 @@ class FakeSlaveBuilder: usePTY = True # TODO: this probably won't work on non-posix - def __init__(self): + def __init__(self, d): self.updates = [] self.failure = None - self.deferred = Deferred() + self.deferred = d self.basedir = findDir() def startBuild(self): self.build = FakeSlaveBuild() @@ -68,8 +67,8 @@ class SlaveCommandTestCase(SignalMixin, unittest.TestCase): def setUp(self): - self.builder = FakeSlaveBuilder() - d = self.builder.deferred + d = defer.Deferred() + self.builder = FakeSlaveBuilder(d) d.addCallback(self.callback) self.failed = None self.results = None @@ -160,9 +159,10 @@ self.failIf(failed) self.failUnless(self.getrc() != 0) got = self.getfile('stdout') - self.failUnless(re.search(r'no such file', - got, - re.I)) + self.failUnless(re.search(r'no such file', got, re.I) # unix + or re.search(r'cannot find the path specified', + got, re.I) # win32 + ) # todo: interrupt(), kill process Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- test_vc.py 19 Apr 2005 08:37:25 -0000 1.22 +++ test_vc.py 20 Apr 2005 19:32:46 -0000 1.23 @@ -68,7 +68,7 @@ 'svn': False, 'cvs': False, } - for p in os.environ['PATH'].split(":"): + for p in os.environ['PATH'].split(os.pathsep): if os.path.exists(os.path.join(p, 'tla')): self.have['arch'] = True if os.path.exists(os.path.join(p, 'darcs')): From warner at users.sourceforge.net Wed Apr 20 19:32:49 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 20 Apr 2005 19:32:49 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.356,1.357 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5685 Modified Files: ChangeLog Log Message: * buildbot/test/test_slavecommand.py (SlaveCommandTestCase.testShellZ): win32-compatibility fixes from Nick Trout, the "file not found" message is different under windows (FakeSlaveBuilder.__init__): clean up setup a bit * buildbot/test/test_vc.py (VCSupport.__init__): win32: use os.pathsep Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.356 retrieving revision 1.357 diff -u -d -r1.356 -r1.357 --- ChangeLog 19 Apr 2005 08:37:24 -0000 1.356 +++ ChangeLog 20 Apr 2005 19:32:47 -0000 1.357 @@ -1,3 +1,11 @@ +2005-04-20 Brian Warner + + * buildbot/test/test_slavecommand.py (SlaveCommandTestCase.testShellZ): + win32-compatibility fixes from Nick Trout, the "file not found" message + is different under windows + (FakeSlaveBuilder.__init__): clean up setup a bit + * buildbot/test/test_vc.py (VCSupport.__init__): win32: use os.pathsep + 2005-04-19 Brian Warner * buildbot/test/test_vc.py (SetupMixin.setUpClass): fix the From warner at users.sourceforge.net Wed Apr 20 20:13:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 20 Apr 2005 20:13:27 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.23,1.24 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25684/buildbot/slave Modified Files: commands.py Log Message: * buildbot/slave/commands.py (ShellCommand.__init__): use os.pathsep * buildbot/test/test_web.py (WebTest.test_webPortnum): add timeout (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same (WebTest.test_waterfall): use the default favicon rather than rooting around the filesystem for it. Open the expected-icon file in binary mode, to make win32 tests happier (thanks to Nick Trout for the catch) * buildbot/status/html.py (buildbot_icon): win32 portability Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- commands.py 19 Apr 2005 08:22:43 -0000 1.23 +++ commands.py 20 Apr 2005 20:13:25 -0000 1.24 @@ -99,7 +99,7 @@ # ones. This will break if you send over empty strings, so # don't do that. environ['PYTHONPATH'] = (environ['PYTHONPATH'] - + ":" + + os.pathsep + self.environ['PYTHONPATH']) # this will proceed to replace the old one self.environ.update(environ) From warner at users.sourceforge.net Wed Apr 20 20:13:28 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 20 Apr 2005 20:13:28 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.53,1.54 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25684/buildbot/status Modified Files: html.py Log Message: * buildbot/slave/commands.py (ShellCommand.__init__): use os.pathsep * buildbot/test/test_web.py (WebTest.test_webPortnum): add timeout (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same (WebTest.test_waterfall): use the default favicon rather than rooting around the filesystem for it. Open the expected-icon file in binary mode, to make win32 tests happier (thanks to Nick Trout for the catch) * buildbot/status/html.py (buildbot_icon): win32 portability Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- html.py 19 Apr 2005 08:22:42 -0000 1.53 +++ html.py 20 Apr 2005 20:13:25 -0000 1.54 @@ -1296,8 +1296,9 @@ return NoResource("No favicon.ico registered") return NoResource("No such Builder '%s'" % path) -# TODO: this hack probably doesn't work under windows -buildbot_icon = os.path.abspath(sibpath(__file__, "../buildbot.png")) +# the icon is sibpath(__file__, "../buildbot.png") . This is for portability. +up = os.path.dirname +buildbot_icon = os.path.abspath(os.path.join(up(up(__file__)), "buildbot.png")) class Waterfall(service.MultiService, util.ComparableMixin): """I implement the primary web-page status interface, called a 'Waterfall From warner at users.sourceforge.net Wed Apr 20 20:13:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 20 Apr 2005 20:13:27 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.357,1.358 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25684 Modified Files: ChangeLog Log Message: * buildbot/slave/commands.py (ShellCommand.__init__): use os.pathsep * buildbot/test/test_web.py (WebTest.test_webPortnum): add timeout (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same (WebTest.test_waterfall): use the default favicon rather than rooting around the filesystem for it. Open the expected-icon file in binary mode, to make win32 tests happier (thanks to Nick Trout for the catch) * buildbot/status/html.py (buildbot_icon): win32 portability Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.357 retrieving revision 1.358 diff -u -d -r1.357 -r1.358 --- ChangeLog 20 Apr 2005 19:32:47 -0000 1.357 +++ ChangeLog 20 Apr 2005 20:13:24 -0000 1.358 @@ -1,5 +1,16 @@ 2005-04-20 Brian Warner + * buildbot/slave/commands.py (ShellCommand.__init__): use os.pathsep + + * buildbot/test/test_web.py (WebTest.test_webPortnum): add timeout + (WebTest.test_webPathname): same + (WebTest.test_webPathname_port): same + (WebTest.test_waterfall): use the default favicon rather than + rooting around the filesystem for it. Open the expected-icon file + in binary mode, to make win32 tests happier (thanks to Nick Trout + for the catch) + * buildbot/status/html.py (buildbot_icon): win32 portability + * buildbot/test/test_slavecommand.py (SlaveCommandTestCase.testShellZ): win32-compatibility fixes from Nick Trout, the "file not found" message is different under windows From warner at users.sourceforge.net Wed Apr 20 20:13:28 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 20 Apr 2005 20:13:28 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25684/buildbot/test Modified Files: test_web.py Log Message: * buildbot/slave/commands.py (ShellCommand.__init__): use os.pathsep * buildbot/test/test_web.py (WebTest.test_webPortnum): add timeout (WebTest.test_webPathname): same (WebTest.test_webPathname_port): same (WebTest.test_waterfall): use the default favicon rather than rooting around the filesystem for it. Open the expected-icon file in binary mode, to make win32 tests happier (thanks to Nick Trout for the catch) * buildbot/status/html.py (buildbot_icon): win32 portability Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- test_web.py 19 Apr 2005 08:22:43 -0000 1.7 +++ test_web.py 20 Apr 2005 20:13:26 -0000 1.8 @@ -98,7 +98,7 @@ port = list(self.find_waterfall(m)[0])[0]._port.getHost().port d = client.getPage("http://localhost:%d/" % port) - page = dr(d) + page = dr(d, 10) #print page self.failUnless(page) dr(m.stopService()) @@ -124,7 +124,7 @@ p = DistribUNIX("test_web2/.web-pb") d = client.getPage("http://localhost:%d/remote/" % p.portnum) - page = dr(d) + page = dr(d, 10) #print page self.failUnless(page) dr(p.shutdown()) @@ -151,7 +151,7 @@ p = DistribTCP(dport) d = client.getPage("http://localhost:%d/remote/" % p.portnum) - page = dr(d) + page = dr(d, 10) #print page self.failUnless(page) dr(p.shutdown()) @@ -166,17 +166,11 @@ 'sources': [], 'builders': [], 'slavePortnum': 0, - 'status': [html.Waterfall(http_port=0, favicon='%s')], + 'status': [html.Waterfall(http_port=0)], } """ - favicon = util.sibpath(__file__, "../buildbot.png") - #print favicon - cfg = config1 % os.path.abspath(favicon) - #print "config file is" - #print cfg - os.mkdir("test_web4") - m = ConfiguredMaster("test_web4", cfg) + m = ConfiguredMaster("test_web4", config1) m.startService() # hack to find out what randomly-assigned port it is listening on port = list(self.find_waterfall(m)[0])[0]._port.getHost().port @@ -189,7 +183,7 @@ d = client.getPage("http://localhost:%d/favicon.ico" % port) icon = dr(d) - expected = open(favicon,"r").read() + expected = open(html.buildbot_icon,"rb").read() self.failUnless(icon == expected) dr(m.stopService()) From warner at users.sourceforge.net Wed Apr 20 23:28:29 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 20 Apr 2005 23:28:29 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.358,1.359 NEWS,1.36,1.37 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29439 Modified Files: ChangeLog NEWS Log Message: start creating entries for the next release Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.358 retrieving revision 1.359 diff -u -d -r1.358 -r1.359 --- ChangeLog 20 Apr 2005 20:13:24 -0000 1.358 +++ ChangeLog 20 Apr 2005 23:28:27 -0000 1.359 @@ -1,5 +1,7 @@ 2005-04-20 Brian Warner + * NEWS: start creating entries for the next release + * buildbot/slave/commands.py (ShellCommand.__init__): use os.pathsep * buildbot/test/test_web.py (WebTest.test_webPortnum): add timeout Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- NEWS 13 Dec 2004 08:23:42 -0000 1.36 +++ NEWS 20 Apr 2005 23:28:27 -0000 1.37 @@ -1,5 +1,47 @@ User visible changes in Buildbot. +* Release X.X.X (XX) + +** API docs + +Thanks to Thomas Vander Stichele, most of the docstrings have been converted +to epydoc format. There is a utility in docs/gen-reference to turn these into +a tree of cross-referenced HTML pages. Eventually these docs will be +auto-generated and somehow published on the buildbot web page. + +** web page has a favicon + +When constructing the html.Waterfall instance, you can provide the filename +of an image that will be provided when the "favicon.ico" resource is +requested. Many web browsers display this as an icon next to the URL or +bookmark. A goofy little default icon is included. + +** bug fixes + +The waterfall page has been improved a bit. A circular-reference bug in the +web page's TextLog class was fixed, which caused a major memory leak in a +long-running buildmaster with large logfiles that are viewed frequently. + +** twisted-2.0.0 compatibility + +Both buildmaster and buildslave should run properly under Twisted-2.0 . There +are still some warnings about deprecated functions, some of which could be +fixed, but there are others that would require removing compatibility with +Twisted-1.3, and I don't expect to do that until 2.0 has been out and stable +for at least several months. The unit tests should pass under 2.0, whereas +the previous buildbot release had tests which could hang when run against the +new "trial" framework in 2.0. + +The Twisted-specific steps (including Trial) have been updated to match 2.0 +functionality. + +** win32 compatibility + +Thankt to Nick Trout, more compatibility fixes have been incorporated, +improving the chances that the unit tests will pass on windows systems. + + + * Release 0.6.2 (13 Dec 2004) ** new features From warner at users.sourceforge.net Thu Apr 21 00:46:37 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 21 Apr 2005 00:46:37 +0000 Subject: [Buildbot-commits] buildbot MANIFEST.in,1.13,1.14 ChangeLog,1.359,1.360 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8154 Modified Files: MANIFEST.in ChangeLog Log Message: add epyrun, gen-reference, buildbot.png Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.359 retrieving revision 1.360 diff -u -d -r1.359 -r1.360 --- ChangeLog 20 Apr 2005 23:28:27 -0000 1.359 +++ ChangeLog 21 Apr 2005 00:46:34 -0000 1.360 @@ -1,5 +1,7 @@ 2005-04-20 Brian Warner + * MANIFEST.in: add epyrun, gen-reference, buildbot.png + * NEWS: start creating entries for the next release * buildbot/slave/commands.py (ShellCommand.__init__): use os.pathsep Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- MANIFEST.in 23 Nov 2004 11:18:40 -0000 1.13 +++ MANIFEST.in 21 Apr 2005 00:46:34 -0000 1.14 @@ -5,9 +5,11 @@ include docs/PyCon-2003/waterfall.png include docs/examples/*.cfg include docs/*.xhtml docs/*.css docs/*.tpl +include docs/epyrun docs/gen-reference include buildbot/plugins.tml include buildbot/test/mail/* buildbot/test/subdir/* include buildbot/scripts/sample.cfg buildbot/scripts/sample.mk +include buildbot/buildbot.png exclude buildbot/test/test_trial.py From warner at users.sourceforge.net Thu Apr 21 00:57:37 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 21 Apr 2005 00:57:37 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.360,1.361 README,1.23,1.24 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15062 Modified Files: ChangeLog README Log Message: (REQUIREMENTS): mention Twisted-2.0.0 compatibility Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.360 retrieving revision 1.361 diff -u -d -r1.360 -r1.361 --- ChangeLog 21 Apr 2005 00:46:34 -0000 1.360 +++ ChangeLog 21 Apr 2005 00:57:34 -0000 1.361 @@ -1,5 +1,7 @@ 2005-04-20 Brian Warner + * README (REQUIREMENTS): mention Twisted-2.0.0 compatibility + * MANIFEST.in: add epyrun, gen-reference, buildbot.png * NEWS: start creating entries for the next release Index: README =================================================================== RCS file: /cvsroot/buildbot/buildbot/README,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- README 23 Nov 2004 11:18:40 -0000 1.23 +++ README 21 Apr 2005 00:57:34 -0000 1.24 @@ -59,7 +59,8 @@ Both the buildmaster and the buildslaves require Twisted-1.3.0 or later. They have been briefly tested against Twisted-1.2.0, and might even work with Twisted-1.1.0, but 1.3.0 is the version that has received the most - testing. + testing. They run against Twisted-2.0.0 as well, albeit with a number of + warnings about the use of deprecated features. CVSToys: http://purl.net/net/CVSToys From warner at users.sourceforge.net Thu Apr 21 19:53:35 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 21 Apr 2005 19:53:35 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.361,1.362 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26419 Modified Files: ChangeLog Log Message: (Shell): test both with and without PTYs, and make sure that command output is properly interleaved in the with-PTY case. I think the without-PTY test should pass on windows, where we never use PTYs anyway. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.361 retrieving revision 1.362 diff -u -d -r1.361 -r1.362 --- ChangeLog 21 Apr 2005 00:57:34 -0000 1.361 +++ ChangeLog 21 Apr 2005 19:53:33 -0000 1.362 @@ -1,3 +1,10 @@ +2005-04-21 Brian Warner + + * buildbot/test/test_slavecommand.py (Shell): test both with and + without PTYs, and make sure that command output is properly + interleaved in the with-PTY case. I think the without-PTY test + should pass on windows, where we never use PTYs anyway. + 2005-04-20 Brian Warner * README (REQUIREMENTS): mention Twisted-2.0.0 compatibility From warner at users.sourceforge.net Thu Apr 21 19:53:35 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 21 Apr 2005 19:53:35 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_slavecommand.py,1.8,1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26419/buildbot/test Modified Files: test_slavecommand.py Log Message: (Shell): test both with and without PTYs, and make sure that command output is properly interleaved in the with-PTY case. I think the without-PTY test should pass on windows, where we never use PTYs anyway. Index: test_slavecommand.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- test_slavecommand.py 20 Apr 2005 19:32:46 -0000 1.8 +++ test_slavecommand.py 21 Apr 2005 19:53:32 -0000 1.9 @@ -2,7 +2,7 @@ from twisted.trial import unittest from twisted.internet import reactor, defer -from twisted.python import util +from twisted.python import util, runtime noisy = False if noisy: @@ -26,13 +26,13 @@ pass class FakeSlaveBuilder: - usePTY = True # TODO: this probably won't work on non-posix - - def __init__(self, d): + def __init__(self, d, usePTY): self.updates = [] self.failure = None self.deferred = d self.basedir = findDir() + self.usePTY = usePTY + def startBuild(self): self.build = FakeSlaveBuild() def commandComplete(self, dummy): @@ -64,11 +64,12 @@ signal.signal(signal.SIGCHLD, self.sigchldHandler) -class SlaveCommandTestCase(SignalMixin, unittest.TestCase): +class Shell(SignalMixin, unittest.TestCase): + usePTY = False def setUp(self): d = defer.Deferred() - self.builder = FakeSlaveBuilder(d) + self.builder = FakeSlaveBuilder(d, self.usePTY) d.addCallback(self.callback) self.failed = None self.results = None @@ -101,10 +102,26 @@ got += r[which] return got - def checkStdout(self, expected): - expected = expected.replace("\n", "\r\n", 1000) # PTY does this - got = self.getfile('stdout') - self.assertEquals(got, expected) + def checkOutput(self, expected): + """ + @type expected: list of (streamname, contents) tuples + @param expected: the expected output + """ + if self.usePTY: + # PTYs change the line ending. I'm not sure why. + expected = [(stream, contents.replace("\n", "\r\n", 1000)) + for (stream, contents) in expected] + # PTYs merge stdout+stderr into a single stream + expected = [('stdout', contents) + for (stream, contents) in expected] + # now merge everything into one string per stream + streams = {} + for (stream, contents) in expected: + streams[stream] = streams.get(stream, "") + contents + for (stream, contents) in streams.items(): + got = self.getfile(stream) + self.assertEquals(got, contents) + def getrc(self): self.failUnless(self.results[-1].has_key('rc')) got = self.results[-1]['rc'] @@ -118,8 +135,8 @@ args = {'command': cmd, 'workdir': '.', 'timeout': 5} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) - self.checkStdout("this is stdout\n" - "this is stderr\n") + self.checkOutput([('stdout', "this is stdout\n"), + ('stderr', "this is stderr\n")]) self.checkrc(0) def testShell2(self): @@ -127,8 +144,8 @@ args = {'command': cmd, 'workdir': '.', 'timeout': 5} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) - self.checkStdout("this is stdout\n" - "this is stderr\n") + self.checkOutput([('stdout', "this is stdout\n"), + ('stderr', "this is stderr\n")]) self.checkrc(1) def testShell3(self): @@ -137,10 +154,10 @@ 'env': {'EMIT_TEST': "envtest"}, 'timeout': 5} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) - self.checkStdout("this is stdout\n" - "this is stderr\n" - "EMIT_TEST: envtest\n" - ) + self.checkOutput([('stdout', "this is stdout\n"), + ('stderr', "this is stderr\n"), + ('stdout', "EMIT_TEST: envtest\n"), + ]) self.checkrc(0) def testShell4(self): @@ -148,8 +165,8 @@ args = {'command': cmd, 'workdir': "subdir", 'timeout': 5} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) - self.checkStdout("this is stdout in subdir\n" - "this is stderr\n") + self.checkOutput([('stdout', "this is stdout in subdir\n"), + ('stderr', "this is stderr\n")]) self.checkrc(0) def testShellZ(self): @@ -158,7 +175,7 @@ failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) self.failUnless(self.getrc() != 0) - got = self.getfile('stdout') + got = self.getfile('stdout') + self.getfile('stderr') self.failUnless(re.search(r'no such file', got, re.I) # unix or re.search(r'cannot find the path specified', got, re.I) # win32 @@ -167,3 +184,9 @@ # todo: interrupt(), kill process # todo: twisted-specific command tests + + +if runtime.platformType == 'posix': + # test with PTYs also + class ShellPTY(Shell): + usePTY = True From warner at users.sourceforge.net Thu Apr 21 20:07:29 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 21 Apr 2005 20:07:29 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_trial.py,1.4,NONE Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3081/buildbot/test Removed Files: test_trial.py Log Message: remove it. This requires some functionality out of Twisted that isn't there yet, and until then having it around just confuses things. --- test_trial.py DELETED --- From warner at users.sourceforge.net Thu Apr 21 20:07:30 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 21 Apr 2005 20:07:30 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.362,1.363 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3081 Modified Files: ChangeLog Log Message: remove it. This requires some functionality out of Twisted that isn't there yet, and until then having it around just confuses things. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.362 retrieving revision 1.363 diff -u -d -r1.362 -r1.363 --- ChangeLog 21 Apr 2005 19:53:33 -0000 1.362 +++ ChangeLog 21 Apr 2005 20:07:27 -0000 1.363 @@ -1,5 +1,9 @@ 2005-04-21 Brian Warner + * buildbot/test/test_trial.py: remove it. This requires some + functionality out of Twisted that isn't there yet, and until then + having it around just confuses things. + * buildbot/test/test_slavecommand.py (Shell): test both with and without PTYs, and make sure that command output is properly interleaved in the with-PTY case. I think the without-PTY test From warner at users.sourceforge.net Thu Apr 21 20:56:25 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 21 Apr 2005 20:56:25 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31889/buildbot/scripts Modified Files: runner.py Log Message: (createMaster,createSlave): rewrite 'buildbot' command to put a little Makefile in the target that helps you re-create the buildbot.tap file, start or stop the master/slave, and reconfigure (i.e. SIGHUP) the master. Also chmod all the files 0600, since they contain passwords. (start): if there is a Makefile, and /usr/bin/make exists, use 'make start' in preference to a raw twistd command. This lets slave admins put things like PYTHONPATH variables in their Makefiles and have them still work when the slave is started with 'buildbot start ~/slave/foo'. The test is a bit clunky, it would be nice to first try the 'make' command and only fall back to twistd if it fails. TODO: the Makefile's "start" command does not add the --reactor=win32 argument when running under windows. Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- runner.py 8 Nov 2004 09:03:21 -0000 1.7 +++ runner.py 21 Apr 2005 20:56:22 -0000 1.8 @@ -10,79 +10,103 @@ # the create/start/stop commands should all be run as the same user, # preferably a separate 'buildbot' account. -def createMaster(config): - basedir = os.path.abspath(config['basedir']) - force = config['force'] - quiet = config['quiet'] - if os.path.exists(basedir) and not force: - print "basedir %s already exists and --force not used" % basedir - print "refusing to touch existing setup" - sys.exit(1) - if not os.path.exists(basedir): - if not quiet: print "mkdir", basedir - os.mkdir(basedir) +class Maker: + def __init__(self, config): + self.basedir = os.path.abspath(config['basedir']) + self.force = config['force'] + self.quiet = config['quiet'] - if not quiet: print "chdir", basedir - os.chdir(basedir) + def mkdir(self): + if os.path.exists(self.basedir) and not self.force: + print ("basedir %s already exists and --force not used" + % self.basedir) + print "refusing to touch existing setup" + sys.exit(1) + if not os.path.exists(self.basedir): + if not self.quiet: print "mkdir", self.basedir + os.mkdir(self.basedir) - cmd = "mktap buildbot master --basedir %s" % basedir - if not quiet: print cmd - status = os.system(cmd) - if status != 0: - print "mktap failed, bailing.." - sys.exit(1) + def chdir(self): + if not self.quiet: print "chdir", self.basedir + os.chdir(self.basedir) - target = "master.cfg" - if os.path.exists(target): - print "not touching existing master.cfg" - print "installing sample in master.cfg.sample instead" - target = "master.cfg.sample" - sampleconfig = util.sibpath(__file__, "sample.cfg") - shutil.copy(sampleconfig, target) + def mktap(self, cmd): + if not self.quiet: print cmd + status = os.system(cmd) + if status != 0: + print "mktap failed, bailing.." + sys.exit(1) + if not os.path.exists("buildbot.tap"): + print "mktap failed to create buildbot.tap, bailing.." + sys.exit(1) + os.chmod("buildbot.tap", 0600) - target = "Makefile" - if os.path.exists(target): - print "not touching existing Makefile" - print "installing sample in Makefile.sample instead" - target = "Makefile.sample" - samplemk = util.sibpath(__file__, "sample.mk") - shutil.copy(samplemk, target) + def makefile(self, source, cmd): + target = "Makefile" + if os.path.exists(target): + print "not touching existing Makefile" + print "installing sample in Makefile.sample instead" + target = "Makefile.sample" + shutil.copy(source, target) + f = open(target, "a") + f.write("\n") + f.write("tap:\n") + f.write("\t" + cmd + "\n") + f.write("\n") + f.close() + os.chmod(target, 0600) - if not quiet: print "buildmaster configured in %s" % basedir + def sampleconfig(self, source): + target = "master.cfg" + if os.path.exists(target): + print "not touching existing master.cfg" + print "installing sample in master.cfg.sample instead" + target = "master.cfg.sample" + shutil.copy(source, target) + os.chmod(target, 0600) + +def createMaster(config): + m = Maker(config) + m.mkdir() + m.chdir() + + cmd = "mktap buildbot master --basedir %s" % m.basedir + + m.mktap(cmd) + m.sampleconfig(util.sibpath(__file__, "sample.cfg")) + m.makefile(util.sibpath(__file__, "sample.mk"), cmd) + + if not m.quiet: print "buildmaster configured in %s" % m.basedir sys.exit(0) def createSlave(config): - basedir = os.path.abspath(config['basedir']) - force = config['force'] - quiet = config['quiet'] - if os.path.exists(basedir) and not force: - print "basedir %s already exists and --force not used" % basedir - print "refusing to touch existing setup" - sys.exit(1) - if not os.path.exists(basedir): - if not quiet: print "mkdir", basedir - os.mkdir(basedir) - if not quiet: print "chdir", basedir - os.chdir(basedir) + m = Maker(config) + m.mkdir() + m.chdir() + cmd = ("mktap buildbot slave " + "--basedir %s --master %s --name %s --passwd %s" \ - % (basedir, config['master'], config['name'], config['passwd'])) - if not quiet: print cmd - status = os.system(cmd) - if status != 0: - print "mktap failed, bailing.." - sys.exit(1) - if not quiet: print "buildslave configured in %s" % basedir + % (m.basedir, config['master'], config['name'], config['passwd'])) + + m.mktap(cmd) + m.makefile(util.sibpath(__file__, "sample.mk"), cmd) + + if not m.quiet: print "buildslave configured in %s" % m.basedir sys.exit(0) def start(config): basedir = config['basedir'] quiet = config['quiet'] os.chdir(basedir) - reactor_arg = "" - if sys.platform == "win32": - reactor_arg = "--reactor=win32" - cmd = "twistd %s --no_save -f buildbot.tap" % reactor_arg + if os.path.exists("/usr/bin/make") and os.path.exists("Makefile"): + # yes, this is clunky. Preferring the Makefile lets slave admins do + # useful things like set up environment variables for the buildslave. + cmd = "make start" + else: + reactor_arg = "" + if sys.platform == "win32": + reactor_arg = "--reactor=win32" + cmd = "twistd %s --no_save -f buildbot.tap" % reactor_arg if not quiet: print cmd os.system(cmd) sys.exit(0) From warner at users.sourceforge.net Thu Apr 21 20:56:26 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 21 Apr 2005 20:56:26 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.363,1.364 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31889 Modified Files: ChangeLog Log Message: (createMaster,createSlave): rewrite 'buildbot' command to put a little Makefile in the target that helps you re-create the buildbot.tap file, start or stop the master/slave, and reconfigure (i.e. SIGHUP) the master. Also chmod all the files 0600, since they contain passwords. (start): if there is a Makefile, and /usr/bin/make exists, use 'make start' in preference to a raw twistd command. This lets slave admins put things like PYTHONPATH variables in their Makefiles and have them still work when the slave is started with 'buildbot start ~/slave/foo'. The test is a bit clunky, it would be nice to first try the 'make' command and only fall back to twistd if it fails. TODO: the Makefile's "start" command does not add the --reactor=win32 argument when running under windows. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.363 retrieving revision 1.364 diff -u -d -r1.363 -r1.364 --- ChangeLog 21 Apr 2005 20:07:27 -0000 1.363 +++ ChangeLog 21 Apr 2005 20:56:23 -0000 1.364 @@ -1,5 +1,19 @@ 2005-04-21 Brian Warner + * buildbot/scripts/runner.py (createMaster,createSlave): rewrite + 'buildbot' command to put a little Makefile in the target that + helps you re-create the buildbot.tap file, start or stop the + master/slave, and reconfigure (i.e. SIGHUP) the master. Also chmod + all the files 0600, since they contain passwords. + (start): if there is a Makefile, and /usr/bin/make exists, use + 'make start' in preference to a raw twistd command. This lets + slave admins put things like PYTHONPATH variables in their + Makefiles and have them still work when the slave is started with + 'buildbot start ~/slave/foo'. The test is a bit clunky, it would + be nice to first try the 'make' command and only fall back to + twistd if it fails. TODO: the Makefile's "start" command does not + add the --reactor=win32 argument when running under windows. + * buildbot/test/test_trial.py: remove it. This requires some functionality out of Twisted that isn't there yet, and until then having it around just confuses things. From warner at users.sourceforge.net Fri Apr 22 02:57:24 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 02:57:24 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.364,1.365 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4617 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-61 Creator: Brian Warner move debugclient and status client into 'buildbot' command * buildbot/scripts/runner.py (Options.debugclient, Options.statusgui): add sub-commands to launch the debug client (formerly in contrib/debugclient.py) and the Gtk status application (currently broken) * buildbot/clients/debug.py: move from contrib/debugclient.py * buildbot/clients/debug.glade: same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.364 retrieving revision 1.365 diff -u -d -r1.364 -r1.365 --- ChangeLog 21 Apr 2005 20:56:23 -0000 1.364 +++ ChangeLog 22 Apr 2005 02:57:22 -0000 1.365 @@ -13,6 +13,11 @@ be nice to first try the 'make' command and only fall back to twistd if it fails. TODO: the Makefile's "start" command does not add the --reactor=win32 argument when running under windows. + (Options.debugclient, Options.statusgui): add sub-commands to launch + the debug client (formerly in contrib/debugclient.py) and the + Gtk status application (currently broken) + * buildbot/clients/debug.py: move from contrib/debugclient.py + * buildbot/clients/debug.glade: same * buildbot/test/test_trial.py: remove it. This requires some functionality out of Twisted that isn't there yet, and until then From warner at users.sourceforge.net Fri Apr 22 02:57:24 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 02:57:24 +0000 Subject: [Buildbot-commits] buildbot/contrib debug.glade,1.6,NONE debugclient.py,1.5,NONE Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4617/contrib Removed Files: debug.glade debugclient.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-61 Creator: Brian Warner move debugclient and status client into 'buildbot' command * buildbot/scripts/runner.py (Options.debugclient, Options.statusgui): add sub-commands to launch the debug client (formerly in contrib/debugclient.py) and the Gtk status application (currently broken) * buildbot/clients/debug.py: move from contrib/debugclient.py * buildbot/clients/debug.glade: same --- debug.glade DELETED --- --- debugclient.py DELETED --- From warner at users.sourceforge.net Fri Apr 22 02:57:23 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 02:57:23 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.8,1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4617/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-61 Creator: Brian Warner move debugclient and status client into 'buildbot' command * buildbot/scripts/runner.py (Options.debugclient, Options.statusgui): add sub-commands to launch the debug client (formerly in contrib/debugclient.py) and the Gtk status application (currently broken) * buildbot/clients/debug.py: move from contrib/debugclient.py * buildbot/clients/debug.glade: same Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- runner.py 21 Apr 2005 20:56:22 -0000 1.8 +++ runner.py 22 Apr 2005 02:57:21 -0000 1.9 @@ -1,5 +1,7 @@ #! /usr/bin/python +# N.B.: don't import anything that might pull in a reactor yet. Some of our +# subcommands want to load modules that need the gtk reactor. import os, os.path, sys, shutil from twisted.python import usage, util @@ -167,6 +169,51 @@ def getSynopsis(self): return "Usage: buildbot stop " +class DebugClientOptions(usage.Options): + optFlags = [ + ['help', 'h', "Display this message"], + ] + optParameters = [ + ["master", "m", "localhost:8007", + "Location of the buildmaster's slaveport (host:port)"], + ["passwd", "p", "debugpw", "Debug password to use"], + ] + + def parseArgs(self, *args): + if len(args) > 0: + self['master'] = args[0] + if len(args) > 1: + self['passwd'] = args[1] + if len(args) > 2: + raise usage.UsageError("I wasn't expecting so many arguments") + +def debugclient(config): + from buildbot.clients import debug + print "config is", config + d = debug.DebugWidget(config['master'], config['passwd']) + d.run() + +class StatusGuiClientOptions(usage.Options): + optFlags = [ + ['help', 'h', "Display this message"], + ] + optParameters = [ + ["master", "m", "localhost:8007", + "Location of the buildmaster's status port (host:port)"], + ] + + def parseArgs(self, *args): + if len(args) > 0: + self['master'] = args[0] + if len(args) > 1: + raise usage.UsageError("I wasn't expecting so many arguments") + +def statusgui(config): + from buildbot.clients import gtkPanes + c = gtkPanes.CompactGtkClient() + c.startConnecting(config['master']) + reactor.run() + class Options(usage.Options): synopsis = "Usage: buildbot [command options]" @@ -181,6 +228,12 @@ ['sighup', None, StopOptions, "SIGHUP a buildmaster to make it re-read the config file"], + ['debugclient', None, DebugClientOptions, + "Launch a small debug panel GUI"], + + ['status_gui', None, StatusGuiClientOptions, + "Display a small window showing current builder status"], + # TODO: 'try', 'watch' ] @@ -213,3 +266,7 @@ stop(so) elif command == "sighup": stop(so, "-HUP") + elif command == "debugclient": + debugclient(so) + elif command == "status_gui": + statusgui(so) From warner at users.sourceforge.net Fri Apr 22 02:57:25 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 02:57:25 +0000 Subject: [Buildbot-commits] buildbot/buildbot/clients debug.glade,NONE,1.1 debug.py,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4617/buildbot/clients Added Files: debug.glade debug.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-61 Creator: Brian Warner move debugclient and status client into 'buildbot' command * buildbot/scripts/runner.py (Options.debugclient, Options.statusgui): add sub-commands to launch the debug client (formerly in contrib/debugclient.py) and the Gtk status application (currently broken) * buildbot/clients/debug.py: move from contrib/debugclient.py * buildbot/clients/debug.glade: same --- NEW FILE: debug.glade --- True Buildbot Debug Tool GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True False 0 True False 0 True True Connect True GTK_RELIEF_NORMAL True 0 False False True Disconnected False False GTK_JUSTIFY_CENTER False False 0.5 0.5 0 0 0 True True 0 False False True False 0 True True Reload .cfg True GTK_RELIEF_NORMAL True 0 False False True False True Rebuild .py True GTK_RELIEF_NORMAL True 0 False False True True poke IRC True GTK_RELIEF_NORMAL True 0 False False 0 True True 4 True 0 0.5 GTK_SHADOW_ETCHED_IN True 0.5 0.5 1 1 0 0 0 0 True False 0 True False 0 True True commit True GTK_RELIEF_NORMAL True 0 False False True True True True 0 twisted/internet/app.py True * False 0 True True 0 True True True False 0 True Who: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True 0 bob True * False 0 True True 0 True True True False 0 True True Revision: True GTK_RELIEF_NORMAL True False False True 0 False False True True True True 0 True * False 0 True True 0 True True True Commit False False GTK_JUSTIFY_LEFT False False 0.5 0.5 2 0 label_item 0 True True 4 True 0 0.5 GTK_SHADOW_ETCHED_IN True False 0 True False 3 True Builder: False False GTK_JUSTIFY_CENTER False False 0.5 0.5 0 0 0 False False True True True True 0 one True * False 0 True True 0 True True True False 0 True True Force Build True GTK_RELIEF_NORMAL True 0 False False 0 True True True False 0 True Currently: False False GTK_JUSTIFY_CENTER False False 0.5 0.5 7 0 0 False False True True offline True GTK_RELIEF_NORMAL True 0 False False True True idle True GTK_RELIEF_NORMAL True 0 False False True True waiting True GTK_RELIEF_NORMAL True 0 False False True True building True GTK_RELIEF_NORMAL True 0 False False 0 True True True Builder False False GTK_JUSTIFY_LEFT False False 0.5 0.5 2 0 label_item 0 True True --- NEW FILE: debug.py --- #! /usr/bin/python from twisted.internet import gtk2reactor gtk2reactor.install() from twisted.internet import reactor from twisted.python import util from twisted.spread import pb from twisted.cred import credentials import gtk, gtk.glade, gnome.ui import os, sys, re class DebugWidget: def __init__(self, master="localhost:8007", passwd="debugpw"): self.connected = 0 try: host, port = re.search(r'(.+):(\d+)', master).groups() except: print "unparseable master location '%s'" % master print " expecting something more like localhost:8007" raise self.host = host self.port = int(port) self.passwd = passwd self.remote = None xml = self.xml = gtk.glade.XML(util.sibpath(__file__, "debug.glade")) g = xml.get_widget self.buildname = g('buildname') self.filename = g('filename') self.connectbutton = g('connectbutton') self.connectlabel = g('connectlabel') g('window1').connect('destroy', lambda win: gtk.mainquit()) c = xml.signal_connect c('do_connect', self.do_connect) c('do_reload', self.do_reload) c('do_rebuild', self.do_rebuild) c('do_poke_irc', self.do_poke_irc) c('do_build', self.do_build) c('do_commit', self.do_commit) c('on_userevision_toggled', self.userevision_toggled) self.userevision_toggled(g('userevision')) c('do_current_offline', self.do_current, "offline") c('do_current_idle', self.do_current, "idle") c('do_current_waiting', self.do_current, "waiting") c('do_current_building', self.do_current, "building") def do_connect(self, widget): if self.connected: self.connectlabel.set_text("Disconnecting...") if self.remote: self.remote.broker.transport.loseConnection() else: self.connectlabel.set_text("Connecting...") f = pb.PBClientFactory() creds = credentials.UsernamePassword("debug", self.passwd) d = f.login(creds) reactor.connectTCP(self.host, int(self.port), f) d.addCallbacks(self.connect_complete, self.connect_failed) def connect_complete(self, ref): self.connectbutton.set_label("Disconnect") self.connectlabel.set_text("Connected") self.connected = 1 self.remote = ref self.remote.callRemote("print", "hello cleveland") self.remote.notifyOnDisconnect(self.disconnected) def connect_failed(self, why): self.connectlabel.set_text("Failed") print why def disconnected(self, ref): self.connectbutton.set_label("Connect") self.connectlabel.set_text("Disconnected") self.connected = 0 self.remote = None def do_reload(self, widget): if not self.remote: return d = self.remote.callRemote("reload") d.addErrback(self.err) def do_rebuild(self, widget): print "Not yet implemented" return def do_poke_irc(self, widget): if not self.remote: return d = self.remote.callRemote("pokeIRC") d.addErrback(self.err) def do_build(self, widget): if not self.remote: return name = self.buildname.get_text() d = self.remote.callRemote("forceBuild", name) d.addErrback(self.err) def userevision_toggled(self, widget): rev = self.xml.get_widget('revision') if widget.get_active(): rev.set_sensitive(True) else: rev.set_sensitive(False) def do_commit(self, widget): if not self.remote: return filename = self.filename.get_text() who = self.xml.get_widget("who").get_text() revision = None if self.xml.get_widget("userevision").get_active(): revision = self.xml.get_widget('revision').get_text() try: revision = int(revision) except ValueError: pass d = self.remote.callRemote("fakeChange", filename, revision=revision, who=who) d.addErrback(self.err) def do_current(self, widget, state): if not self.remote: return name = self.buildname.get_text() d = self.remote.callRemote("setCurrentState", name, state) d.addErrback(self.err) def err(self, failure): print "received error" failure.printTraceback() def run(self): reactor.run() if __name__ == '__main__': master = "localhost:8007" if len(sys.argv) > 1: master = sys.argv[1] passwd = "debugpw" if len(sys.argv) > 2: passwd = sys.argv[2] d = DebugWidget(master, passwd) d.run() From warner at users.sourceforge.net Fri Apr 22 03:55:55 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 03:55:55 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.365,1.366 Makefile,1.5,1.6 NEWS,1.37,1.38 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv373 Modified Files: ChangeLog Makefile NEWS Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-63 Creator: Brian Warner deprecation warnings 2005-04-21 Brian Warner * Makefile: minor tweaks * NEWS: point out deprecation warnings, new features for /usr/bin/buildbot * buildbot/master.py (BuildMaster.loadConfig): emit DeprecationWarnings for Builders defined with tuples. Rearrange code to facility removal of deprecated configuration keys in the next release. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.365 retrieving revision 1.366 diff -u -d -r1.365 -r1.366 --- ChangeLog 22 Apr 2005 02:57:22 -0000 1.365 +++ ChangeLog 22 Apr 2005 03:55:52 -0000 1.366 @@ -1,5 +1,15 @@ 2005-04-21 Brian Warner + * Makefile: minor tweaks + + * NEWS: point out deprecation warnings, new features for + /usr/bin/buildbot + + * buildbot/master.py (BuildMaster.loadConfig): emit + DeprecationWarnings for Builders defined with tuples. Rearrange + code to facility removal of deprecated configuration keys in the + next release. + * buildbot/scripts/runner.py (createMaster,createSlave): rewrite 'buildbot' command to put a little Makefile in the target that helps you re-create the buildbot.tap file, start or stop the Index: Makefile =================================================================== RCS file: /cvsroot/buildbot/buildbot/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 18 Apr 2005 00:26:57 -0000 1.5 +++ Makefile 22 Apr 2005 03:55:53 -0000 1.6 @@ -2,7 +2,7 @@ # this is just a convenience for developers, and to automate the release # process a little bit. This Makefile is not included in the source tarball. -BBBASE = ~/stuff/Projects/BuildBot/sourceforge +BBBASE = $(PWD) ifdef SVN T=~/stuff/python/twisted/Twisted else Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- NEWS 20 Apr 2005 23:28:27 -0000 1.37 +++ NEWS 22 Apr 2005 03:55:53 -0000 1.38 @@ -2,12 +2,27 @@ * Release X.X.X (XX) -** API docs +** 'buildbot' tool gets more uses -Thanks to Thomas Vander Stichele, most of the docstrings have been converted -to epydoc format. There is a utility in docs/gen-reference to turn these into -a tree of cross-referenced HTML pages. Eventually these docs will be -auto-generated and somehow published on the buildbot web page. +The 'buildbot' executable has acquired two new subcommands. 'buildbot +debugclient' brings up the small remote-control panel that connects to a +buildmaster (via the slave port and the c['debugPassword']). This tool, +formerly in contrib/debugclient.py, lets you reload the config file, force +builds, and simulate inbound commit messages. It requires gtk2, glade, and +the python bindings for both to be installed. + +'buildbot status_gui' brings up a live status client, formerly available by +running buildbot/clients/gtkPanes.py as a program. This connects to the PB +status port that you create with: + + c['status'].append(client.PBListener(portnum)) + +and shows two boxes per Builder, one for the last build, one for current +activity. These boxes are updated in realtime. The effect is primitive, but +is intended as an example of what's possible with the PB status interface. + +Note: both names are subject to change. The status_gui is currently +completely broken, but I might manage to fix it before the next release. ** web page has a favicon @@ -16,6 +31,38 @@ requested. Many web browsers display this as an icon next to the URL or bookmark. A goofy little default icon is included. +** Deprecated features + +*** defining Builders with tuples is deprecated + +For a long time, the preferred way to define builders in the config file has +been with a dictionary. The less-flexible old style of a 4-item tuple (name, +slavename, builddir, factory) is now officially deprecated (i.e., it will +emit a warning if you use it), and will be removed in the next release. +Dictionaries are more flexible: additional keys like periodicBuildTime are +simply unavailable to tuple-defined builders. + +Note: it is a good idea to watch the logfile (usually in twistd.log) when you +first start the buildmaster, or whenever you reload the config file. Any +warnings or errors in the config file will be found there. + +*** c['webPortnum'], c['webPathname'], c['irc'] are deprecated + +All status reporters should be defined in the c['status'] array, using +buildbot.status.html.Waterfall or buildbot.status.words.IRC . These have been +deprecated for a while, but this is fair warning that these keys will be +removed in the next release. + +*** c['manholePort'] is deprecated + +Again, this has been deprecated for a while, in favor of: + + c['manhole'] = master.Manhole(port, username, password) + +The preferred syntax will eventually let us use other, better kinds of debug +shells, such as the experimental curses-based ones in the Twisted sandbox +(which would offer command-line editing and history). + ** bug fixes The waterfall page has been improved a bit. A circular-reference bug in the @@ -40,6 +87,13 @@ Thankt to Nick Trout, more compatibility fixes have been incorporated, improving the chances that the unit tests will pass on windows systems. +** API docs + +Thanks to Thomas Vander Stichele, most of the docstrings have been converted +to epydoc format. There is a utility in docs/gen-reference to turn these into +a tree of cross-referenced HTML pages. Eventually these docs will be +auto-generated and somehow published on the buildbot web page. + * Release 0.6.2 (13 Dec 2004) From warner at users.sourceforge.net Fri Apr 22 03:55:54 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 03:55:54 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.59,1.60 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv373/buildbot Modified Files: master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-63 Creator: Brian Warner deprecation warnings 2005-04-21 Brian Warner * Makefile: minor tweaks * NEWS: point out deprecation warnings, new features for /usr/bin/buildbot * buildbot/master.py (BuildMaster.loadConfig): emit DeprecationWarnings for Builders defined with tuples. Rearrange code to facility removal of deprecated configuration keys in the next release. Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- master.py 19 Apr 2005 07:45:20 -0000 1.59 +++ master.py 22 Apr 2005 03:55:52 -0000 1.60 @@ -674,10 +674,11 @@ log.err("config file must define BuildmasterConfig") raise - known_keys = "bots sources builders slavePortnum irc " + \ - "webPortnum webPathname debugPassword manhole " + \ + known_keys = "bots sources builders slavePortnum " + \ + "debugPassword manhole " + \ "interlocks status projectName projectURL buildbotURL" - known_keys = known_keys.split() + deprecated_keys = "webPortnum webPathname irc" + known_keys = (known_keys + " " + deprecated_keys).split() for k in config.keys(): if k not in known_keys: log.msg("unknown key '%s' defined in config dictionary" % k) @@ -728,12 +729,30 @@ raise TypeError, "webPortnum '%s' must be an int" % webPortnum for s in status: assert interfaces.IStatusReceiver(s) - if 0: # tuple-specified builders are a problem - slavenames = [name for name,pw in bots] - for b in builders: - if b['slavename'] not in slavenames: - raise ValueError("builder %s uses undefined slave %s" \ - % (b['name'], b['slavename'])) + + slavenames = [name for name,pw in bots] + buildernames = [] + dirnames = [] + for b in builders: + if type(b) is tuple: + warnings.warn("defining builder %s with a tuple is deprecated" + ", please use a dict instead" % b[0], + DeprecationWarning) + continue + if type(b) is tuple: + raise ValueError("builder %s must be defined with a dict, " + "not a tuple" % b[0]) + if b['slavename'] not in slavenames: + raise ValueError("builder %s uses undefined slave %s" \ + % (b['name'], b['slavename'])) + if b['name'] in buildernames: + raise ValueError("duplicate builder name %s" + % b['name']) + buildernames.append(b['name']) + if b['builddir'] in dirnames: + raise ValueError("builder %s reuses builddir %s" + % (b['name'], b['builddir'])) + dirnames.append(b['builddir']) # now we're committed to implementing the new configuration, so do # it atomically @@ -826,8 +845,7 @@ newNames = [] newList = {} for data in newBuilders: - if type(data) == type(()): - # TODO: DeprecationWarning + if type(data) is tuple: name, slavename, builddir, factory = data data = {'name': name, 'slavename': slavename, From warner at users.sourceforge.net Fri Apr 22 07:36:02 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 07:36:02 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7910/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-65 Creator: Brian Warner let 'buildbot statusgui' really just run the text client * buildbot/scripts/runner.py (statusgui): use the text client for now, while I rewrite the Gtk one * buildbot/clients/base.py: strip out old code, leaving just the basic print-message-on-event functionality. I also remove the ReconnectingPBClientFactory, but it does at least quit when it loses the connection instead of going silent Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- runner.py 22 Apr 2005 02:57:21 -0000 1.9 +++ runner.py 22 Apr 2005 07:35:58 -0000 1.10 @@ -209,10 +209,11 @@ raise usage.UsageError("I wasn't expecting so many arguments") def statusgui(config): - from buildbot.clients import gtkPanes - c = gtkPanes.CompactGtkClient() - c.startConnecting(config['master']) - reactor.run() + #from buildbot.clients import gtkPanes + #c = gtkPanes.CompactGtkClient() + from buildbot.clients import base + c = base.TextClient(config['master']) + c.run() class Options(usage.Options): synopsis = "Usage: buildbot [command options]" From warner at users.sourceforge.net Fri Apr 22 07:36:03 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 07:36:03 +0000 Subject: [Buildbot-commits] buildbot/buildbot/clients base.py,1.10,1.11 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7910/buildbot/clients Modified Files: base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-65 Creator: Brian Warner let 'buildbot statusgui' really just run the text client * buildbot/scripts/runner.py (statusgui): use the text client for now, while I rewrite the Gtk one * buildbot/clients/base.py: strip out old code, leaving just the basic print-message-on-event functionality. I also remove the ReconnectingPBClientFactory, but it does at least quit when it loses the connection instead of going silent Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/clients/base.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- base.py 21 Sep 2004 07:15:44 -0000 1.10 +++ base.py 22 Apr 2005 07:36:01 -0000 1.11 @@ -6,114 +6,25 @@ from twisted.cred import credentials from twisted.internet import reactor -from buildbot.pbutil import ReconnectingPBClientFactory - -from buildbot.status import event - -class UpdatingEvent(event.RemoteEvent): - def observe_setFiles(self, filesdict): - event.RemoteEvent.observe_setFiles(self, filesdict) - pass - def observe_update(self, **kwargs): - event.RemoteEvent.observe_update(self, **kwargs) - print "%s: update: %s" % (self.builder.name, kwargs) - def observe_addFile(self, name, file): - event.RemoteEvent.observe_addFile(self, name, file) - pass - def observe_finish(self): - event.RemoteEvent.observe_finish(self) - pass -pb.setUnjellyableForClass(event.Event, UpdatingEvent) - -from twisted.python import log -#log.startLogging(sys.stdout) - -class Builder(pb.Referenceable): - def __init__(self, name, remote, parent): - self.name = name - self.remote = remote - self.parent = parent - self.current = None - remote.notifyOnDisconnect(self.disconnect) - self.setup() - def setup(self): - pass - def subscribe(self): - self.remote.callRemote("subscribe", self) - # after this, we will get all methods except appendFiles - #self.remote.callRemote("subscribeFiles") - def goAway(self): - self.unsubscribe() - def disconnect(self, remote): - self.parent.removeBuilder(self.name) - def unsubscribe(self): - self.remote.callRemote("unsubscribeFiles") - self.remote.callRemote("unsubscribe") - self.remote.dontNotifyOnDisconnect(self.disconnect) - - # last-build-status - def remote_newLastBuildStatus(self, event): - print "%s: newLastBuildStatus: %s" % (self.name, event) - - # current-activity-big - def remote_currentlyOffline(self): - print "%s: big=offline" % self.name - def remote_currentlyIdle(self): - print "%s: big=idle" % self.name - def remote_currentlyWaiting(self, seconds): - print "%s: big=waiting" % self.name, seconds - def remote_currentlyInterlocked(self): - print "%s: big=interlocked" % self.name - def remote_currentlyBuilding(self, eta): - print "%s: big=building" % self.name, eta - if eta: - d = eta.callRemote("subscribe", self, 1) - # TODO: addCallback - # results in _progress, _finished messages - - # current-activity-small - def remote_newEvent(self, event): - assert(event.__class__ == UpdatingEvent) - print "%s: newEvent: %s" % (self.name, event) - self.current = event - event.builder = self - - # from the BuildProgress object - def remote_progress(self, seconds): - print "%s: progress: %s" % (self.name, seconds) - def remote_finished(self, eta): - print "%s: finished" % self.name - eta.callRemote("unsubscribe", self) - -class Client(pb.Referenceable): +class StatusClient(pb.Referenceable): """To use this, call my .connected method with a RemoteReference to the - buildmaster's status port object. + buildmaster's StatusClientPerspective object. """ - BuilderClass = Builder - def __init__(self): + def __init__(self, events): self.builders = {} + self.events = events - def done(*args): - reactor.stop() - - def addBuilder(self, name, builder): - self.builders[name] = builder - #builder.subscribe() - def removeBuilder(self, name): - del self.builders[name] + def connected(self, remote): + print "connected" + self.remote = remote + remote.callRemote("subscribe", self.events, 5, self) def remote_builderAdded(self, buildername, builder): - # get get a remote interface to an IBuilderStatus - #b = self.BuilderClass(name, remote, self) print "builderAdded", buildername - #self.addBuilder(name, b) - #return b def remote_builderRemoved(self, buildername): print "builderRemoved", buildername - #self.builders[name].goAway() - #self.removeBuilder(name) def remote_builderChangedState(self, buildername, state, eta): print "builderChangedState", buildername, state, eta @@ -150,37 +61,50 @@ ChunkTypes = ["STDOUT", "STDERR", "HEADER"] print "logChunk[%s]: %s" % (ChunkTypes[channel], text) - def connected(self, remote): - print "connected" - self.remote = remote - remote.callRemote("subscribe", "logs", 3, self) +class TextClient: + def __init__(self, master, events="steps"): + self.master = master + self.listener = StatusClient(events) - def startConnecting(self, master): + def run(self): + """Start the TextClient. + @type events: string, one of builders, builds, steps, logs, full + @param events: specify what level of detail should be reported. + - 'builders': only announce new/removed Builders + - 'builds': also announce builderChangedState, buildStarted, and + buildFinished + - 'steps': also announce buildETAUpdate, stepStarted, stepFinished + - 'logs': also announce stepETAUpdate, logStarted, logFinished + - 'full': also announce log contents + """ + self.startConnecting() + reactor.run() + + def startConnecting(self): try: - host, port = re.search(r'(.+):(\d+)', master).groups() + host, port = re.search(r'(.+):(\d+)', self.master).groups() port = int(port) except: - print "unparseable master location '%s'" % master + print "unparseable master location '%s'" % self.master print " expecting something more like localhost:8007" raise - cf = ClientFactory() - cf.client = self - cf.startLogin(credentials.UsernamePassword("statusClient", - "clientpw")) + cf = pb.PBClientFactory() + creds = credentials.UsernamePassword("statusClient", "clientpw") + d = cf.login(creds) reactor.connectTCP(host, port, cf) + d.addCallback(self.connected) + return d + def connected(self, ref): + ref.notifyOnDisconnect(self.disconnected) + self.listener.connected(ref) + def disconnected(self, ref): + print "lost connection" + reactor.stop() -class ClientFactory(ReconnectingPBClientFactory): - def gotPerspective(self, perspective): - self.client.connected(perspective) - -def main(): +if __name__ == '__main__': master = "localhost:8007" if len(sys.argv) > 1: master = sys.argv[1] - c = Client() - c.startConnecting(master) - reactor.run() - -if __name__ == '__main__': - main() + c = TextClient() + c.run() From warner at users.sourceforge.net Fri Apr 22 07:36:03 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 07:36:03 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.366,1.367 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7910 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-65 Creator: Brian Warner let 'buildbot statusgui' really just run the text client * buildbot/scripts/runner.py (statusgui): use the text client for now, while I rewrite the Gtk one * buildbot/clients/base.py: strip out old code, leaving just the basic print-message-on-event functionality. I also remove the ReconnectingPBClientFactory, but it does at least quit when it loses the connection instead of going silent Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.366 retrieving revision 1.367 diff -u -d -r1.366 -r1.367 --- ChangeLog 22 Apr 2005 03:55:52 -0000 1.366 +++ ChangeLog 22 Apr 2005 07:36:00 -0000 1.367 @@ -1,3 +1,12 @@ +2005-04-22 Brian Warner + + * buildbot/scripts/runner.py (statusgui): use the text client for + now, while I rewrite the Gtk one + * buildbot/clients/base.py: strip out old code, leaving just the + basic print-message-on-event functionality. I also remove the + ReconnectingPBClientFactory, but it does at least quit when it + loses the connection instead of going silent + 2005-04-21 Brian Warner * Makefile: minor tweaks From warner at users.sourceforge.net Fri Apr 22 18:41:04 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 18:41:04 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.367,1.368 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18118 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-67 Creator: Brian Warner fix win32 error in slave-side VC fallback copy/clobber * buildbot/slave/commands.py (SourceBase.doClobber): when removing the previous tree on win32, where we have to do it synchronously, make sure we return a Deferred anyway. (SourceBase.doCopy): same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.367 retrieving revision 1.368 diff -u -d -r1.367 -r1.368 --- ChangeLog 22 Apr 2005 07:36:00 -0000 1.367 +++ ChangeLog 22 Apr 2005 18:41:01 -0000 1.368 @@ -1,5 +1,10 @@ 2005-04-22 Brian Warner + * buildbot/slave/commands.py (SourceBase.doClobber): when removing + the previous tree on win32, where we have to do it synchronously, + make sure we return a Deferred anyway. + (SourceBase.doCopy): same + * buildbot/scripts/runner.py (statusgui): use the text client for now, while I rewrite the Gtk one * buildbot/clients/base.py: strip out old code, leaving just the From warner at users.sourceforge.net Fri Apr 22 18:41:04 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 18:41:04 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.24,1.25 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18118/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-67 Creator: Brian Warner fix win32 error in slave-side VC fallback copy/clobber * buildbot/slave/commands.py (SourceBase.doClobber): when removing the previous tree on win32, where we have to do it synchronously, make sure we return a Deferred anyway. (SourceBase.doCopy): same Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- commands.py 20 Apr 2005 20:13:25 -0000 1.24 +++ commands.py 22 Apr 2005 18:41:02 -0000 1.25 @@ -591,7 +591,7 @@ # if we're running on w32, use rmtree instead. It will block, # but hopefully it won't take too long. shutil.rmtree(d, ignore_errors=1) - return + return defer.succeed(0) command = ["rm", "-rf", d] c = ShellCommand(self.builder, command, self.builder.basedir, sendRC=0, timeout=self.timeout) @@ -609,7 +609,7 @@ todir = os.path.join(self.builder.basedir, self.workdir) if runtime.platformType != "posix": shutil.copytree(fromdir, todir) - return + return defer.succeed(0) command = ['cp', '-r', '-p', fromdir, todir] c = ShellCommand(self.builder, command, self.builder.basedir, sendRC=False, timeout=self.timeout) From warner at users.sourceforge.net Fri Apr 22 21:29:20 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 21:29:20 +0000 Subject: [Buildbot-commits] buildbot/docs .arch-inventory,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/docs Added Files: .arch-inventory Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-69 Creator: Brian Warner fix propagation of changes to .builddir 2005-04-22 Brian Warner * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the whendone= argument, just return the Deferred and let the caller do what they want with it. (Disconnect.testBuild1): wait for shutdownSlave (Basedir.testChangeBuilddir): new test to make sure changes to the builddir actually get propagated to the slave * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an explicit method, rather than passing the builddir in __init__ . Make sure to update self.basedir too, this was broken before. (Bot.remote_setBuilderList): use b.setBuilddir for both new builders and for ones that have just had their builddir changed. (BotFactory): add a class-level .perspective attribute, so BuildSlave.waitUntilDisconnected won't get upset when the connection hasn't yet been established (BuildSlave.__init__): keep track of the bot.Bot instance, so tests can reach through it to inspect the SlaveBuilders * buildbot/process/base.py (Build.buildException): explain the log.err with a log.msg * buildbot/process/builder.py (Builder.startBuild): same (Builder._startBuildFailed): improve error message * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure occurred because we lost the brand-new connection, retry instead of giving up. If not, it's probably an authorization failure, and it makes sense to stop trying. Make sure we log.msg the reason that we're log.err'ing the failure, otherwise test failures are really hard to figure out. * buildbot/master.py: change loadConfig() to return a Deferred that doesn't fire until the change has been fully implemented. This means any connected slaves have been updated with the new builddir. This change makes it easier to test the code which actually implements this builddir-updating. (BotPerspective.addBuilder): return Deferred (BotPerspective.removeBuilder): same (BotPerspective.attached): same (BotPerspective._attached): same. finish with remote_print before starting the getSlaveInfo, instead of doing them in parallel (BotPerspective.list_done): same (BotMaster.removeSlave): same. Fix the typo that meant we weren't actually calling slave.disconnect() (BotMaster.addBuilder): same (BotMaster.removeBuilder): same (BuildMaster.loadConfig): same (BuildMaster.loadConfig_Slaves): same (BuildMaster.loadConfig_Sources): same (BuildMaster.loadConfig_Builders): same (BuildMaster.loadConfig_status): same * buildbot/changes/changes.py (ChangeMaster.removeSource): return a Deferred that fires when the source is finally removed --- NEW FILE: .arch-inventory --- junk ^reference$ From warner at users.sourceforge.net Fri Apr 22 21:29:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 21:29:22 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.368,1.369 .arch-inventory,1.1,1.2 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396 Modified Files: ChangeLog .arch-inventory Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-69 Creator: Brian Warner fix propagation of changes to .builddir 2005-04-22 Brian Warner * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the whendone= argument, just return the Deferred and let the caller do what they want with it. (Disconnect.testBuild1): wait for shutdownSlave (Basedir.testChangeBuilddir): new test to make sure changes to the builddir actually get propagated to the slave * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an explicit method, rather than passing the builddir in __init__ . Make sure to update self.basedir too, this was broken before. (Bot.remote_setBuilderList): use b.setBuilddir for both new builders and for ones that have just had their builddir changed. (BotFactory): add a class-level .perspective attribute, so BuildSlave.waitUntilDisconnected won't get upset when the connection hasn't yet been established (BuildSlave.__init__): keep track of the bot.Bot instance, so tests can reach through it to inspect the SlaveBuilders * buildbot/process/base.py (Build.buildException): explain the log.err with a log.msg * buildbot/process/builder.py (Builder.startBuild): same (Builder._startBuildFailed): improve error message * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure occurred because we lost the brand-new connection, retry instead of giving up. If not, it's probably an authorization failure, and it makes sense to stop trying. Make sure we log.msg the reason that we're log.err'ing the failure, otherwise test failures are really hard to figure out. * buildbot/master.py: change loadConfig() to return a Deferred that doesn't fire until the change has been fully implemented. This means any connected slaves have been updated with the new builddir. This change makes it easier to test the code which actually implements this builddir-updating. (BotPerspective.addBuilder): return Deferred (BotPerspective.removeBuilder): same (BotPerspective.attached): same (BotPerspective._attached): same. finish with remote_print before starting the getSlaveInfo, instead of doing them in parallel (BotPerspective.list_done): same (BotMaster.removeSlave): same. Fix the typo that meant we weren't actually calling slave.disconnect() (BotMaster.addBuilder): same (BotMaster.removeBuilder): same (BuildMaster.loadConfig): same (BuildMaster.loadConfig_Slaves): same (BuildMaster.loadConfig_Sources): same (BuildMaster.loadConfig_Builders): same (BuildMaster.loadConfig_status): same * buildbot/changes/changes.py (ChangeMaster.removeSource): return a Deferred that fires when the source is finally removed Index: .arch-inventory =================================================================== RCS file: /cvsroot/buildbot/buildbot/.arch-inventory,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .arch-inventory 11 Apr 2005 19:30:30 -0000 1.1 +++ .arch-inventory 22 Apr 2005 21:29:20 -0000 1.2 @@ -1,3 +1,4 @@ precious ^m$ precious ^s$ precious ^svn$ +junk ^_trial_temp$ Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.368 retrieving revision 1.369 diff -u -d -r1.368 -r1.369 --- ChangeLog 22 Apr 2005 18:41:01 -0000 1.368 +++ ChangeLog 22 Apr 2005 21:29:20 -0000 1.369 @@ -1,5 +1,59 @@ 2005-04-22 Brian Warner + * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the + whendone= argument, just return the Deferred and let the caller do + what they want with it. + (Disconnect.testBuild1): wait for shutdownSlave + (Basedir.testChangeBuilddir): new test to make sure changes to the + builddir actually get propagated to the slave + + * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an + explicit method, rather than passing the builddir in __init__ . + Make sure to update self.basedir too, this was broken before. + (Bot.remote_setBuilderList): use b.setBuilddir for both new + builders and for ones that have just had their builddir changed. + (BotFactory): add a class-level .perspective attribute, so + BuildSlave.waitUntilDisconnected won't get upset when the + connection hasn't yet been established + (BuildSlave.__init__): keep track of the bot.Bot instance, so + tests can reach through it to inspect the SlaveBuilders + + * buildbot/process/base.py (Build.buildException): explain the + log.err with a log.msg + * buildbot/process/builder.py (Builder.startBuild): same + (Builder._startBuildFailed): improve error message + + * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure + occurred because we lost the brand-new connection, retry instead + of giving up. If not, it's probably an authorization failure, and + it makes sense to stop trying. Make sure we log.msg the reason + that we're log.err'ing the failure, otherwise test failures are + really hard to figure out. + + * buildbot/master.py: change loadConfig() to return a Deferred + that doesn't fire until the change has been fully implemented. + This means any connected slaves have been updated with the new + builddir. This change makes it easier to test the code which + actually implements this builddir-updating. + (BotPerspective.addBuilder): return Deferred + (BotPerspective.removeBuilder): same + (BotPerspective.attached): same + (BotPerspective._attached): same. finish with remote_print before + starting the getSlaveInfo, instead of doing them in parallel + (BotPerspective.list_done): same + (BotMaster.removeSlave): same. Fix the typo that meant we weren't + actually calling slave.disconnect() + (BotMaster.addBuilder): same + (BotMaster.removeBuilder): same + (BuildMaster.loadConfig): same + (BuildMaster.loadConfig_Slaves): same + (BuildMaster.loadConfig_Sources): same + (BuildMaster.loadConfig_Builders): same + (BuildMaster.loadConfig_status): same + + * buildbot/changes/changes.py (ChangeMaster.removeSource): return + a Deferred that fires when the source is finally removed + * buildbot/slave/commands.py (SourceBase.doClobber): when removing the previous tree on win32, where we have to do it synchronously, make sure we return a Deferred anyway. From warner at users.sourceforge.net Fri Apr 22 21:29:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 21:29:21 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes changes.py,1.18,1.19 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/buildbot/changes Modified Files: changes.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-69 Creator: Brian Warner fix propagation of changes to .builddir 2005-04-22 Brian Warner * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the whendone= argument, just return the Deferred and let the caller do what they want with it. (Disconnect.testBuild1): wait for shutdownSlave (Basedir.testChangeBuilddir): new test to make sure changes to the builddir actually get propagated to the slave * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an explicit method, rather than passing the builddir in __init__ . Make sure to update self.basedir too, this was broken before. (Bot.remote_setBuilderList): use b.setBuilddir for both new builders and for ones that have just had their builddir changed. (BotFactory): add a class-level .perspective attribute, so BuildSlave.waitUntilDisconnected won't get upset when the connection hasn't yet been established (BuildSlave.__init__): keep track of the bot.Bot instance, so tests can reach through it to inspect the SlaveBuilders * buildbot/process/base.py (Build.buildException): explain the log.err with a log.msg * buildbot/process/builder.py (Builder.startBuild): same (Builder._startBuildFailed): improve error message * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure occurred because we lost the brand-new connection, retry instead of giving up. If not, it's probably an authorization failure, and it makes sense to stop trying. Make sure we log.msg the reason that we're log.err'ing the failure, otherwise test failures are really hard to figure out. * buildbot/master.py: change loadConfig() to return a Deferred that doesn't fire until the change has been fully implemented. This means any connected slaves have been updated with the new builddir. This change makes it easier to test the code which actually implements this builddir-updating. (BotPerspective.addBuilder): return Deferred (BotPerspective.removeBuilder): same (BotPerspective.attached): same (BotPerspective._attached): same. finish with remote_print before starting the getSlaveInfo, instead of doing them in parallel (BotPerspective.list_done): same (BotMaster.removeSlave): same. Fix the typo that meant we weren't actually calling slave.disconnect() (BotMaster.addBuilder): same (BotMaster.removeBuilder): same (BuildMaster.loadConfig): same (BuildMaster.loadConfig_Slaves): same (BuildMaster.loadConfig_Sources): same (BuildMaster.loadConfig_Builders): same (BuildMaster.loadConfig_status): same * buildbot/changes/changes.py (ChangeMaster.removeSource): return a Deferred that fires when the source is finally removed Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/changes.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- changes.py 18 Apr 2005 00:26:57 -0000 1.18 +++ changes.py 22 Apr 2005 21:29:19 -0000 1.19 @@ -179,8 +179,9 @@ def removeSource(self, source): if self.debug: print "ChangeMaster.removeSource", source - source.disownServiceParent() + d = defer.maybeDeferred(source.disownServiceParent) self.sources.remove(source) + return d def addChange(self, change): """Deliver a file change event. The event should be a Change object. From warner at users.sourceforge.net Fri Apr 22 21:29:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 21:29:21 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave bot.py,1.10,1.11 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/buildbot/slave Modified Files: bot.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-69 Creator: Brian Warner fix propagation of changes to .builddir 2005-04-22 Brian Warner * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the whendone= argument, just return the Deferred and let the caller do what they want with it. (Disconnect.testBuild1): wait for shutdownSlave (Basedir.testChangeBuilddir): new test to make sure changes to the builddir actually get propagated to the slave * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an explicit method, rather than passing the builddir in __init__ . Make sure to update self.basedir too, this was broken before. (Bot.remote_setBuilderList): use b.setBuilddir for both new builders and for ones that have just had their builddir changed. (BotFactory): add a class-level .perspective attribute, so BuildSlave.waitUntilDisconnected won't get upset when the connection hasn't yet been established (BuildSlave.__init__): keep track of the bot.Bot instance, so tests can reach through it to inspect the SlaveBuilders * buildbot/process/base.py (Build.buildException): explain the log.err with a log.msg * buildbot/process/builder.py (Builder.startBuild): same (Builder._startBuildFailed): improve error message * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure occurred because we lost the brand-new connection, retry instead of giving up. If not, it's probably an authorization failure, and it makes sense to stop trying. Make sure we log.msg the reason that we're log.err'ing the failure, otherwise test failures are really hard to figure out. * buildbot/master.py: change loadConfig() to return a Deferred that doesn't fire until the change has been fully implemented. This means any connected slaves have been updated with the new builddir. This change makes it easier to test the code which actually implements this builddir-updating. (BotPerspective.addBuilder): return Deferred (BotPerspective.removeBuilder): same (BotPerspective.attached): same (BotPerspective._attached): same. finish with remote_print before starting the getSlaveInfo, instead of doing them in parallel (BotPerspective.list_done): same (BotMaster.removeSlave): same. Fix the typo that meant we weren't actually calling slave.disconnect() (BotMaster.addBuilder): same (BotMaster.removeBuilder): same (BuildMaster.loadConfig): same (BuildMaster.loadConfig_Slaves): same (BuildMaster.loadConfig_Sources): same (BuildMaster.loadConfig_Builders): same (BuildMaster.loadConfig_status): same * buildbot/changes/changes.py (ChangeMaster.removeSource): return a Deferred that fires when the source is finally removed Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- bot.py 18 Apr 2005 00:26:56 -0000 1.10 +++ bot.py 22 Apr 2005 21:29:18 -0000 1.11 @@ -61,10 +61,9 @@ # when the step is started remoteStep = None - def __init__(self, parent, name, builddir, not_really): + def __init__(self, parent, name, not_really): #service.Service.__init__(self) self.name = name - self.builddir = builddir self.not_really = not_really def __repr__(self): @@ -73,6 +72,10 @@ def setServiceParent(self, parent): service.Service.setServiceParent(self, parent) self.bot = self.parent + + def setBuilddir(self, builddir): + assert self.parent + self.builddir = builddir self.basedir = os.path.join(self.bot.basedir, self.builddir) if not os.path.isdir(self.basedir): os.mkdir(self.basedir) @@ -258,11 +261,12 @@ if b.builddir != builddir: log.msg("changing builddir for builder %s from %s to %s" \ % (name, b.builddir, builddir)) - b.builddir = builddir + b.setBuilddir(builddir) else: - b = SlaveBuilder(self, name, builddir, self.not_really) + b = SlaveBuilder(self, name, self.not_really) b.usePTY = self.usePTY b.setServiceParent(self) + b.setBuilddir(builddir) self.builders[name] = b retval[name] = b for name in self.builders.keys(): @@ -319,6 +323,7 @@ activityTimer = None lastActivity = 0 unsafeTracebacks = 1 + perspective = None def __init__(self, keepaliveInterval, keepaliveTimeout): ReconnectingPBClientFactory.__init__(self) @@ -416,6 +421,7 @@ service.MultiService.__init__(self) bot = self.botClass(basedir, usePTY) bot.setServiceParent(self) + self.bot = bot if keepalive == 0: keepalive = None bf = self.bf = BotFactory(keepalive, keepaliveTimeout) From warner at users.sourceforge.net Fri Apr 22 21:29:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 21:29:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_run.py,1.22,1.23 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/buildbot/test Modified Files: test_run.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-69 Creator: Brian Warner fix propagation of changes to .builddir 2005-04-22 Brian Warner * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the whendone= argument, just return the Deferred and let the caller do what they want with it. (Disconnect.testBuild1): wait for shutdownSlave (Basedir.testChangeBuilddir): new test to make sure changes to the builddir actually get propagated to the slave * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an explicit method, rather than passing the builddir in __init__ . Make sure to update self.basedir too, this was broken before. (Bot.remote_setBuilderList): use b.setBuilddir for both new builders and for ones that have just had their builddir changed. (BotFactory): add a class-level .perspective attribute, so BuildSlave.waitUntilDisconnected won't get upset when the connection hasn't yet been established (BuildSlave.__init__): keep track of the bot.Bot instance, so tests can reach through it to inspect the SlaveBuilders * buildbot/process/base.py (Build.buildException): explain the log.err with a log.msg * buildbot/process/builder.py (Builder.startBuild): same (Builder._startBuildFailed): improve error message * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure occurred because we lost the brand-new connection, retry instead of giving up. If not, it's probably an authorization failure, and it makes sense to stop trying. Make sure we log.msg the reason that we're log.err'ing the failure, otherwise test failures are really hard to figure out. * buildbot/master.py: change loadConfig() to return a Deferred that doesn't fire until the change has been fully implemented. This means any connected slaves have been updated with the new builddir. This change makes it easier to test the code which actually implements this builddir-updating. (BotPerspective.addBuilder): return Deferred (BotPerspective.removeBuilder): same (BotPerspective.attached): same (BotPerspective._attached): same. finish with remote_print before starting the getSlaveInfo, instead of doing them in parallel (BotPerspective.list_done): same (BotMaster.removeSlave): same. Fix the typo that meant we weren't actually calling slave.disconnect() (BotMaster.addBuilder): same (BotMaster.removeBuilder): same (BuildMaster.loadConfig): same (BuildMaster.loadConfig_Slaves): same (BuildMaster.loadConfig_Sources): same (BuildMaster.loadConfig_Builders): same (BuildMaster.loadConfig_status): same * buildbot/changes/changes.py (ChangeMaster.removeSource): return a Deferred that fires when the source is finally removed Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- test_run.py 2 Apr 2005 01:41:38 -0000 1.22 +++ test_run.py 22 Apr 2005 21:29:20 -0000 1.23 @@ -55,6 +55,25 @@ BuildmasterConfig = c """ +config_2_newbasedir = """ +from buildbot.process import factory, step + +def s(klass, **kwargs): + return (klass, kwargs) + +f1 = factory.BuildFactory([ + s(step.Dummy, timeout=1), + s(step.RemoteDummy, timeout=2), + ]) +c = {} +c['bots'] = [['bot1', 'sekrit']] +c['sources'] = [] +c['builders'] = [{'name': 'dummy', 'slavename': 'bot1', + 'builddir': 'dummy2', 'factory': f1}] +c['slavePortnum'] = 0 +BuildmasterConfig = c +""" + class MyBot(bot.Bot): def remote_getSlaveInfo(self): return self.parent.info @@ -198,14 +217,12 @@ # various forms of slave death - def shutdownSlave(self, whendone=None): + def shutdownSlave(self): # the slave has disconnected normally: they SIGINT'ed it, or it shut # down willingly. This will kill child processes and give them a # chance to finish up. We return a Deferred that will fire when # everything is finished shutting down. - # 'whendone' is an optional Deferred that will be fired when the - # shutdown is complete log.msg("doing shutdownSlave") dl = [] if self.slave: @@ -216,8 +233,6 @@ dl.append(defer.maybeDeferred(self.slave2.stopService)) d = defer.DeferredList(dl) d.addCallback(self._shutdownSlaveDone) - if whendone: - d.addCallback(whendone.callback) return d def _shutdownSlaveDone(self, res): self.slave = None @@ -508,8 +523,10 @@ # bc = c.getBuilder("dummy").forceBuild(None, "forced build") bs = bc.getStatus() - # kill the slave while it's running the first step - self.shutdownSlave() # dies before it gets started + + # now kill the slave before it gets to start the first step + d = self.shutdownSlave() # dies before it gets started + dr(d, 5) # now examine the just-stopped build and make sure it is really # stopped. This is checking for bugs in which the slave-detach gets @@ -642,3 +659,32 @@ self.failUnless(ss.isConnected()) self.failUnlessEqual(ss.getAdmin(), "two") + +class Basedir(RunMixin, unittest.TestCase): + def testChangeBuilddir(self): + m = self.master + m.loadConfig(config_2) + m.readConfig = True + m.startService() + + self.connectSlave() + bot = self.slave.bot + builder = bot.builders.get("dummy") + self.failUnless(builder) + self.failUnlessEqual(builder.builddir, "dummy") + self.failUnlessEqual(builder.basedir, "slavebase/dummy") + + d = m.loadConfig(config_2_newbasedir) + dr(d) + + # this causes the builder to be replaced + self.failIfIdentical(builder, bot.builders.get("dummy")) + builder = bot.builders.get("dummy") + self.failUnless(builder) + # the basedir should be updated + self.failUnlessEqual(builder.builddir, "dummy2") + self.failUnlessEqual(builder.basedir, "slavebase/dummy2") + + # done + + From warner at users.sourceforge.net Fri Apr 22 21:29:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 21:29:21 +0000 Subject: [Buildbot-commits] buildbot/buildbot pbutil.py,1.8,1.9 master.py,1.60,1.61 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/buildbot Modified Files: pbutil.py master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-69 Creator: Brian Warner fix propagation of changes to .builddir 2005-04-22 Brian Warner * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the whendone= argument, just return the Deferred and let the caller do what they want with it. (Disconnect.testBuild1): wait for shutdownSlave (Basedir.testChangeBuilddir): new test to make sure changes to the builddir actually get propagated to the slave * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an explicit method, rather than passing the builddir in __init__ . Make sure to update self.basedir too, this was broken before. (Bot.remote_setBuilderList): use b.setBuilddir for both new builders and for ones that have just had their builddir changed. (BotFactory): add a class-level .perspective attribute, so BuildSlave.waitUntilDisconnected won't get upset when the connection hasn't yet been established (BuildSlave.__init__): keep track of the bot.Bot instance, so tests can reach through it to inspect the SlaveBuilders * buildbot/process/base.py (Build.buildException): explain the log.err with a log.msg * buildbot/process/builder.py (Builder.startBuild): same (Builder._startBuildFailed): improve error message * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure occurred because we lost the brand-new connection, retry instead of giving up. If not, it's probably an authorization failure, and it makes sense to stop trying. Make sure we log.msg the reason that we're log.err'ing the failure, otherwise test failures are really hard to figure out. * buildbot/master.py: change loadConfig() to return a Deferred that doesn't fire until the change has been fully implemented. This means any connected slaves have been updated with the new builddir. This change makes it easier to test the code which actually implements this builddir-updating. (BotPerspective.addBuilder): return Deferred (BotPerspective.removeBuilder): same (BotPerspective.attached): same (BotPerspective._attached): same. finish with remote_print before starting the getSlaveInfo, instead of doing them in parallel (BotPerspective.list_done): same (BotMaster.removeSlave): same. Fix the typo that meant we weren't actually calling slave.disconnect() (BotMaster.addBuilder): same (BotMaster.removeBuilder): same (BuildMaster.loadConfig): same (BuildMaster.loadConfig_Slaves): same (BuildMaster.loadConfig_Sources): same (BuildMaster.loadConfig_Builders): same (BuildMaster.loadConfig_status): same * buildbot/changes/changes.py (ChangeMaster.removeSource): return a Deferred that fires when the source is finally removed Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- master.py 22 Apr 2005 03:55:52 -0000 1.60 +++ master.py 22 Apr 2005 21:29:19 -0000 1.61 @@ -52,16 +52,29 @@ self.slave = None # a RemoteReference to the Bot, when connected def addBuilder(self, builder): - """Called to add a builder after the slave has connected.""" + """Called to add a builder after the slave has connected. + + @return: a Deferred that indicates when an attached slave has + accepted the new builder.""" + self.builders.append(builder) if self.slave: - self.sendBuilderList() + return self.sendBuilderList() + return defer.succeed(None) def removeBuilder(self, builder): + """Tell the slave that the given builder has been removed, allowing + it to discard the associated L{buildbot.slave.bot.SlaveBuilder} + object. + + @return: a Deferred that fires when the slave has finished removing + the SlaveBuilder + """ self.builders.remove(builder) if self.slave: builder.detached() - self.sendBuilderList() + return self.sendBuilderList() + return defer.succeed(None) def __repr__(self): return "" % \ @@ -69,9 +82,10 @@ string.join(map(lambda b: b.name, self.builders), ',')) def attached(self, mind): - # this is called when the slave connects. It returns a Deferred that - # fires with a suitable pb.IPerspective to give to the slave (i.e. - # 'self') + """This is called when the slave connects. + + @return: a Deferred that fires with a suitable pb.IPerspective to + give to the slave (i.e. 'self')""" if self.slave: # uh-oh, we've got a duplicate slave. The most likely @@ -91,10 +105,11 @@ d.addCallback(lambda res: self._attached(mind)) return d - self._attached(mind) - return defer.succeed(self) + return self._attached(mind) def disconnect(self): + if not self.slave: + return defer.succeed(None) log.msg("disconnecting old slave %s now" % self.slavename) # all kinds of teardown will happen as a result of @@ -132,20 +147,25 @@ return d def _attached(self, mind): - # We go through a sequence of calls, gathering information, then - # tell our Builders that they have a slave to work with. + """We go through a sequence of calls, gathering information, then + tell our Builders that they have a slave to work with. + + @return: a Deferred that fires (with 'self') when our Builders are + prepared to deal with the slave. + """ self.slave = mind - self.slave.callRemote("print", "attached").addErrback(lambda why: 0) + d = self.slave.callRemote("print", "attached") + d.addErrback(lambda why: 0) self.slave_status.connected = True log.msg("bot attached") # TODO: there is a window here (while we're retrieving slaveinfo) # during which a disconnect or a duplicate-slave will be confusing - d = self.slave.callRemote("getSlaveInfo") - d.addCallback(self.got_info) - d.addErrback(self.infoUnavailable) + d.addCallback(lambda res: self.slave.callRemote("getSlaveInfo")) + d.addCallbacks(self.got_info, self.infoUnavailable) d.addCallback(self._attached2) - return self + d.addCallback(lambda res: self) + return d def got_info(self, info): log.msg("Got slaveinfo from '%s'" % self.slavename) @@ -212,14 +232,17 @@ def list_done(self, blist): # this could come back at weird times. be prepared to handle oddness + dl = [] for name, remote in blist.items(): for b in self.builders: if b.name == name: # if we sent the builders list because of a config # change, the Builder might already be attached. # Builder.attached will ignore us if this happens. - b.attached(remote, self.slave_commands) + d = b.attached(remote, self.slave_commands) + dl.append(d) continue + return defer.DeferredList(dl) def _listFailed(self, why): log.msg("BotPerspective._listFailed") @@ -297,8 +320,9 @@ self.slaves[slavename] = slave def removeSlave(self, slavename): - d = self.slaves[slavename].disconnect + d = self.slaves[slavename].disconnect() del self.slaves[slavename] + return d def getBuildernames(self): return self.builderNames @@ -307,7 +331,12 @@ """This is called by the setup code to define what builds should be performed. Each Builder object has a build slave that should host that build: the builds cannot be done until the right slave - connects.""" + connects. + + @return: a Deferred that fires when an attached slave has accepted + the new builder. + """ + if self.debug: print "addBuilder", builder log.msg("Botmaster.addBuilder(%s)" % builder.name) @@ -324,9 +353,15 @@ self.checkInactiveInterlocks() # TODO?: do this in caller instead? slave = self.slaves[slavename] - slave.addBuilder(builder) + return slave.addBuilder(builder) def removeBuilder(self, builder): + """Stop using a Builder. + This removes the Builder from the list of active Builders. + + @return: a Deferred that fires when an attached slave has finished + removing the SlaveBuilder + """ if self.debug: print "removeBuilder", builder log.msg("Botmaster.removeBuilder(%s)" % builder.name) b = self.builders[builder.name] @@ -346,7 +381,8 @@ self.builderNames.remove(builder.name) slave = self.slaves.get(builder.slavename) if slave: - slave.removeBuilder(builder) + return slave.removeBuilder(builder) + return defer.succeed(None) def addInterlock(self, interlock): """This is called by the setup code to create build interlocks: @@ -660,6 +696,13 @@ f.close() def loadConfig(self, f): + """Internal function to load a specific configuration file. Any + errors in the file will be signalled by raising an exception. + + @return: a Deferred that will fire (with None) when the configuration + changes have been completed. This may involve a round-trip to each + buildslave that was involved.""" + localDict = {'basedir': os.path.expanduser(self.basedir)} try: exec f in localDict @@ -757,6 +800,9 @@ # now we're committed to implementing the new configuration, so do # it atomically + # asynchronous updates can add a Deferred to this list + dl = [] + self.projectName = projectName self.projectURL = projectURL self.buildbotURL = buildbotURL @@ -764,7 +810,7 @@ # self.bots: Disconnect any that were attached and removed from the # list. Update self.checker with the new list of passwords, # including debug/change/status. - self.loadConfig_Slaves(bots) + dl.append(self.loadConfig_Slaves(bots)) # self.debugPassword if debugPassword: @@ -779,25 +825,28 @@ if manhole != self.manhole: # changing if self.manhole: - # TODO: disownServiceParent may return Deferred - self.manhole.disownServiceParent() + # disownServiceParent may return a Deferred + d = defer.maybeDeferred(self.manhole.disownServiceParent) + dl.append(d) self.manhole = None if manhole: self.manhole = manhole manhole.setServiceParent(self) - self.loadConfig_Sources(sources) + dl.append(self.loadConfig_Sources(sources)) # add/remove self.botmaster.builders to match builders. The # botmaster will handle startup/shutdown issues. - self.loadConfig_Builders(builders) + dl.append(self.loadConfig_Builders(builders)) - self.loadConfig_status(status, irc, webPortnum, webPathname) + d = self.loadConfig_status(status, irc, webPortnum, webPathname) + dl.append(d) # self.slavePort if self.slavePortnum != slavePortnum: if self.slavePort: - self.slavePort.disownServiceParent() + d = defer.maybeDeferred(self.slavePort.disownServiceParent) + dl.append(d) self.slavePort = None if slavePortnum is not None: self.slavePort = internet.TCPServer(slavePortnum, @@ -810,6 +859,7 @@ self.loadConfig_Interlocks(interlocks) log.msg("configuration updated") + return defer.DeferredList(dl) def loadConfig_Slaves(self, bots): # set up the Checker with the names and passwords of all valid bots @@ -822,25 +872,28 @@ old = self.bots; oldnames = [name for name,pw in old] new = bots; newnames = [name for name,pw in new] # removeSlave will hang up on the old bot - [self.botmaster.removeSlave(name) - for name in oldnames if name not in newnames] + dl = [self.botmaster.removeSlave(name) + for name in oldnames if name not in newnames] [self.botmaster.addSlave(name) for name in newnames if name not in oldnames] # all done self.bots = bots + return defer.DeferredList(dl) def loadConfig_Sources(self, sources): # shut down any that were removed, start any that were added old = self.sources new = sources - [self.change_svc.removeSource(source) - for source in old if source not in new] + dl = [self.change_svc.removeSource(source) + for source in old if source not in new] [self.change_svc.addSource(source) for source in new if source not in old] self.sources = sources + return defer.DeferredList(dl) def loadConfig_Builders(self, newBuilders): + dl = [] old = self.botmaster.getBuildernames() newNames = [] newList = {} @@ -859,7 +912,8 @@ for old in self.botmaster.builders.values()[:]: if old.name not in newList.keys(): log.msg("removing old builder %s" % old.name) - self.botmaster.removeBuilder(old) + d = self.botmaster.removeBuilder(old) + dl.append(d) # announce the change self.status.builderRemoved(old.name) @@ -873,7 +927,8 @@ log.msg("adding new builder %s" % name) statusbag = self.status.builderAdded(name, basedir) builder = Builder(data, statusbag) - self.botmaster.addBuilder(builder) + d = self.botmaster.addBuilder(builder) + dl.append(d) else: diffs = old.compareToSetup(data) if not diffs: # unchanged: leave it alone @@ -888,14 +943,17 @@ # make a new statusbag statusbag = old.builder_status statusbag.saveYourself() # seems like a good idea - self.botmaster.removeBuilder(old) + d = self.botmaster.removeBuilder(old) + dl.append(d) builder = Builder(data, statusbag) # point out that the builder was updated statusbag.addPointEvent(["config", "updated"]) - self.botmaster.addBuilder(builder) + d = self.botmaster.addBuilder(builder) + dl.append(d) # now that everything is up-to-date, make sure the names are in the # desired order self.botmaster.builderNames = newNames + return defer.DeferredList(dl) def loadConfig_status(self, status, irc=None, webPortnum=None, webPathname=None): @@ -921,12 +979,14 @@ status.append(Waterfall(distrib_port=webPathname)) # here is where the real work happens + dl = [] # remove old ones for s in self.statusTargets[:]: if not s in status: log.msg("removing IStatusReceiver", s) - s.disownServiceParent() + d = defer.maybeDeferred(s.disownServiceParent) + dl.append(d) self.statusTargets.remove(s) # add new ones for s in status: @@ -935,6 +995,8 @@ s.setServiceParent(self) self.statusTargets.append(s) + return defer.DeferredList(dl) + def loadConfig_Interlocks(self, newInterlocks): newList = {} for interlockData in newInterlocks: Index: pbutil.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/pbutil.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- pbutil.py 6 Dec 2004 07:36:34 -0000 1.8 +++ pbutil.py 22 Apr 2005 21:29:19 -0000 1.9 @@ -129,5 +129,15 @@ pass def failedToGetPerspective(self, why): + """The login process failed, most likely because of an authorization + failure (bad password), but it is also possible that we lost the new + connection before we managed to send our credentials. + """ + log.msg("ReconnectingPBClientFactory.failedToGetPerspective") + if why.check(pb.PBConnectionLost): + log.msg("we lost the brand-new connection") + # retrying might help here, let clientConnectionLost decide + return + # probably authorization self.stopTrying() # logging in harder won't help log.err(why) From warner at users.sourceforge.net Fri Apr 22 21:29:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 22 Apr 2005 21:29:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process base.py,1.46,1.47 builder.py,1.23,1.24 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/buildbot/process Modified Files: base.py builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-69 Creator: Brian Warner fix propagation of changes to .builddir 2005-04-22 Brian Warner * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the whendone= argument, just return the Deferred and let the caller do what they want with it. (Disconnect.testBuild1): wait for shutdownSlave (Basedir.testChangeBuilddir): new test to make sure changes to the builddir actually get propagated to the slave * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an explicit method, rather than passing the builddir in __init__ . Make sure to update self.basedir too, this was broken before. (Bot.remote_setBuilderList): use b.setBuilddir for both new builders and for ones that have just had their builddir changed. (BotFactory): add a class-level .perspective attribute, so BuildSlave.waitUntilDisconnected won't get upset when the connection hasn't yet been established (BuildSlave.__init__): keep track of the bot.Bot instance, so tests can reach through it to inspect the SlaveBuilders * buildbot/process/base.py (Build.buildException): explain the log.err with a log.msg * buildbot/process/builder.py (Builder.startBuild): same (Builder._startBuildFailed): improve error message * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure occurred because we lost the brand-new connection, retry instead of giving up. If not, it's probably an authorization failure, and it makes sense to stop trying. Make sure we log.msg the reason that we're log.err'ing the failure, otherwise test failures are really hard to figure out. * buildbot/master.py: change loadConfig() to return a Deferred that doesn't fire until the change has been fully implemented. This means any connected slaves have been updated with the new builddir. This change makes it easier to test the code which actually implements this builddir-updating. (BotPerspective.addBuilder): return Deferred (BotPerspective.removeBuilder): same (BotPerspective.attached): same (BotPerspective._attached): same. finish with remote_print before starting the getSlaveInfo, instead of doing them in parallel (BotPerspective.list_done): same (BotMaster.removeSlave): same. Fix the typo that meant we weren't actually calling slave.disconnect() (BotMaster.addBuilder): same (BotMaster.removeBuilder): same (BuildMaster.loadConfig): same (BuildMaster.loadConfig_Slaves): same (BuildMaster.loadConfig_Sources): same (BuildMaster.loadConfig_Builders): same (BuildMaster.loadConfig_status): same * buildbot/changes/changes.py (ChangeMaster.removeSource): return a Deferred that fires when the source is finally removed Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- base.py 19 Apr 2005 07:45:11 -0000 1.46 +++ base.py 22 Apr 2005 21:29:19 -0000 1.47 @@ -466,6 +466,7 @@ return self.buildFinished(text, color, self.result) def buildException(self, why): + log.msg("%s.buildException" % self) log.err(why) self.buildFinished(["build", "exception"], "#c000c0", FAILURE) Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/builder.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- builder.py 19 Apr 2005 07:45:19 -0000 1.23 +++ builder.py 22 Apr 2005 21:29:19 -0000 1.24 @@ -357,12 +357,16 @@ # Finally it will start the actual build process. d = build.startBuild(bs, self.expectations, self.remote) d.addCallback(self.buildFinished) - d.addErrback(log.err) + d.addErrback(self._buildNotFinished) control = base.BuildControl(build) return control + def _buildNotFinished(self, why): + log.msg("_buildNotFinished") + log.err() + def _startBuildFailed(self, why, build): - log.msg("wanted to start build %s, but " + log.msg("I tried to tell the slave that the build %s started, but " "remote_startBuild failed: %s" % (build, why)) def testsFinished(self, results): From warner at users.sourceforge.net Sat Apr 23 00:01:24 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 00:01:24 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.10,1.11 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32752/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-71 Creator: Brian Warner create info/* files when making the slave directory 2005-04-22 Brian Warner * buildbot/scripts/runner.py (Maker.mkinfo): create the info/admin and info/host files when making the slave directory Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- runner.py 22 Apr 2005 07:35:58 -0000 1.10 +++ runner.py 23 Apr 2005 00:01:21 -0000 1.11 @@ -28,6 +28,23 @@ if not self.quiet: print "mkdir", self.basedir os.mkdir(self.basedir) + def mkinfo(self): + path = os.path.join(self.basedir, "info") + if not os.path.exists(path): + if not self.quiet: print "mkdir", path + os.mkdir(path) + admin = os.path.join(path, "admin") + if not os.path.exists(admin): + f = open(admin, "wt") + f.write("Your Name Here \n") + f.close() + host = os.path.join(path, "host") + if not os.path.exists(host): + f = open(host, "wt") + f.write("Please put a description of this build host here\n") + f.close() + print "Please edit the files in %s appropriately." % path + def chdir(self): if not self.quiet: print "chdir", self.basedir os.chdir(self.basedir) @@ -92,6 +109,7 @@ m.mktap(cmd) m.makefile(util.sibpath(__file__, "sample.mk"), cmd) + m.mkinfo() if not m.quiet: print "buildslave configured in %s" % m.basedir sys.exit(0) @@ -210,7 +228,7 @@ def statusgui(config): #from buildbot.clients import gtkPanes - #c = gtkPanes.CompactGtkClient() + #c = gtkPanes.GtkClient(config['master']) from buildbot.clients import base c = base.TextClient(config['master']) c.run() From warner at users.sourceforge.net Sat Apr 23 00:01:24 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 00:01:24 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.369,1.370 .arch-inventory,1.2,1.3 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32752 Modified Files: ChangeLog .arch-inventory Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-71 Creator: Brian Warner create info/* files when making the slave directory 2005-04-22 Brian Warner * buildbot/scripts/runner.py (Maker.mkinfo): create the info/admin and info/host files when making the slave directory Index: .arch-inventory =================================================================== RCS file: /cvsroot/buildbot/buildbot/.arch-inventory,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .arch-inventory 22 Apr 2005 21:29:20 -0000 1.2 +++ .arch-inventory 23 Apr 2005 00:01:22 -0000 1.3 @@ -2,3 +2,5 @@ precious ^s$ precious ^svn$ junk ^_trial_temp$ +junk ^MANIFEST$ +junk ^dist$ Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.369 retrieving revision 1.370 diff -u -d -r1.369 -r1.370 --- ChangeLog 22 Apr 2005 21:29:20 -0000 1.369 +++ ChangeLog 23 Apr 2005 00:01:22 -0000 1.370 @@ -1,5 +1,8 @@ 2005-04-22 Brian Warner + * buildbot/scripts/runner.py (Maker.mkinfo): create the info/admin + and info/host files when making the slave directory + * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the whendone= argument, just return the Deferred and let the caller do what they want with it. From warner at users.sourceforge.net Sat Apr 23 00:39:25 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 00:39:25 +0000 Subject: [Buildbot-commits] site index.html,1.34,1.35 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20305 Modified Files: index.html Log Message: add link to the Boost buildbot Index: index.html =================================================================== RCS file: /cvsroot/buildbot/site/index.html,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- index.html 13 Dec 2004 08:39:35 -0000 1.34 +++ index.html 23 Apr 2005 00:39:22 -0000 1.35 @@ -95,6 +95,11 @@
  • Justin Mason reports that the SpamAssassin project is running a buildbot too.
  • +
  • Rene Rivera says that the well-known Boost C++ project is moving all their + testing to run under a buildbot.
  • +
  • install a Buildbot today and get your name added here!
@@ -117,5 +122,5 @@ align="right" /> -Last modified: Mon Dec 13 00:38:07 PST 2004 +Last modified: Fri Apr 22 17:38:58 PDT 2005 From warner at users.sourceforge.net Sat Apr 23 10:22:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:22:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.61,1.62 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24338/buildbot Modified Files: master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-73 Creator: Brian Warner clean up ChangeSource handling 2005-04-23 Brian Warner * buildbot/changes/changes.py: import defer, oops (ChangeMaster): remove the .sources list, rely upon the fact that MultiServices can be treated as sequences of their children. This cleans up the add/remove ChangeSource routines a lot, as we keep exactly one list of the current sources instead of three. * buildbot/master.py (BuildMaster.__init__): remove .sources, set up an empty ChangeMaster at init time. (BuildMaster.loadChanges): if there are changes to be had from disk, replace self.change_svc with the new ones. If not, keep using the empty ChangeMaster set up in __init__. (BuildMaster.loadConfig_Sources): use list(self.change_svc) instead of a separate list, makes the code a bit cleaner. * buildbot/test/test_config.py (ConfigTest.testSimple): match it (ConfigTest.testSources): same, also wait for loadConfig to finish. Extend the test to make sure we can get rid of the sources when we're done. Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- master.py 22 Apr 2005 21:29:19 -0000 1.61 +++ master.py 23 Apr 2005 10:22:10 -0000 1.62 @@ -610,7 +610,8 @@ self.statusTargets = [] self.bots = [] - self.sources = [] + self.change_svc = None + self.useChanges(ChangeMaster()) self.readConfig = False @@ -646,23 +647,28 @@ b.builder_status.addPointEvent(["master", "started"]) b.builder_status.saveYourself() - def loadChanges(self): - filename = os.path.join(self.basedir, "changes.pck") - try: - self.change_svc = pickle.load(open(filename, "r")) - except IOError: - log.msg("changes.pck missing, creating new one") - self.change_svc = ChangeMaster() - except EOFError: - log.msg("corrupted changes.pck, creating new one") - self.change_svc = ChangeMaster() - + def useChanges(self, changes): + if self.change_svc: + # TODO: can return a Deferred + self.change_svc.disownServiceParent() + self.change_svc = changes self.change_svc.basedir = self.basedir self.change_svc.botmaster = self.botmaster self.change_svc.setName("changemaster") self.change_svc.setServiceParent(self) self.dispatcher.changemaster = self.change_svc + def loadChanges(self): + filename = os.path.join(self.basedir, "changes.pck") + try: + changes = pickle.load(open(filename, "r")) + except IOError: + log.msg("changes.pck missing, using new one") + return # __init__ created a ChangeMaster() already, just use it + except EOFError: + log.msg("corrupted changes.pck, using new one") + return # ditto + self.useChanges(changes) def _handleSIGHUP(self, *args): reactor.callLater(0, self.loadTheConfigFile) @@ -883,13 +889,11 @@ def loadConfig_Sources(self, sources): # shut down any that were removed, start any that were added - old = self.sources - new = sources + oldsources = list(self.change_svc) dl = [self.change_svc.removeSource(source) - for source in old if source not in new] + for source in oldsources if source not in sources] [self.change_svc.addSource(source) - for source in new if source not in old] - self.sources = sources + for source in sources if source not in self.change_svc] return defer.DeferredList(dl) def loadConfig_Builders(self, newBuilders): From warner at users.sourceforge.net Sat Apr 23 10:22:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:22:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_config.py,1.13,1.14 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24338/buildbot/test Modified Files: test_config.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-73 Creator: Brian Warner clean up ChangeSource handling 2005-04-23 Brian Warner * buildbot/changes/changes.py: import defer, oops (ChangeMaster): remove the .sources list, rely upon the fact that MultiServices can be treated as sequences of their children. This cleans up the add/remove ChangeSource routines a lot, as we keep exactly one list of the current sources instead of three. * buildbot/master.py (BuildMaster.__init__): remove .sources, set up an empty ChangeMaster at init time. (BuildMaster.loadChanges): if there are changes to be had from disk, replace self.change_svc with the new ones. If not, keep using the empty ChangeMaster set up in __init__. (BuildMaster.loadConfig_Sources): use list(self.change_svc) instead of a separate list, makes the code a bit cleaner. * buildbot/test/test_config.py (ConfigTest.testSimple): match it (ConfigTest.testSources): same, also wait for loadConfig to finish. Extend the test to make sure we can get rid of the sources when we're done. Index: test_config.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- test_config.py 30 Sep 2004 23:03:52 -0000 1.13 +++ test_config.py 23 Apr 2005 10:22:11 -0000 1.14 @@ -4,6 +4,7 @@ import os, os.path from twisted.trial import unittest +dr = unittest.deferredResult from twisted.python import components try: @@ -487,8 +488,7 @@ # hasn't been started running self.failUnlessEqual(master.slavePortnum, 9999) self.checkPorts(master, [(9999, pb.PBServerFactory)]) - self.failUnlessEqual(master.sources, []) - self.failUnlessEqual(master.change_svc.sources, []) + self.failUnlessEqual(list(master.change_svc), []) self.failUnlessEqual(master.botmaster.builders, {}) self.failUnlessEqual(master.botmaster.interlocks, {}) self.failUnlessEqual(master.checker.users, @@ -547,23 +547,31 @@ master = self.buildmaster master.loadChanges() master.loadConfig(emptyCfg) - self.failUnlessEqual(master.sources, []) - self.failUnlessEqual(master.change_svc.sources, []) + self.failUnlessEqual(list(master.change_svc), []) - master.loadConfig(sourcesCfg) - self.failUnlessEqual(len(master.sources), 1) - self.failUnlessEqual(len(master.change_svc.sources), 1) - s1 = master.change_svc.sources[0] + d = master.loadConfig(sourcesCfg) + dr(d) + self.failUnlessEqual(len(list(master.change_svc)), 1) + s1 = list(master.change_svc)[0] self.failUnless(isinstance(s1, FreshCVSSource)) self.failUnlessEqual(s1.where, ("cvs.example.com", 1000)) self.failUnlessEqual(s1.prefix, "Prefix/") - self.failUnlessEqual(s1, master.sources[0]) + self.failUnlessEqual(s1, list(master.change_svc)[0]) + self.failUnless(s1.parent) # verify that unchanged sources are not interrupted - master.loadConfig(sourcesCfg) - self.failUnlessEqual(len(master.change_svc.sources), 1) - s2 = master.change_svc.sources[0] + d = master.loadConfig(sourcesCfg) + dr(d) + self.failUnlessEqual(len(list(master.change_svc)), 1) + s2 = list(master.change_svc)[0] self.failUnlessIdentical(s1, s2) + self.failUnless(s1.parent) + + # make sure we can get rid of the sources too + d = master.loadConfig(emptyCfg) + dr(d) + self.failUnlessEqual(list(master.change_svc), []) + def testBuilders(self): master = self.buildmaster From warner at users.sourceforge.net Sat Apr 23 10:22:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:22:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes changes.py,1.19,1.20 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24338/buildbot/changes Modified Files: changes.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-73 Creator: Brian Warner clean up ChangeSource handling 2005-04-23 Brian Warner * buildbot/changes/changes.py: import defer, oops (ChangeMaster): remove the .sources list, rely upon the fact that MultiServices can be treated as sequences of their children. This cleans up the add/remove ChangeSource routines a lot, as we keep exactly one list of the current sources instead of three. * buildbot/master.py (BuildMaster.__init__): remove .sources, set up an empty ChangeMaster at init time. (BuildMaster.loadChanges): if there are changes to be had from disk, replace self.change_svc with the new ones. If not, keep using the empty ChangeMaster set up in __init__. (BuildMaster.loadConfig_Sources): use list(self.change_svc) instead of a separate list, makes the code a bit cleaner. * buildbot/test/test_config.py (ConfigTest.testSimple): match it (ConfigTest.testSources): same, also wait for loadConfig to finish. Extend the test to make sure we can get rid of the sources when we're done. Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/changes.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- changes.py 22 Apr 2005 21:29:19 -0000 1.19 +++ changes.py 23 Apr 2005 10:22:10 -0000 1.20 @@ -8,6 +8,7 @@ import pickle from twisted.python import log, components +from twisted.internet import defer from twisted.spread import pb from twisted.application import service from twisted.cred import portal @@ -157,7 +158,7 @@ """ - debug = 0 + debug = False # todo: use Maildir class to watch for changes arriving by mail def __init__(self): @@ -166,7 +167,6 @@ # self.basedir must be filled in by the parent # self.botmaster too self.nextNumber = 1 - self.sources = [] # for status page: what sources are being monitored def addSource(self, source): assert components.implements(source, interfaces.IChangeSource) @@ -174,13 +174,12 @@ if self.debug: print "ChangeMaster.addSource", source source.setServiceParent(self) - self.sources.append(source) def removeSource(self, source): + assert source in self if self.debug: - print "ChangeMaster.removeSource", source + print "ChangeMaster.removeSource", source, source.parent d = defer.maybeDeferred(source.disownServiceParent) - self.sources.remove(source) return d def addChange(self, change): @@ -226,14 +225,12 @@ del d['services'] # lose all children del d['namedServices'] del d['botmaster'] - del d['sources'] return d def __setstate__(self, d): self.__dict__ = d # self.basedir must be set by the parent # self.botmaster too - self.sources = [] # will be filled when the config file is read self.services = [] # they'll be repopulated by readConfig self.namedServices = {} From warner at users.sourceforge.net Sat Apr 23 10:22:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:22:13 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.370,1.371 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24338 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-73 Creator: Brian Warner clean up ChangeSource handling 2005-04-23 Brian Warner * buildbot/changes/changes.py: import defer, oops (ChangeMaster): remove the .sources list, rely upon the fact that MultiServices can be treated as sequences of their children. This cleans up the add/remove ChangeSource routines a lot, as we keep exactly one list of the current sources instead of three. * buildbot/master.py (BuildMaster.__init__): remove .sources, set up an empty ChangeMaster at init time. (BuildMaster.loadChanges): if there are changes to be had from disk, replace self.change_svc with the new ones. If not, keep using the empty ChangeMaster set up in __init__. (BuildMaster.loadConfig_Sources): use list(self.change_svc) instead of a separate list, makes the code a bit cleaner. * buildbot/test/test_config.py (ConfigTest.testSimple): match it (ConfigTest.testSources): same, also wait for loadConfig to finish. Extend the test to make sure we can get rid of the sources when we're done. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.370 retrieving revision 1.371 diff -u -d -r1.370 -r1.371 --- ChangeLog 23 Apr 2005 00:01:22 -0000 1.370 +++ ChangeLog 23 Apr 2005 10:22:11 -0000 1.371 @@ -1,3 +1,23 @@ +2005-04-23 Brian Warner + + * buildbot/changes/changes.py: import defer, oops + (ChangeMaster): remove the .sources list, rely upon the fact that + MultiServices can be treated as sequences of their children. This + cleans up the add/remove ChangeSource routines a lot, as we keep + exactly one list of the current sources instead of three. + + * buildbot/master.py (BuildMaster.__init__): remove .sources, set + up an empty ChangeMaster at init time. + (BuildMaster.loadChanges): if there are changes to be had from + disk, replace self.change_svc with the new ones. If not, keep + using the empty ChangeMaster set up in __init__. + (BuildMaster.loadConfig_Sources): use list(self.change_svc) + instead of a separate list, makes the code a bit cleaner. + * buildbot/test/test_config.py (ConfigTest.testSimple): match it + (ConfigTest.testSources): same, also wait for loadConfig to finish. + Extend the test to make sure we can get rid of the sources when + we're done. + 2005-04-22 Brian Warner * buildbot/scripts/runner.py (Maker.mkinfo): create the info/admin From warner at users.sourceforge.net Sat Apr 23 10:37:02 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:37:02 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.11,1.12 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32571/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-75 Creator: Brian Warner make 'buildbot statusgui' work again, at least somewhat 2005-04-23 Brian Warner * buildbot/scripts/runner.py: make 'statuslog' and 'statusgui' be the sub-commands that log buildmaster status to stdout and to a GUI window, respectively. * buildbot/clients/gtkPanes.py: overhaul. basic two-row functionality is working again, but all the step-status and ETA stuff is missing. Commented out a lot of code pending more overhaul work. * buildbot/status/client.py: make sure that IRemote(None) is None Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- runner.py 23 Apr 2005 00:01:21 -0000 1.11 +++ runner.py 23 Apr 2005 10:37:00 -0000 1.12 @@ -211,7 +211,7 @@ d = debug.DebugWidget(config['master'], config['passwd']) d.run() -class StatusGuiClientOptions(usage.Options): +class StatusClientOptions(usage.Options): optFlags = [ ['help', 'h', "Display this message"], ] @@ -226,13 +226,16 @@ if len(args) > 1: raise usage.UsageError("I wasn't expecting so many arguments") -def statusgui(config): - #from buildbot.clients import gtkPanes - #c = gtkPanes.GtkClient(config['master']) +def statuslog(config): from buildbot.clients import base c = base.TextClient(config['master']) c.run() +def statusgui(config): + from buildbot.clients import gtkPanes + c = gtkPanes.GtkClient(config['master']) + c.run() + class Options(usage.Options): synopsis = "Usage: buildbot [command options]" @@ -250,7 +253,9 @@ ['debugclient', None, DebugClientOptions, "Launch a small debug panel GUI"], - ['status_gui', None, StatusGuiClientOptions, + ['statuslog', None, StatusClientOptions, + "Emit current builder status to stdout"], + ['statusgui', None, StatusClientOptions, "Display a small window showing current builder status"], # TODO: 'try', 'watch' @@ -287,5 +292,7 @@ stop(so, "-HUP") elif command == "debugclient": debugclient(so) - elif command == "status_gui": + elif command == "statuslog": + statuslog(so) + elif command == "statusgui": statusgui(so) From warner at users.sourceforge.net Sat Apr 23 10:37:02 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:37:02 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status client.py,1.14,1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32571/buildbot/status Modified Files: client.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-75 Creator: Brian Warner make 'buildbot statusgui' work again, at least somewhat 2005-04-23 Brian Warner * buildbot/scripts/runner.py: make 'statuslog' and 'statusgui' be the sub-commands that log buildmaster status to stdout and to a GUI window, respectively. * buildbot/clients/gtkPanes.py: overhaul. basic two-row functionality is working again, but all the step-status and ETA stuff is missing. Commented out a lot of code pending more overhaul work. * buildbot/status/client.py: make sure that IRemote(None) is None Index: client.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/client.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- client.py 6 Dec 2004 07:36:33 -0000 1.14 +++ client.py 23 Apr 2005 10:37:00 -0000 1.15 @@ -15,6 +15,10 @@ class IRemote(components.Interface): pass +# make sure that IRemote(None) is None +components.registerAdapter(lambda n: None, + type(None), IRemote) + class RemoteBuilder(pb.Referenceable): def __init__(self, builder): self.b = builder @@ -43,6 +47,7 @@ def remote_getEvent(self, number): return IRemote(self.b.getEvent(number)) + components.registerAdapter(RemoteBuilder, interfaces.IBuilderStatus, IRemote) @@ -140,6 +145,7 @@ def remote_getResults(self): return self.s.getResults() + components.registerAdapter(RemoteBuildStep, interfaces.IBuildStepStatus, IRemote) @@ -155,6 +161,7 @@ return self.s.getHost() def remote_isConnected(self): return self.s.isConnected() + components.registerAdapter(RemoteSlave, interfaces.ISlaveStatus, IRemote) @@ -168,6 +175,7 @@ return self.s.getText() def remote_getColor(self): return self.s.getColor() + components.registerAdapter(RemoteEvent, interfaces.IStatusEvent, IRemote) @@ -192,6 +200,7 @@ def remote_getChunks(self): return self.l.getChunks() # TODO: subscription interface + components.registerAdapter(RemoteLog, builder.LogFile, IRemote) # TODO: something similar for builder.HTMLLogfile ? @@ -205,6 +214,7 @@ return self.c.files def getComments(self): return self.c.comments + components.registerAdapter(RemoteChange, changes.Change, IRemote) From warner at users.sourceforge.net Sat Apr 23 10:37:03 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:37:03 +0000 Subject: [Buildbot-commits] buildbot/buildbot/clients gtkPanes.py,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32571/buildbot/clients Modified Files: gtkPanes.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-75 Creator: Brian Warner make 'buildbot statusgui' work again, at least somewhat 2005-04-23 Brian Warner * buildbot/scripts/runner.py: make 'statuslog' and 'statusgui' be the sub-commands that log buildmaster status to stdout and to a GUI window, respectively. * buildbot/clients/gtkPanes.py: overhaul. basic two-row functionality is working again, but all the step-status and ETA stuff is missing. Commented out a lot of code pending more overhaul work. * buildbot/status/client.py: make sure that IRemote(None) is None Index: gtkPanes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/clients/gtkPanes.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gtkPanes.py 5 Dec 2003 10:00:55 -0000 1.7 +++ gtkPanes.py 23 Apr 2005 10:37:00 -0000 1.8 @@ -6,30 +6,19 @@ from twisted.internet import reactor import sys, time -#from twisted.python import log -#log.startLogging(sys.stdout) -# requires PyGTK 1.99.15, otherwise you get spurious complaints about -# multiple pygtk.require calls import pygtk pygtk.require("2.0") import gtk +assert(gtk.Window) # in gtk1 it's gtk.GtkWindow from twisted.spread import pb -from buildbot.clients.base import Builder, Client -from buildbot.status import event -from buildbot.util import now - -assert(gtk.Window) # in gtk1 it's gtk.GtkWindow - -class GtkUpdatingEvent(event.RemoteEvent): - def observe_update(self, **kwargs): - event.RemoteEvent.observe_update(self, **kwargs) - self.builder.updateCurrent() - -pb.setUnjellyableForClass(event.Event, GtkUpdatingEvent) +#from buildbot.clients.base import Builder, Client +from buildbot.clients.base import TextClient +#from buildbot.util import now +''' class Pane: def __init__(self): pass @@ -267,23 +256,145 @@ self.stopTimer() self.updateText() eta.callRemote("unsubscribe", self) - -class GtkClient(Client): - RowClass = OneRow - BuilderClass = R2Builder - def __init__(self): - Client.__init__(self) +''' + +class TwoRowBuilder: + def __init__(self, ref): + self.lastbox = lastbox = gtk.EventBox() + self.lastlabel = lastlabel = gtk.Label("?") + lastbox.add(lastlabel) + lastbox.set_size_request(64,64) + + self.currentbox = currentbox = gtk.EventBox() + self.currentlabel = currentlabel = gtk.Label("?") + currentbox.add(currentlabel) + currentbox.set_size_request(64,64) + + self.ref = ref + + def setColor(self, box, color): + box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) + + def getLastBuild(self): + d = self.ref.callRemote("getLastFinishedBuild") + d.addCallback(self.gotLastBuild) + def gotLastBuild(self, build): + if build: + build.callRemote("getText").addCallback(self.gotLastText) + build.callRemote("getColor").addCallback(self.gotLastColor) + + def gotLastText(self, text): + self.lastlabel.set_text("\n".join(text)) + def gotLastColor(self, color): + self.setColor(self.lastbox, color) + + def getState(self): + self.ref.callRemote("getState").addCallback(self.gotState) + def gotState(self, res): + state, ETA, build = res + # state is one of: offline, idle, waiting, interlocked, building + currentmap = {"offline": "red", + "idle": "white", + "waiting": "yellow", + "interlocked": "yellow", + "building": "yellow",} + text = state + self.setColor(self.currentbox, currentmap[state]) + if ETA is not None: + text += "\nETA=%s secs" % ETA + self.currentlabel.set_text(state) + + def buildStarted(self, build): + pass + def buildFinished(self, build, results): + self.gotLastBuild(build) + + +class TwoRowClient(pb.Referenceable): + def __init__(self, window): + self.window = window + self.buildernames = [] + self.builders = {} + + def connected(self, ref): + print "connected" + self.ref = ref + self.pane = gtk.VBox(False, 2) + self.table = gtk.Table(1+2, 1) + self.pane.add(self.table) + self.window.vb.add(self.pane) + self.pane.show_all() + ref.callRemote("subscribe", "builds", 5, self) + + def removeTable(self): + for child in self.table.get_children(): + self.table.remove(child) + self.pane.remove(self.table) + + def makeTable(self): + columns = len(self.builders) + self.table = gtk.Table(2, columns) + self.pane.add(self.table) + for i in range(len(self.buildernames)): + name = self.buildernames[i] + b = self.builders[name] + self.table.attach(gtk.Label(name), i, i+1, 0, 1) + self.table.attach(b.lastbox, i, i+1, 1, 2, + xpadding=1, ypadding=1) + self.table.attach(b.currentbox, i, i+1, 2, 3, + xpadding=1, ypadding=1) + self.table.show_all() + + def rebuildTable(self): + self.removeTable() + self.makeTable() + + def remote_builderAdded(self, buildername, builder): + print "builderAdded", buildername + assert buildername not in self.buildernames + self.buildernames.append(buildername) + + b = TwoRowBuilder(builder) + self.builders[buildername] = b + self.rebuildTable() + b.getLastBuild() + b.getState() + + def remote_builderRemoved(self, buildername): + self.builders.remove(buildername) + del self.builder_ref[buildername] + self.rebuildTable() + + def remote_builderChangedState(self, name, state, eta): + self.builders[name].gotState((state, eta, None)) + def remote_buildStarted(self, name, build): + self.builders[name].buildStarted(build) + def remote_buildFinished(self, name, build, results): + self.builders[name].buildFinished(build, results) + + +class GtkClient(TextClient): + ClientClass = TwoRowClient + + def __init__(self, master): + self.master = master + w = gtk.Window() self.w = w #w.set_size_request(64,64) w.connect('destroy', lambda win: gtk.main_quit()) - self.vb = gtk.VBox(gtk.FALSE, 2) + self.vb = gtk.VBox(False, 2) self.status = gtk.Label("unconnected") self.vb.add(self.status) - self.pane = self.RowClass() - self.vb.add(self.pane.getWidget()) + self.listener = self.ClientClass(self) w.add(self.vb) w.show_all() + + def connected(self, ref): + self.status.set_text("connected") + TextClient.connected(self, ref) + +""" def addBuilder(self, name, builder): Client.addBuilder(self, name, builder) self.pane.addBuilder(builder) @@ -301,18 +412,14 @@ remote.notifyOnDisconnect(self.disconnected) def disconnected(self, remote): self.status.set_text("disconnected, will retry") - -class CompactGtkClient(GtkClient): - RowClass = CompactRow - BuilderClass = CompactBuilder +""" def main(): master = "localhost:8007" if len(sys.argv) > 1: master = sys.argv[1] - a = CompactGtkClient() - a.startConnecting(master) - reactor.run() + c = GtkClient(master) + c.run() if __name__ == '__main__': main() From warner at users.sourceforge.net Sat Apr 23 10:37:03 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:37:03 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.371,1.372 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32571 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-75 Creator: Brian Warner make 'buildbot statusgui' work again, at least somewhat 2005-04-23 Brian Warner * buildbot/scripts/runner.py: make 'statuslog' and 'statusgui' be the sub-commands that log buildmaster status to stdout and to a GUI window, respectively. * buildbot/clients/gtkPanes.py: overhaul. basic two-row functionality is working again, but all the step-status and ETA stuff is missing. Commented out a lot of code pending more overhaul work. * buildbot/status/client.py: make sure that IRemote(None) is None Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.371 retrieving revision 1.372 diff -u -d -r1.371 -r1.372 --- ChangeLog 23 Apr 2005 10:22:11 -0000 1.371 +++ ChangeLog 23 Apr 2005 10:37:01 -0000 1.372 @@ -1,5 +1,16 @@ 2005-04-23 Brian Warner + * buildbot/scripts/runner.py: make 'statuslog' and 'statusgui' be + the sub-commands that log buildmaster status to stdout and to a + GUI window, respectively. + + * buildbot/clients/gtkPanes.py: overhaul. basic two-row + functionality is working again, but all the step-status and ETA + stuff is missing. Commented out a lot of code pending more + overhaul work. + + * buildbot/status/client.py: make sure that IRemote(None) is None + * buildbot/changes/changes.py: import defer, oops (ChangeMaster): remove the .sources list, rely upon the fact that MultiServices can be treated as sequences of their children. This From warner at users.sourceforge.net Sat Apr 23 10:38:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:38:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_slavecommand.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv953/buildbot/test Modified Files: test_slavecommand.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-77 Creator: Brian Warner increase timeouts on test_slavecommand tests * buildbot/test/test_slavecommand.py (Shell): increase timeouts Index: test_slavecommand.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- test_slavecommand.py 21 Apr 2005 19:53:32 -0000 1.9 +++ test_slavecommand.py 23 Apr 2005 10:38:31 -0000 1.10 @@ -132,7 +132,7 @@ def testShell1(self): cmd = sys.executable + " emit.py 0" - args = {'command': cmd, 'workdir': '.', 'timeout': 5} + args = {'command': cmd, 'workdir': '.', 'timeout': 60} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) self.checkOutput([('stdout', "this is stdout\n"), @@ -141,7 +141,7 @@ def testShell2(self): cmd = sys.executable + " emit.py 1" - args = {'command': cmd, 'workdir': '.', 'timeout': 5} + args = {'command': cmd, 'workdir': '.', 'timeout': 60} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) self.checkOutput([('stdout', "this is stdout\n"), @@ -151,7 +151,7 @@ def testShell3(self): cmd = sys.executable + " emit.py 0" args = {'command': cmd, 'workdir': '.', - 'env': {'EMIT_TEST': "envtest"}, 'timeout': 5} + 'env': {'EMIT_TEST': "envtest"}, 'timeout': 60} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) self.checkOutput([('stdout', "this is stdout\n"), @@ -162,7 +162,7 @@ def testShell4(self): cmd = sys.executable + " emit.py 0" - args = {'command': cmd, 'workdir': "subdir", 'timeout': 5} + args = {'command': cmd, 'workdir': "subdir", 'timeout': 60} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) self.checkOutput([('stdout', "this is stdout in subdir\n"), @@ -171,7 +171,7 @@ def testShellZ(self): args = {'command': "/bin/EndWorldHungerAndMakePigsFly", - 'workdir': '.', 'timeout': 5} + 'workdir': '.', 'timeout': 10} failed = self.doTest(SlaveShellCommand, args) self.failIf(failed) self.failUnless(self.getrc() != 0) From warner at users.sourceforge.net Sat Apr 23 10:38:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:38:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.372,1.373 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv953 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-77 Creator: Brian Warner increase timeouts on test_slavecommand tests * buildbot/test/test_slavecommand.py (Shell): increase timeouts Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.372 retrieving revision 1.373 diff -u -d -r1.372 -r1.373 --- ChangeLog 23 Apr 2005 10:37:01 -0000 1.372 +++ ChangeLog 23 Apr 2005 10:38:31 -0000 1.373 @@ -1,5 +1,7 @@ 2005-04-23 Brian Warner + * buildbot/test/test_slavecommand.py (Shell): increase timeouts + * buildbot/scripts/runner.py: make 'statuslog' and 'statusgui' be the sub-commands that log buildmaster status to stdout and to a GUI window, respectively. From warner at users.sourceforge.net Sat Apr 23 10:47:55 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:47:55 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.373,1.374 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5077 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-79 Creator: Brian Warner increase timeouts on test_vc too * buildbot/test/test_vc.py (SetupMixin.do_vc): increase timeouts Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.373 retrieving revision 1.374 diff -u -d -r1.373 -r1.374 --- ChangeLog 23 Apr 2005 10:38:31 -0000 1.373 +++ ChangeLog 23 Apr 2005 10:47:53 -0000 1.374 @@ -1,5 +1,7 @@ 2005-04-23 Brian Warner + * buildbot/test/test_vc.py (SetupMixin.do_vc): increase timeouts + * buildbot/test/test_slavecommand.py (Shell): increase timeouts * buildbot/scripts/runner.py: make 'statuslog' and 'statusgui' be From warner at users.sourceforge.net Sat Apr 23 10:47:55 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 10:47:55 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.23,1.24 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5077/buildbot/test Modified Files: test_vc.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-79 Creator: Brian Warner increase timeouts on test_vc too * buildbot/test/test_vc.py (SetupMixin.do_vc): increase timeouts Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- test_vc.py 20 Apr 2005 19:32:46 -0000 1.23 +++ test_vc.py 23 Apr 2005 10:47:53 -0000 1.24 @@ -255,7 +255,7 @@ vcdir = os.path.join(self.slavebase, "vc-dir", "source") workdir = os.path.join(self.slavebase, "vc-dir", "build") # woo double-substitution - s = "s(%s, timeout=20, workdir='build', mode='%%s'" % (vctype,) + s = "s(%s, timeout=200, workdir='build', mode='%%s'" % (vctype,) for k,v in args.items(): s += ", %s='%s'" % (k, v) s += ")" From warner at users.sourceforge.net Sat Apr 23 20:07:49 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 20:07:49 +0000 Subject: [Buildbot-commits] buildbot/buildbot interfaces.py,1.22,1.23 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15098/buildbot Modified Files: interfaces.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-81 Creator: Brian Warner Merged docs from [org.apestaart at thomas/buildbot--doc--0--patch-9] Patches applied: * org.apestaart at thomas/buildbot--doc--0--patch-8 more docs * org.apestaart at thomas/buildbot--doc--0--patch-9 fix an accidental indent error on my part Index: interfaces.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- interfaces.py 18 Apr 2005 00:26:56 -0000 1.22 +++ interfaces.py 23 Apr 2005 20:07:46 -0000 1.23 @@ -154,7 +154,11 @@ finished.""" def getBuilder(): - """Return the name of the Builder that ran this build.""" + """ + Return the BuilderStatus that ran this build. + + @rtype: implementor of L{IBuilderStatus} + """ def getNumber(): """Within each builder, each Build has a number. Return it.""" @@ -307,7 +311,7 @@ may have spaces in it.""" def getBuild(): - """Returns an IBuildStatus object which contains this step.""" + """Returns the IBuildStatus object which contains this step.""" def getTimes(): """Returns a tuple of (start, end). 'start' and 'end' are the times @@ -499,9 +503,15 @@ subscribed to an IStatus, an IBuilderStatus, or an IBuildStatus.""" def builderAdded(builderName, builder): - """A new Builder has just been added. This method may return an - IStatusTarget (probably 'self') which will be subscribed to receive - builderChangedState and buildStarted/Finished events.""" + """ + A new Builder has just been added. This method may return an + IStatusReceiver (probably 'self') which will be subscribed to receive + builderChangedState and buildStarted/Finished events. + + @type builderName: string + @type builder: L{buildbot.status.builder.BuilderStatus} + @rtype: implementor of L{IStatusReceiver} + """ def builderChangedState(builderName, state, eta=None): """Builder 'builderName' has changed state. The possible values for @@ -514,13 +524,12 @@ object which implements IBuildStatus, and can be queried for more information. - This method may return an IStatusTarget (it could even return + This method may return an IStatusReceiver (it could even return 'self'). If it does so, stepStarted and stepFinished methods will be invoked on the object for the steps of this one build. This is a - convenient way to subscribe to all build steps without missing - any. + convenient way to subscribe to all build steps without missing any. - It can also return a tuple of (IStatusTarget, interval), in which + It can also return a tuple of (IStatusReceiver, interval), in which case buildETAUpdate messages are sent ever 'interval' seconds, in addition to the stepStarted and stepFinished messages.""" @@ -532,12 +541,12 @@ """A step has just started. 'step' is the IBuildStepStatus which represents the step: it can be queried for more information. - This method may return an IStatusTarget (it could even return + This method may return an IStatusReceiver (it could even return 'self'). If it does so, logStarted and logFinished methods will be invoked on the object for logs created by this one step. - Alternatively, the method may return a tuple of an IStatusTarget and - an integer named 'updateInterval'. In addition to + Alternatively, the method may return a tuple of an IStatusReceiver + and an integer named 'updateInterval'. In addition to logStarted/logFinished messages, it will also receive stepETAUpdate messages about every updateInterval seconds.""" @@ -553,7 +562,7 @@ started running a shell command. 'log' is the IStatusLog object which can be queried for more information. - This method may return an IStatusTarget (such as 'self'), in which + This method may return an IStatusReceiver (such as 'self'), in which case the target's logChunk method will be invoked as text is added to the logfile. """ @@ -569,8 +578,14 @@ in IBuildStepStatus.getResults.""" def buildFinished(builderName, build, results): - """A build has just finished. 'results' is the result tuple described - in IBuildStatus.getResults.""" + """ + A build has just finished. 'results' is the result tuple described + in L{IBuildStatus.getResults}. + + @type builderName: string + @type build: L{buildbot.status.builder.BuildStatus} + @type results: tuple + """ def builderRemoved(builderName): """The Builder has been removed.""" From warner at users.sourceforge.net Sat Apr 23 20:07:49 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 20:07:49 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.374,1.375 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15098 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-81 Creator: Brian Warner Merged docs from [org.apestaart at thomas/buildbot--doc--0--patch-9] Patches applied: * org.apestaart at thomas/buildbot--doc--0--patch-8 more docs * org.apestaart at thomas/buildbot--doc--0--patch-9 fix an accidental indent error on my part Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.374 retrieving revision 1.375 diff -u -d -r1.374 -r1.375 --- ChangeLog 23 Apr 2005 10:47:53 -0000 1.374 +++ ChangeLog 23 Apr 2005 20:07:47 -0000 1.375 @@ -1,3 +1,10 @@ +2005-04-23 Thomas Vander Stichele + + * buildbot/interfaces.py: + * buildbot/status/builder.py: + more documentation. Hm, not sure if ChangeLog entries make sense + here... + 2005-04-23 Brian Warner * buildbot/test/test_vc.py (SetupMixin.do_vc): increase timeouts From warner at users.sourceforge.net Sat Apr 23 20:07:49 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 23 Apr 2005 20:07:49 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py,1.49,1.50 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15098/buildbot/status Modified Files: builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-81 Creator: Brian Warner Merged docs from [org.apestaart at thomas/buildbot--doc--0--patch-9] Patches applied: * org.apestaart at thomas/buildbot--doc--0--patch-8 more docs * org.apestaart at thomas/buildbot--doc--0--patch-9 fix an accidental indent error on my part Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- builder.py 19 Apr 2005 07:45:19 -0000 1.49 +++ builder.py 23 Apr 2005 20:07:47 -0000 1.50 @@ -554,6 +554,10 @@ testResults = {} def __init__(self, parent, number): + """ + @type parent: L{BuilderStatus} + @type number: int + """ self.builder = parent self.number = number self.watchers = [] @@ -565,6 +569,9 @@ # IBuildStatus def getBuilder(self): + """ + @rtype: L{BuilderStatus} + """ return self.builder def getNumber(self): From warner at users.sourceforge.net Sun Apr 24 21:30:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:30:27 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process factory.py,1.8,1.9 step.py,1.61,1.62 base.py,1.47,1.48 interlock.py,1.6,1.7 step_twisted.py,1.67,1.68 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29418/buildbot/process Modified Files: factory.py step.py base.py interlock.py step_twisted.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-83 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--waterfall--0--patch-22 Merged builder-categories and waterfall CSS work from Thomas. Also added test-case-name tags. Patches applied: * org.apestaart at thomas/buildbot--trial--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--trial--0--patch-1 adding test-case-name * org.apestaart at thomas/buildbot--waterfall--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-1 * org.apestaart at thomas/buildbot--waterfall--0--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-3 * org.apestaart at thomas/buildbot--waterfall--0--patch-4 * org.apestaart at thomas/buildbot--waterfall--0--patch-5 * org.apestaart at thomas/buildbot--waterfall--0--patch-6 * org.apestaart at thomas/buildbot--waterfall--0--patch-7 * org.apestaart at thomas/buildbot--waterfall--0--patch-8 * org.apestaart at thomas/buildbot--waterfall--0--patch-9 merge for test-case-name * org.apestaart at thomas/buildbot--waterfall--0--patch-10 unittests + fixes for status.mail category filtering * org.apestaart at thomas/buildbot--waterfall--0--patch-11 fix testsuite by prefixing page title with BuildBot * org.apestaart at thomas/buildbot--waterfall--0--patch-12 move category from Builder to BuilderStatus * org.apestaart at thomas/buildbot--waterfall--0--patch-13 fix silly bug, makes order in waterfall work again * org.apestaart at thomas/buildbot--waterfall--0--patch-14 document category and categories for builders and statusclients * org.apestaart at thomas/buildbot--waterfall--0--patch-15 remove prints from test_run * org.apestaart at thomas/buildbot--waterfall--0--patch-16 remove FIXME and unneeded code for category * org.apestaart at thomas/buildbot--waterfall--0--patch-17 put back "builders" argument * org.apestaart at thomas/buildbot--waterfall--0--patch-18 use class_ to assign a class="" to the html blocks * org.apestaart at thomas/buildbot--waterfall--0--patch-19 cssclass->class_ * org.apestaart at thomas/buildbot--waterfall--0--patch-20 give classes names as agreed * org.apestaart at thomas/buildbot--waterfall--0--patch-21 finish class styling and add EXCEPTION result * org.apestaart at thomas/buildbot--waterfall--0--patch-22 classic buildbot stylesheet Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- base.py 22 Apr 2005 21:29:19 -0000 1.47 +++ base.py 24 Apr 2005 21:30:24 -0000 1.48 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_step -*- import types, time from StringIO import StringIO @@ -283,7 +283,7 @@ log.err(Failure()) self.builder.builder_status.addPointEvent(["setupBuild", "exception"], - color="#c000c0") + color="purple") self.finished = True self.results = FAILURE d = self.deferred @@ -468,7 +468,7 @@ def buildException(self, why): log.msg("%s.buildException" % self) log.err(why) - self.buildFinished(["build", "exception"], "#c000c0", FAILURE) + self.buildFinished(["build", "exception"], "purple", FAILURE) def buildFinished(self, text, color, results): """This method must be called when the last Step has completed. It Index: factory.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/factory.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- factory.py 18 Apr 2005 00:26:56 -0000 1.8 +++ factory.py 24 Apr 2005 21:30:24 -0000 1.9 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_step -*- from buildbot import util from buildbot.process.base import Build Index: interlock.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/interlock.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- interlock.py 19 Apr 2005 07:45:19 -0000 1.6 +++ interlock.py 24 Apr 2005 21:30:24 -0000 1.7 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_interlock -*- from twisted.python import log from buildbot.util import CancelableDeferred Index: step.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- step.py 18 Apr 2005 00:26:56 -0000 1.61 +++ step.py 24 Apr 2005 21:30:24 -0000 1.62 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_steps -*- import time, random, types, re, warnings from email.Utils import formatdate @@ -11,7 +11,8 @@ from buildbot.util import now from buildbot.status import progress, builder -from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, SKIPPED +from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, SKIPPED, \ + EXCEPTION """ BuildStep and RemoteCommand classes for master-side representation of the @@ -554,10 +555,10 @@ self.addHTMLLog("err.html", formatFailure(why)) self.addCompleteLog("err.text", why.getTraceback()) # could use why.getDetailedTraceback() for more information - self.step_status.setColor("#c000c0") + self.step_status.setColor("purple") self.step_status.setText([self.name, "exception"]) self.step_status.setText2([self.name]) - self.step_status.stepFinished(FAILURE) + self.step_status.stepFinished(EXCEPTION) except: log.msg("exception during failure processing") log.err() Index: step_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step_twisted.py,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- step_twisted.py 18 Apr 2005 00:26:57 -0000 1.67 +++ step_twisted.py 24 Apr 2005 21:30:25 -0000 1.68 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_twisted -*- from twisted.python import log, failure From warner at users.sourceforge.net Sun Apr 24 21:30:29 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:30:29 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.25,1.26 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29418/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-83 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--waterfall--0--patch-22 Merged builder-categories and waterfall CSS work from Thomas. Also added test-case-name tags. Patches applied: * org.apestaart at thomas/buildbot--trial--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--trial--0--patch-1 adding test-case-name * org.apestaart at thomas/buildbot--waterfall--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-1 * org.apestaart at thomas/buildbot--waterfall--0--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-3 * org.apestaart at thomas/buildbot--waterfall--0--patch-4 * org.apestaart at thomas/buildbot--waterfall--0--patch-5 * org.apestaart at thomas/buildbot--waterfall--0--patch-6 * org.apestaart at thomas/buildbot--waterfall--0--patch-7 * org.apestaart at thomas/buildbot--waterfall--0--patch-8 * org.apestaart at thomas/buildbot--waterfall--0--patch-9 merge for test-case-name * org.apestaart at thomas/buildbot--waterfall--0--patch-10 unittests + fixes for status.mail category filtering * org.apestaart at thomas/buildbot--waterfall--0--patch-11 fix testsuite by prefixing page title with BuildBot * org.apestaart at thomas/buildbot--waterfall--0--patch-12 move category from Builder to BuilderStatus * org.apestaart at thomas/buildbot--waterfall--0--patch-13 fix silly bug, makes order in waterfall work again * org.apestaart at thomas/buildbot--waterfall--0--patch-14 document category and categories for builders and statusclients * org.apestaart at thomas/buildbot--waterfall--0--patch-15 remove prints from test_run * org.apestaart at thomas/buildbot--waterfall--0--patch-16 remove FIXME and unneeded code for category * org.apestaart at thomas/buildbot--waterfall--0--patch-17 put back "builders" argument * org.apestaart at thomas/buildbot--waterfall--0--patch-18 use class_ to assign a class="" to the html blocks * org.apestaart at thomas/buildbot--waterfall--0--patch-19 cssclass->class_ * org.apestaart at thomas/buildbot--waterfall--0--patch-20 give classes names as agreed * org.apestaart at thomas/buildbot--waterfall--0--patch-21 finish class styling and add EXCEPTION result * org.apestaart at thomas/buildbot--waterfall--0--patch-22 classic buildbot stylesheet Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- commands.py 22 Apr 2005 18:41:02 -0000 1.25 +++ commands.py 24 Apr 2005 21:30:27 -0000 1.26 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_slavecommand -*- import os, os.path, re, signal, shutil, types From warner at users.sourceforge.net Sun Apr 24 21:30:28 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:30:28 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes pb.py,1.5,1.6 mail.py,1.15,1.16 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29418/buildbot/changes Modified Files: pb.py mail.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-83 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--waterfall--0--patch-22 Merged builder-categories and waterfall CSS work from Thomas. Also added test-case-name tags. Patches applied: * org.apestaart at thomas/buildbot--trial--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--trial--0--patch-1 adding test-case-name * org.apestaart at thomas/buildbot--waterfall--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-1 * org.apestaart at thomas/buildbot--waterfall--0--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-3 * org.apestaart at thomas/buildbot--waterfall--0--patch-4 * org.apestaart at thomas/buildbot--waterfall--0--patch-5 * org.apestaart at thomas/buildbot--waterfall--0--patch-6 * org.apestaart at thomas/buildbot--waterfall--0--patch-7 * org.apestaart at thomas/buildbot--waterfall--0--patch-8 * org.apestaart at thomas/buildbot--waterfall--0--patch-9 merge for test-case-name * org.apestaart at thomas/buildbot--waterfall--0--patch-10 unittests + fixes for status.mail category filtering * org.apestaart at thomas/buildbot--waterfall--0--patch-11 fix testsuite by prefixing page title with BuildBot * org.apestaart at thomas/buildbot--waterfall--0--patch-12 move category from Builder to BuilderStatus * org.apestaart at thomas/buildbot--waterfall--0--patch-13 fix silly bug, makes order in waterfall work again * org.apestaart at thomas/buildbot--waterfall--0--patch-14 document category and categories for builders and statusclients * org.apestaart at thomas/buildbot--waterfall--0--patch-15 remove prints from test_run * org.apestaart at thomas/buildbot--waterfall--0--patch-16 remove FIXME and unneeded code for category * org.apestaart at thomas/buildbot--waterfall--0--patch-17 put back "builders" argument * org.apestaart at thomas/buildbot--waterfall--0--patch-18 use class_ to assign a class="" to the html blocks * org.apestaart at thomas/buildbot--waterfall--0--patch-19 cssclass->class_ * org.apestaart at thomas/buildbot--waterfall--0--patch-20 give classes names as agreed * org.apestaart at thomas/buildbot--waterfall--0--patch-21 finish class styling and add EXCEPTION result * org.apestaart at thomas/buildbot--waterfall--0--patch-22 classic buildbot stylesheet Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/mail.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- mail.py 8 Nov 2004 19:43:51 -0000 1.15 +++ mail.py 24 Apr 2005 21:30:26 -0000 1.16 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_mailparse -*- """ Parse various kinds of 'CVS notify' email. Index: pb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/pb.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- pb.py 6 Dec 2004 07:36:33 -0000 1.5 +++ pb.py 24 Apr 2005 21:30:25 -0000 1.6 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_changes -*- import os, os.path From warner at users.sourceforge.net Sun Apr 24 21:30:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:30:27 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status progress.py,1.10,1.11 client.py,1.15,1.16 html.py,1.54,1.55 words.py,1.33,1.34 builder.py,1.50,1.51 mail.py,1.14,1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29418/buildbot/status Modified Files: progress.py client.py html.py words.py builder.py mail.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-83 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--waterfall--0--patch-22 Merged builder-categories and waterfall CSS work from Thomas. Also added test-case-name tags. Patches applied: * org.apestaart at thomas/buildbot--trial--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--trial--0--patch-1 adding test-case-name * org.apestaart at thomas/buildbot--waterfall--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-1 * org.apestaart at thomas/buildbot--waterfall--0--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-3 * org.apestaart at thomas/buildbot--waterfall--0--patch-4 * org.apestaart at thomas/buildbot--waterfall--0--patch-5 * org.apestaart at thomas/buildbot--waterfall--0--patch-6 * org.apestaart at thomas/buildbot--waterfall--0--patch-7 * org.apestaart at thomas/buildbot--waterfall--0--patch-8 * org.apestaart at thomas/buildbot--waterfall--0--patch-9 merge for test-case-name * org.apestaart at thomas/buildbot--waterfall--0--patch-10 unittests + fixes for status.mail category filtering * org.apestaart at thomas/buildbot--waterfall--0--patch-11 fix testsuite by prefixing page title with BuildBot * org.apestaart at thomas/buildbot--waterfall--0--patch-12 move category from Builder to BuilderStatus * org.apestaart at thomas/buildbot--waterfall--0--patch-13 fix silly bug, makes order in waterfall work again * org.apestaart at thomas/buildbot--waterfall--0--patch-14 document category and categories for builders and statusclients * org.apestaart at thomas/buildbot--waterfall--0--patch-15 remove prints from test_run * org.apestaart at thomas/buildbot--waterfall--0--patch-16 remove FIXME and unneeded code for category * org.apestaart at thomas/buildbot--waterfall--0--patch-17 put back "builders" argument * org.apestaart at thomas/buildbot--waterfall--0--patch-18 use class_ to assign a class="" to the html blocks * org.apestaart at thomas/buildbot--waterfall--0--patch-19 cssclass->class_ * org.apestaart at thomas/buildbot--waterfall--0--patch-20 give classes names as agreed * org.apestaart at thomas/buildbot--waterfall--0--patch-21 finish class styling and add EXCEPTION result * org.apestaart at thomas/buildbot--waterfall--0--patch-22 classic buildbot stylesheet Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- builder.py 23 Apr 2005 20:07:47 -0000 1.50 +++ builder.py 24 Apr 2005 21:30:25 -0000 1.51 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_status -*- from __future__ import generators @@ -14,8 +14,8 @@ # sibling imports from buildbot import interfaces, util -SUCCESS, WARNINGS, FAILURE, SKIPPED = range(4) -Results = ["success", "warnings", "failure", "skipped"] +SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION = range(5) +Results = ["success", "warnings", "failure", "skipped", "exception"] # build processes call the following methods: @@ -378,7 +378,7 @@ return self.progress.remaining() # Once you know the step has finished, the following methods are legal. - # Before ths step has finished, they all return None. + # Before this step has finished, they all return None. def getText(self): """Returns a list of strings which describe the step. These are @@ -389,8 +389,8 @@ def getColor(self): """Returns a single string with the color that should be used to - display this step. 'green', 'orange', 'red' and 'yellow' are the - most likely ones.""" + display this step. 'green', 'orange', 'red', 'yellow' and 'purple' + are the most likely ones.""" return self.color def getResults(self): @@ -848,6 +848,10 @@ I live in the buildbot.process.base.Builder object, in the .statusbag attribute. + + @type category: string + @ivar category: user-defined category this builder belongs to; can be + used to filter on in status clients """ __implements__ = interfaces.IBuilderStatus, @@ -858,14 +862,16 @@ stepHorizon = 50 # prune steps in builds beyond this logHorizon = 20 # prune logs in builds beyond this slavename = None + category = None currentBuild = None currentBigState = "offline" # or idle/waiting/interlocked/building ETA = None nextBuildNumber = 0 basedir = None # filled in by our parent - def __init__(self, buildername): + def __init__(self, buildername, category=None): self.name = buildername + self.category = category self.events = [] # these three hold Events, and are used to retrieve the current @@ -1082,7 +1088,6 @@ eventIndex -= 1 e = self.getEvent(eventIndex) - def subscribe(self, receiver): # will get builderChangedState, buildStarted, and buildFinished self.watchers.append(receiver) @@ -1413,8 +1418,18 @@ def getBuildbotURL(self): return self.botmaster.parent.buildbotURL - def getBuilderNames(self): - return self.botmaster.builderNames[:] # don't let them break it + def getBuilderNames(self, categories=None): + if categories == None: + return self.botmaster.builderNames[:] # don't let them break it + + l = [] + # respect addition order + for name in self.botmaster.builderNames: + builder = self.botmaster.builders[name] + if builder.builder_status.category in categories: + l.append(name) + return l + def getBuilder(self, name): """ @rtype: L{BuilderStatus} @@ -1436,7 +1451,7 @@ if t: builder_status.subscribe(t) - def builderAdded(self, name, basedir): + def builderAdded(self, name, basedir, category=None): """ @rtype: L{BuilderStatus} """ @@ -1450,8 +1465,12 @@ except: log.msg("error while loading status pickle, creating a new one") if not builder_status: - builder_status = BuilderStatus(name) + builder_status = BuilderStatus(name, category) builder_status.addPointEvent(["builder", "created"]) + log.msg("added builder %s in category %s" % (name, category)) + # an unpickled object might not have category set from before, + # so set it here to make sure + builder_status.category = category builder_status.basedir = os.path.join(self.basedir, basedir) builder_status.status = self Index: client.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/client.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- client.py 23 Apr 2005 10:37:00 -0000 1.15 +++ client.py 24 Apr 2005 21:30:25 -0000 1.16 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_status -*- from twisted.spread import pb from twisted.python import log, components Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- html.py 20 Apr 2005 20:13:25 -0000 1.54 +++ html.py 24 Apr 2005 21:30:25 -0000 1.55 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_web -*- from __future__ import generators @@ -69,8 +69,11 @@ if comment: data += "" % comment data += " parameters that Events # lack, and it has a base URL to which each File's name is relative. # Events don't know about HTML. spacer = False - def __init__(self, text=[], color=None, urlbase=None, **parms): + def __init__(self, text=[], color=None, class_=None, urlbase=None, + **parms): self.text = text self.color = color + self.class_ = class_ self.urlbase = urlbase self.show_idle = 0 if parms.has_key('show_idle'): @@ -105,10 +133,11 @@ text = self.text if not text and self.show_idle: text = ["[idle]"] - return td(text, props, bgcolor=self.color) + return td(text, props, bgcolor=self.color, class_=self.class_) class HtmlResource(Resource): + css = None contentType = "text/html" def render(self, request): data = self.content(request) @@ -120,6 +149,10 @@ title = "Dummy" def content(self, request): data = "\n" + self.title + "\n" + if self.css: + data += ("\n" % self.css) data += "\n" data += self.body(request) data += "\n" @@ -129,6 +162,7 @@ class StaticHTML(HtmlResource): def __init__(self, body, title): + HtmlResource.__init__(self) self.bodyHTML = body self.title = title def body(self, request): @@ -666,20 +700,21 @@ else: text.extend(["ETA: ?"]) - return Box(text, color) + return Box(text, color=color, class_="Activity " + state) components.registerAdapter(CurrentBox, builder.BuilderStatus, ICurrentBox) -class CommitBox(components.Adapter): +class ChangeBox(components.Adapter): __implements__ = IBox, def getBox(self): url = "changes/%d" % self.original.number text = '%s' % (url, html.escape(self.original.who)) - return Box([text], "white") -components.registerAdapter(CommitBox, changes.Change, IBox) + return Box([text], color="white", class_="Change") +components.registerAdapter(ChangeBox, changes.Change, IBox) class BuildBox(components.Adapter): # this provides the yellow "starting line" box for each build __implements__ = IBox, + def getBox(self): b = self.original name = b.getBuilder().getName() @@ -687,12 +722,14 @@ url = "%s/builds/%d" % (name, number) text = 'Build %d' % (urllib.quote(url), number) color = "yellow" + class_ = "start" if b.isFinished() and not b.getSteps(): # the steps have been pruned, so there won't be any indication # of whether it succeeded or failed. Color the box red or green # to show its status color = b.getColor() - return Box([text], color) + class_ = build_get_class(b) + return Box([text], color=color, class_="BuildStep " + class_) components.registerAdapter(BuildBox, builder.BuildStatus, IBox) class StepBox(components.Adapter): @@ -712,14 +749,20 @@ name = logs[num].getName() url = urllib.quote("%s/%d" % (urlbase, num)) text.append("%s" % (url, html.escape(name))) - return Box(text, self.original.getColor()) + color = self.original.getColor() + class_ = "BuildStep " + build_get_class(self.original) + return Box(text, color, class_=class_) components.registerAdapter(StepBox, builder.BuildStepStatus, IBox) class EventBox(components.Adapter): __implements__ = IBox, def getBox(self): text = self.original.getText() - return Box(text, self.original.getColor()) + color = self.original.getColor() + class_ = "Event" + if color: + class_ += " " + color + return Box(text, color, class_=class_) components.registerAdapter(EventBox, builder.Event, IBox) @@ -731,14 +774,16 @@ assert interfaces.IBuilderStatus(self.original) b = self.original.getLastFinishedBuild() if not b: - return Box(["none"], "white") + return Box(["none"], "white", class_="LastBuild") name = b.getBuilder().getName() number = b.getNumber() url = "%s/builds/%d" % (name, number) text = b.getText() # TODO: add logs? # TODO: add link to the per-build page at 'url' - return Box(text, b.getColor()) + c = b.getColor() + class_ = build_get_class(b) + return Box(text, c, class_="LastBuild %s" % class_) components.registerAdapter(BuildTopBox, builder.BuilderStatus, ITopBox) class Spacer(builder.Event): @@ -796,10 +841,15 @@ """This builds the main status page, with the waterfall display, and all child pages.""" title = "BuildBot" - def __init__(self, status, changemaster): + def __init__(self, status, changemaster, categories, css=None): HtmlResource.__init__(self) self.status = status self.changemaster = changemaster + self.categories = categories + p = self.status.getProjectName() + if p: + self.title = "BuildBot: %s" % p + self.css = css def body(self, request): "This method builds the main waterfall display." @@ -807,25 +857,29 @@ phase = int(phase[0]) showBuilders = request.args.get("show", None) + allBuilders = self.status.getBuilderNames(categories=self.categories) if showBuilders: builderNames = [] for b in showBuilders: - if b in self.status.getBuilderNames() and \ - not b in builderNames: - builderNames.append(b) + if b not in allBuilders: + continue + if b in builderNames: + continue + builderNames.append(b) else: - builderNames = self.status.getBuilderNames() + builderNames = allBuilders builders = map(lambda name: self.status.getBuilder(name), builderNames) if phase == -1: return self.body0(request, builders) - (sourceNames, timestamps, eventGrid, sourceEvents) = \ + (changeNames, builderNames, timestamps, eventGrid, sourceEvents) = \ self.buildGrid(request, builders) if phase == 0: return self.phase0(request, sourceNames, timestamps, eventGrid) # start the table: top-header material - data = "\n" + data = "
\n" + #data = "
\n" data += " \n" projectName = self.status.getProjectName() @@ -836,33 +890,39 @@ (projectURL, projectName) else: topleft = "last build" - data += td(topleft, align="right", colspan=2) + data += td(topleft, align="right", colspan=2, class_="Project") for b in builders: box = ITopBox(b).getBox() data += box.td(align="center") data += " \n" data += " \n" - data += td("current activity", align="right", colspan=2) + data += td("current activity", align="right", colspan=2, + class_="Activity") for b in builders: box = ICurrentBox(b).getBox() data += box.td(align="center") data += " \n" data += " \n" - data += td("time", align="center") - for name in sourceNames: + data += td("time", align="center", class_="Time") + name = changeNames[0] + data += td( + "%s" % (urllib.quote(name), name), + align="center", class_="Change") + for name in builderNames: data += td( #"%s" % (request.childLink(name), name), "%s" % (urllib.quote(name), name), - align="center") + align="center", class_="Builder") data += " \n" if phase == 1: f = self.phase1 else: f = self.phase2 - data += f(request, sourceNames, timestamps, eventGrid, sourceEvents) + data += f(request, changeNames + builderNames, timestamps, eventGrid, + sourceEvents) data += "
\n" @@ -894,7 +954,8 @@ data += " for the waterfall display

\n" #data += "\n" - data += "
\n" + #data += "
\n" + data += "
\n" names = map(lambda builder: builder.name, builders) # the top row is two blank spaces, then the top-level status boxes @@ -945,8 +1006,9 @@ lastEventTime = util.now() sources = [commit_source] + builders - sourceNames = ["changes"] + map(lambda builder: builder.getName(), - builders) + changeNames = ["changes"] + builderNames = map(lambda builder: builder.getName(), builders) + sourceNames = changeNames + builderNames sourceEvents = [] sourceGenerators = [] for s in sources: @@ -1046,7 +1108,7 @@ # loop is finished. now we have eventGrid[] and timestamps[] if debugGather: log.msg("finished loop") assert(len(timestamps) == len(eventGrid)) - return (sourceNames, timestamps, eventGrid, sourceEvents) + return (changeNames, builderNames, timestamps, eventGrid, sourceEvents) def phase0(self, request, sourceNames, timestamps, eventGrid): # phase0 rendering @@ -1103,7 +1165,7 @@ time.strftime("%H:%M:%S", time.localtime(timestamps[r]))) data += td(stuff, valign="bottom", align="center", - rowspan=maxRows) + rowspan=maxRows, class_="Time") for c in range(0, len(chunkstrip)): block = chunkstrip[c] assert(block != None) # should be [] instead @@ -1160,8 +1222,9 @@ stuff.append( time.strftime("%H:%M:%S", time.localtime(timestamps[r]))) - grid[0].append(Box(text=stuff, + grid[0].append(Box(text=stuff, class_="Time", valign="bottom", align="center")) + # at this point the timestamp column has been populated with # maxRows boxes, most None but the last one has the time string for c in range(0, len(chunkstrip)): @@ -1264,7 +1327,7 @@ control = None favicon = None - def __init__(self, status, control, changemaster): + def __init__(self, status, control, changemaster, categories, css): """ @type status: L{buildbot.status.builder.Status} @type control: L{buildbot.master.Control} @@ -1274,7 +1337,10 @@ self.status = status self.control = control self.changemaster = changemaster - waterfall = WaterfallStatusResource(self.status, changemaster) + self.categories = categories + self.css = css + waterfall = WaterfallStatusResource(self.status, changemaster, + categories, css) self.putChild("", waterfall) def render(self, request): @@ -1282,18 +1348,22 @@ request.finish() def getChild(self, path, request): - if path in self.status.getBuilderNames(): - builder = self.status.getBuilder(path) - control = None - if self.control: - control = self.control.getBuilder(path) - return StatusResourceBuilder(builder, control) + if path == "buildbot.css" and self.css: + return static.File("buildbot.css") if path == "changes": return StatusResourceChanges(self.changemaster) if path == "favicon.ico": if self.favicon: return static.File(self.favicon) return NoResource("No favicon.ico registered") + + if path in self.status.getBuilderNames(): + builder = self.status.getBuilder(path) + control = None + if self.control: + control = self.control.getBuilder(path) + return StatusResourceBuilder(builder, control) + return NoResource("No such Builder '%s'" % path) # the icon is sibpath(__file__, "../buildbot.png") . This is for portability. @@ -1313,6 +1383,25 @@ distributed web server (which lets the buildbot pages be a subset of some other web server). + Since 0.6.3, BuildBot defines class attributes on elements so they can be + styled with CSS stylesheets. Buildbot uses some generic classes to + identify the type of object, and some more specific classes for the + various kinds of those types. It does this by specifying both in the + class attributes where applicable, separated by a space. It is important + that in your CSS you declare the more generic class styles above the more + specific ones. For example, first define a style for .Event, and below + that for .SUCCESS + + The following CSS class names are used: + - Activity, Event, BuildStep, LastBuild: general classes + - waiting, interlocked, building, offline, idle: Activity states + - start, running, success, failure, warnings, skipped, exception: + LastBuild and BuildStep states + - Change: box with change + - Builder: box for builder name (at top) + - Project + - Time + @type parent: L{buildbot.master.BuildMaster} @ivar parent: like all status plugins, this object is a child of the BuildMaster, so C{.parent} points to a @@ -1321,10 +1410,11 @@ """ __implements__ = (interfaces.IStatusReceiver, service.MultiService.__implements__) - compare_attrs = ["http_port", "distrib_port", "allowForce"] + compare_attrs = ["http_port", "distrib_port", "allowForce", + "categories", "css"] def __init__(self, http_port=None, distrib_port=None, allowForce=True, - favicon=buildbot_icon): + categories=None, css=None, favicon=buildbot_icon): """ xxxTo have the buildbot run its own web server, pass a port number to @@ -1369,6 +1459,8 @@ self.http_port = http_port self.distrib_port = distrib_port self.allowForce = allowForce + self.categories = categories + self.css = css self.favicon = favicon def __repr__(self): @@ -1393,7 +1485,8 @@ else: control = None change_svc = self.parent.change_svc - sr = StatusResource(status, control, change_svc) + sr = StatusResource(status, control, change_svc, self.categories, + self.css) sr.favicon = self.favicon self.site = server.Site(sr) Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- mail.py 19 Apr 2005 07:45:19 -0000 1.14 +++ mail.py 24 Apr 2005 21:30:25 -0000 1.15 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_status -*- # the email.MIMEMultipart module is only available in python-2.2.2 and later @@ -17,7 +17,7 @@ from twisted.python import components, log from buildbot import interfaces, util -from buildbot.status import builder +from buildbot.status.builder import FAILURE, SUCCESS, WARNINGS class Domain(util.ComparableMixin): @@ -56,10 +56,10 @@ service.Service.__implements__) compare_attrs = ["extraRecipients", "lookup", "fromaddr", "mode", - "builders", "addLogs", "relayhost", "subject", - "sendToInterestedUsers"] + "categories", "builders", "addLogs", "relayhost", + "subject", "sendToInterestedUsers"] - def __init__(self, fromaddr, mode="all", builders=None, + def __init__(self, fromaddr, mode="all", categories=None, builders=None, addLogs=False, relayhost="localhost", subject="buildbot %(result)s in %(builder)s", lookup=None, extraRecipients=[], @@ -93,9 +93,16 @@ - 'problem': only send mail about a build which failed when the previous build passed - @type builders: tuple of strings - @param builders: a list of builder names for which mail should be sent. - Defaults to all builds. + @type builders: list of strings + @param builders: a list of builder names for which mail should be + sent. Defaults to None (send mail for all builds). + Use either builders or categories, but not both. + + @type categories: list of strings + @param categories: a list of category names to serve status + information for. Defaults to None (all + categories). Use either builders or categories, + but not both. @type addLogs: boolean. @param addLogs: if True, include all build logs as attachments to the @@ -129,6 +136,7 @@ self.sendToInterestedUsers = sendToInterestedUsers self.fromaddr = fromaddr self.mode = mode + self.categories = categories self.builders = builders self.addLogs = addLogs self.relayhost = relayhost @@ -141,6 +149,11 @@ self.watched = [] self.status = None + # you should either limit on builders or categories, not both + if self.builders != None and self.categories != None: + log.err("Please specify only builders to ignore or categories to include") + raise # FIXME: the asserts above do not raise some Exception either + def setServiceParent(self, parent): """ @type parent: L{buildbot.master.BuildMaster} @@ -159,8 +172,13 @@ return service.Service.disownServiceParent(self) def builderAdded(self, name, builder): + # only subscribe to builders we are interested in + if self.categories != None and builder.category not in self.categories: + return None + self.watched.append(builder) - return self # subscribe to all builders + return self # subscribe to this builder + def builderRemoved(self, name): pass @@ -170,15 +188,20 @@ pass def buildFinished(self, name, build, results): # here is where we actually do something. - if self.builders != None and name in self.builders: + builder = build.getBuilder() + if self.builders is not None and name not in self.builders: return # ignore this build - if self.mode == "failing" and results != builder.FAILURE: + if self.categories is not None and \ + builder.category not in self.categories: + return # ignore this build + + if self.mode == "failing" and results != FAILURE: return if self.mode == "problem": - if results != builder.FAILURE: + if results != FAILURE: return prev = build.getPreviousBuild() - if prev and prev.getResults() == builder.FAILURE: + if prev and prev.getResults() == FAILURE: return # for testing purposes, buildMessage returns a Deferred that fires # when the mail has been sent. To help unit tests, we return that @@ -227,10 +250,10 @@ else: t = "" - if results == builder.SUCCESS: + if results == SUCCESS: text += "Build succeeded!\n" res = "success" - elif results == builder.WARNINGS: + elif results == WARNINGS: text += "Build Had Warnings%s\n" % t res = "warnings" else: Index: progress.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/progress.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- progress.py 23 Sep 2004 20:51:33 -0000 1.10 +++ progress.py 24 Apr 2005 21:30:25 -0000 1.11 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_status -*- from twisted.internet import reactor from twisted.spread import pb Index: words.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/words.py,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- words.py 19 Apr 2005 07:45:19 -0000 1.33 +++ words.py 24 Apr 2005 21:30:25 -0000 1.34 @@ -27,7 +27,7 @@ "What you say !!": ["You have no chance to survive make your time.", "HA HA HA HA ...."], } - def __init__(self, nickname, channels, status): + def __init__(self, nickname, channels, status, categories): """ @type nickname: string @param nickname: the nickname by which this bot should be known @@ -40,6 +40,7 @@ self.nickname = nickname self.channels = channels self.status = status + self.categories = categories self.counter = 0 self.hasQuit = 0 @@ -131,7 +132,7 @@ """ @rtype: list of L{buildbot.process.builder.Builder} """ - names = self.status.getBuilderNames() + names = self.status.getBuilderNames(categories=self.categories) names.sort() builders = [self.status.getBuilder(n) for n in names] return builders @@ -171,7 +172,11 @@ str = "Configured builders: " for b in builders: str += b.name - if not b.remote: + # FIXME: b is a buildbot.status.builder.BuilderStatus + # has no .remote, so maybe it should be added there + #if not b.remote: + state = b.getState()[0] + if state == 'offline': str += "[offline]" str += " " str.rstrip() @@ -222,6 +227,12 @@ WARNINGS: "Warnings", FAILURE: "Failure", } + + # only notify about builders we are interested in + log.msg('builder %r in category %s finished' % (b, b.category)) + if self.categories != None and b.category not in self.categories: + return + r = "Hey! build %s #%d is complete: %s" % \ (b.getBuilder().getName(), b.getNumber(), @@ -431,11 +442,12 @@ shuttingDown = False p = None - def __init__(self, nickname, channels): + def __init__(self, nickname, channels, categories): #ThrottledClientFactory.__init__(self) # doesn't exist self.status = None self.nickname = nickname self.channels = channels + self.categories = categories def __getstate__(self): d = self.__dict__.copy() @@ -448,7 +460,8 @@ self.p.quit("buildmaster reconfigured: bot disconnecting") def buildProtocol(self, address): - p = self.protocol(self.nickname, self.channels, self.status) + p = self.protocol(self.nickname, self.channels, self.status, + self.categories) p.factory = self p.status = self.status p.control = self.control @@ -476,11 +489,13 @@ connect to a single IRC server and am known by a single nickname on that server, however I can join multiple channels.""" - compare_attrs = ["host", "port", "nick", "channels", "allowForce"] + compare_attrs = ["host", "port", "nick", "channels", "allowForce", + "categories"] __implements__ = (interfaces.IStatusReceiver, service.MultiService.__implements__) - def __init__(self, host, nick, channels, port=6667, allowForce=True): + def __init__(self, host, nick, channels, port=6667, allowForce=True, + categories=None): service.MultiService.__init__(self) assert allowForce in (True, False) # TODO: implement others @@ -491,9 +506,10 @@ self.nick = nick self.channels = channels self.allowForce = allowForce + self.categories = categories # need to stash the factory so we can give it the status object - self.f = IrcStatusFactory(self.nick, self.channels) + self.f = IrcStatusFactory(self.nick, self.channels, self.categories) c = internet.TCPClient(host, port, self.f) c.setServiceParent(self) From warner at users.sourceforge.net Sun Apr 24 21:30:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:30:27 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_changes.py,1.1,1.2 test_util.py,1.1,1.2 test_mailparse.py,1.1,1.2 test_config.py,1.14,1.15 test_steps.py,1.11,1.12 test_run.py,1.23,1.24 test_maildir.py,1.3,1.4 test_vc.py,1.24,1.25 test_web.py,1.8,1.9 test_status.py,1.13,1.14 test_interlock.py,1.1,1.2 test_slavecommand.py,1.10,1.11 test_twisted.py,1.3,1.4 test_control.py,1.3,1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29418/buildbot/test Modified Files: test_changes.py test_util.py test_mailparse.py test_config.py test_steps.py test_run.py test_maildir.py test_vc.py test_web.py test_status.py test_interlock.py test_slavecommand.py test_twisted.py test_control.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-83 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--waterfall--0--patch-22 Merged builder-categories and waterfall CSS work from Thomas. Also added test-case-name tags. Patches applied: * org.apestaart at thomas/buildbot--trial--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--trial--0--patch-1 adding test-case-name * org.apestaart at thomas/buildbot--waterfall--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-1 * org.apestaart at thomas/buildbot--waterfall--0--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-3 * org.apestaart at thomas/buildbot--waterfall--0--patch-4 * org.apestaart at thomas/buildbot--waterfall--0--patch-5 * org.apestaart at thomas/buildbot--waterfall--0--patch-6 * org.apestaart at thomas/buildbot--waterfall--0--patch-7 * org.apestaart at thomas/buildbot--waterfall--0--patch-8 * org.apestaart at thomas/buildbot--waterfall--0--patch-9 merge for test-case-name * org.apestaart at thomas/buildbot--waterfall--0--patch-10 unittests + fixes for status.mail category filtering * org.apestaart at thomas/buildbot--waterfall--0--patch-11 fix testsuite by prefixing page title with BuildBot * org.apestaart at thomas/buildbot--waterfall--0--patch-12 move category from Builder to BuilderStatus * org.apestaart at thomas/buildbot--waterfall--0--patch-13 fix silly bug, makes order in waterfall work again * org.apestaart at thomas/buildbot--waterfall--0--patch-14 document category and categories for builders and statusclients * org.apestaart at thomas/buildbot--waterfall--0--patch-15 remove prints from test_run * org.apestaart at thomas/buildbot--waterfall--0--patch-16 remove FIXME and unneeded code for category * org.apestaart at thomas/buildbot--waterfall--0--patch-17 put back "builders" argument * org.apestaart at thomas/buildbot--waterfall--0--patch-18 use class_ to assign a class="" to the html blocks * org.apestaart at thomas/buildbot--waterfall--0--patch-19 cssclass->class_ * org.apestaart at thomas/buildbot--waterfall--0--patch-20 give classes names as agreed * org.apestaart at thomas/buildbot--waterfall--0--patch-21 finish class styling and add EXCEPTION result * org.apestaart at thomas/buildbot--waterfall--0--patch-22 classic buildbot stylesheet Index: test_changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_changes.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_changes.py 29 Apr 2004 22:46:31 -0000 1.1 +++ test_changes.py 24 Apr 2005 21:30:25 -0000 1.2 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_changes -*- from twisted.trial import unittest Index: test_config.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test_config.py 23 Apr 2005 10:22:11 -0000 1.14 +++ test_config.py 24 Apr 2005 21:30:25 -0000 1.15 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_config -*- from __future__ import generators import os, os.path Index: test_control.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_control.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_control.py 30 Sep 2004 07:13:32 -0000 1.3 +++ test_control.py 24 Apr 2005 21:30:25 -0000 1.4 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_control -*- import sys, os, signal, shutil, time Index: test_interlock.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_interlock.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_interlock.py 8 Jan 2004 20:05:24 -0000 1.1 +++ test_interlock.py 24 Apr 2005 21:30:25 -0000 1.2 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_interlock -*- from twisted.trial import unittest from buildbot.process.interlock import Interlock Index: test_maildir.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_maildir.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_maildir.py 8 Nov 2004 09:03:20 -0000 1.3 +++ test_maildir.py 24 Apr 2005 21:30:25 -0000 1.4 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_maildir -*- from twisted.trial import unittest import os, shutil Index: test_mailparse.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_mailparse.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_mailparse.py 8 Jan 2004 20:05:24 -0000 1.1 +++ test_mailparse.py 24 Apr 2005 21:30:25 -0000 1.2 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_mailparse -*- import os.path from twisted.trial import unittest Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- test_run.py 22 Apr 2005 21:29:20 -0000 1.23 +++ test_run.py 24 Apr 2005 21:30:25 -0000 1.24 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_run -*- from twisted.trial import unittest dr = unittest.deferredResult @@ -50,12 +50,60 @@ c['bots'] = [['bot1', 'sekrit']] c['sources'] = [] c['builders'] = [{'name': 'dummy', 'slavename': 'bot1', + 'builddir': 'dummy1', 'factory': f1}, + {'name': 'testdummy', 'slavename': 'bot1', + 'builddir': 'dummy2', 'factory': f1, 'category': 'test'}] +c['slavePortnum'] = 0 +BuildmasterConfig = c +""" + +config_3 = """ +from buildbot.process import factory, step + +def s(klass, **kwargs): + return (klass, kwargs) + +f1 = factory.BuildFactory([ + s(step.Dummy, timeout=1), + s(step.RemoteDummy, timeout=2), + ]) +c = {} +c['bots'] = [['bot1', 'sekrit']] +c['sources'] = [] +c['builders'] = [ + {'name': 'dummy', 'slavename': 'bot1', + 'builddir': 'dummy1', 'factory': f1}, + {'name': 'testdummy', 'slavename': 'bot1', + 'builddir': 'dummy2', 'factory': f1, 'category': 'test'}, + {'name': 'adummy', 'slavename': 'bot1', + 'builddir': 'adummy3', 'factory': f1}, + {'name': 'bdummy', 'slavename': 'bot1', + 'builddir': 'adummy4', 'factory': f1, 'category': 'test'}, +] +c['slavePortnum'] = 0 +BuildmasterConfig = c +""" + +config_4 = """ +from buildbot.process import factory, step + +def s(klass, **kwargs): + return (klass, kwargs) + +f1 = factory.BuildFactory([ + s(step.Dummy, timeout=1), + s(step.RemoteDummy, timeout=2), + ]) +c = {} +c['bots'] = [['bot1', 'sekrit']] +c['sources'] = [] +c['builders'] = [{'name': 'dummy', 'slavename': 'bot1', 'builddir': 'dummy', 'factory': f1}] c['slavePortnum'] = 0 BuildmasterConfig = c """ -config_2_newbasedir = """ +config_4_newbasedir = """ from buildbot.process import factory, step def s(klass, **kwargs): @@ -169,7 +217,7 @@ os.mkdir("basedir") self.master = master.BuildMaster("basedir") - def connectSlave(self): + def connectSlave(self, builders=["dummy"]): port = self.master.slavePort._port.getHost().port os.mkdir("slavebase") slave = MyBuildSlave("localhost", port, "bot1", "sekrit", @@ -177,7 +225,12 @@ slave.info = {"admin": "one"} self.slave = slave slave.startService() - d = self.master.botmaster.waitUntilBuilderAttached("dummy") + 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) dr(d) def connectSlave2(self): @@ -286,13 +339,20 @@ m.readConfig = True m.startService() - self.failUnlessEqual(len(t1.events), 2) + self.failUnlessEqual(len(t1.events), 4) self.failUnlessEqual(t1.events[0][0:2], ("builderAdded", "dummy")) self.failUnlessEqual(t1.events[1], - ("builderChangedState", "dummy", "offline", None)) + ("builderChangedState", "dummy", "offline", + None)) + self.failUnlessEqual(t1.events[2][0:2], ("builderAdded", "testdummy")) + self.failUnlessEqual(t1.events[3], + ("builderChangedState", "testdummy", "offline", + None)) t1.events = [] - self.failUnlessEqual(s.getBuilderNames(), ["dummy"]) + self.failUnlessEqual(s.getBuilderNames(), ["dummy", "testdummy"]) + self.failUnlessEqual(s.getBuilderNames(categories=['test']), + ["testdummy"]) s1 = s.getBuilder("dummy") self.failUnlessEqual(s1.getName(), "dummy") self.failUnlessEqual(s1.getState(), ("offline", None, None)) @@ -302,17 +362,21 @@ #self.failUnlessEqual(s1.getEvent(-1), foo("created")) # status targets should, upon being subscribed, immediately get a - # list of all current builders + # list of all current builders matching their category t2 = STarget([]) s.subscribe(t2) - self.failUnlessEqual(len(t2.events), 1) + self.failUnlessEqual(len(t2.events), 2) self.failUnlessEqual(t2.events[0][0:2], ("builderAdded", "dummy")) + self.failUnlessEqual(t2.events[1][0:2], ("builderAdded", "testdummy")) - self.connectSlave() + self.connectSlave(builders=["dummy", "testdummy"]) - self.failUnlessEqual(len(t1.events), 1) + self.failUnlessEqual(len(t1.events), 2) self.failUnlessEqual(t1.events[0], ("builderChangedState", "dummy", "idle", None)) + self.failUnlessEqual(t1.events[1], + ("builderChangedState", "testdummy", "idle", + None)) t1.events = [] c = interfaces.IControl(m) @@ -335,6 +399,9 @@ self.failUnlessEqual([ev[0] for ev in t3.events], ["builderAdded", "builderChangedState", # offline + "builderAdded", + "builderChangedState", # idle + "builderChangedState", # offline "builderChangedState", # idle "builderChangedState", # building "buildStarted", @@ -395,6 +462,20 @@ self.failUnless(3.0 < t4.eta_build < 5.0) # should be 4 seconds +class BuilderNames(unittest.TestCase): + + def testGetBuilderNames(self): + m = master.BuildMaster("/tmp") + s = m.getStatus() + + m.loadConfig(config_3) + m.readConfig = True + + self.failUnlessEqual(s.getBuilderNames(), + ["dummy", "testdummy", "adummy", "bdummy"]) + self.failUnlessEqual(s.getBuilderNames(categories=['test']), + ["testdummy", "bdummy"]) + class Disconnect(RunMixin, unittest.TestCase): def disconnectSetupMaster(self): @@ -408,7 +489,7 @@ m.readConfig = True m.startService() - self.failUnlessEqual(s.getBuilderNames(), ["dummy"]) + self.failUnlessEqual(s.getBuilderNames(), ["dummy", "testdummy"]) s1 = s.getBuilder("dummy") self.failUnlessEqual(s1.getName(), "dummy") self.failUnlessEqual(s1.getState(), ("offline", None, None)) @@ -598,6 +679,10 @@ reactor.callLater(1.5, self.killSlave) dr(bs.waitUntilFinished(), 5) + # at this point, the slave is in the process of being removed, so it + # could either be 'idle' or 'offline'. I think there is a + # reactor.callLater(0) standing between here and the offline state. + reactor.iterate() # TODO: remove the need for this self.failUnlessEqual(s1.getState()[0], "offline") self.verifyDisconnect2(bs) @@ -663,7 +748,7 @@ class Basedir(RunMixin, unittest.TestCase): def testChangeBuilddir(self): m = self.master - m.loadConfig(config_2) + m.loadConfig(config_4) m.readConfig = True m.startService() @@ -674,7 +759,7 @@ self.failUnlessEqual(builder.builddir, "dummy") self.failUnlessEqual(builder.basedir, "slavebase/dummy") - d = m.loadConfig(config_2_newbasedir) + d = m.loadConfig(config_4_newbasedir) dr(d) # this causes the builder to be replaced Index: test_slavecommand.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- test_slavecommand.py 23 Apr 2005 10:38:31 -0000 1.10 +++ test_slavecommand.py 24 Apr 2005 21:30:25 -0000 1.11 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_slavecommand -*- from twisted.trial import unittest from twisted.internet import reactor, defer Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- test_status.py 11 Nov 2004 20:47:14 -0000 1.13 +++ test_status.py 24 Apr 2005 21:30:25 -0000 1.14 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_status -*- import email, os @@ -49,7 +49,7 @@ __implements__ = interfaces.IEmailLookup, def getAddress(self, user): d = defer.Deferred() - # With me now is Mr Thomas Walters of West Hartlepool who is totall + # With me now is Mr Thomas Walters of West Hartlepool who is totally # invisible. if user == "Thomas_Walters": d.callback(None) @@ -119,6 +119,78 @@ self.failUnlessIn("Build succeeded!\n", t) self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t) + def testBuildStatusCategory(self): + # a status client only interested in a category should only receive + # from that category + mailer = MyMailer(fromaddr="buildbot at example.com", + extraRecipients=["recip at example.com", + "recip2 at example.com"], + lookup="dev.com", + sendToInterestedUsers=False, + categories=["debug"]) + + mailer.parent = self + mailer.status = self + self.messages = [] + + b1 = self.makeBuild(3, builder.SUCCESS) + b1.blamelist = ["bob"] + + mailer.buildFinished("builder1", b1, b1.results) + self.failIf(self.messages) + + def testBuilderCategory(self): + # a builder in a certain category should notify status clients that + # did not list categories, or categories including this one + mailer1 = MyMailer(fromaddr="buildbot at example.com", + extraRecipients=["recip at example.com", + "recip2 at example.com"], + lookup="dev.com", + sendToInterestedUsers=False) + mailer2 = MyMailer(fromaddr="buildbot at example.com", + extraRecipients=["recip at example.com", + "recip2 at example.com"], + lookup="dev.com", + sendToInterestedUsers=False, + categories=["active"]) + mailer3 = MyMailer(fromaddr="buildbot at example.com", + extraRecipients=["recip at example.com", + "recip2 at example.com"], + lookup="dev.com", + sendToInterestedUsers=False, + categories=["active", "debug"]) + + builderd = MyBuilder("builder2", "debug") + + mailer1.parent = self + mailer1.status = self + mailer2.parent = self + mailer2.status = self + mailer3.parent = self + mailer3.status = self + self.messages = [] + + t = mailer1.builderAdded("builder2", builderd) + self.assertEqual(len(mailer1.watched), 1) + self.assertEqual(t, mailer1) + t = mailer2.builderAdded("builder2", builderd) + self.assertEqual(len(mailer2.watched), 0) + self.assertEqual(t, None) + t = mailer3.builderAdded("builder2", builderd) + self.assertEqual(len(mailer3.watched), 1) + self.assertEqual(t, mailer3) + + b2 = MyBuild(builderd, 3, builder.SUCCESS) + b2.blamelist = ["bob"] + + mailer1.buildFinished("builder2", b2, b2.results) + self.failUnlessEqual(len(self.messages), 1) + self.messages = [] + mailer2.buildFinished("builder2", b2, b2.results) + self.failUnlessEqual(len(self.messages), 0) + self.messages = [] + mailer3.buildFinished("builder2", b2, b2.results) + self.failUnlessEqual(len(self.messages), 1) def testFailure(self): mailer = MyMailer(fromaddr="buildbot at example.com", mode="problem", Index: test_steps.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_steps.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- test_steps.py 12 Sep 2004 05:12:27 -0000 1.11 +++ test_steps.py 24 Apr 2005 21:30:25 -0000 1.12 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_steps -*- # create the BuildStep with a fake .remote instance that logs the # .callRemote invocations and compares them against the expected calls. Then Index: test_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_twisted.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_twisted.py 15 Oct 2004 18:44:18 -0000 1.3 +++ test_twisted.py 24 Apr 2005 21:30:25 -0000 1.4 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_twisted -*- from twisted.trial import unittest Index: test_util.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_util.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_util.py 30 Aug 2004 00:13:40 -0000 1.1 +++ test_util.py 24 Apr 2005 21:30:25 -0000 1.2 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_util -*- from twisted.trial import unittest Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- test_vc.py 23 Apr 2005 10:47:53 -0000 1.24 +++ test_vc.py 24 Apr 2005 21:30:25 -0000 1.25 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_vc -*- import sys, os, signal, shutil, time from email.Utils import mktime_tz, parsedate_tz Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- test_web.py 20 Apr 2005 20:13:26 -0000 1.8 +++ test_web.py 24 Apr 2005 21:30:25 -0000 1.9 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_web -*- import sys, os, os.path from twisted.python import log, components, util From warner at users.sourceforge.net Sun Apr 24 21:30:29 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:30:29 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.375,1.376 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29418 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-83 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--waterfall--0--patch-22 Merged builder-categories and waterfall CSS work from Thomas. Also added test-case-name tags. Patches applied: * org.apestaart at thomas/buildbot--trial--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--trial--0--patch-1 adding test-case-name * org.apestaart at thomas/buildbot--waterfall--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-1 * org.apestaart at thomas/buildbot--waterfall--0--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-3 * org.apestaart at thomas/buildbot--waterfall--0--patch-4 * org.apestaart at thomas/buildbot--waterfall--0--patch-5 * org.apestaart at thomas/buildbot--waterfall--0--patch-6 * org.apestaart at thomas/buildbot--waterfall--0--patch-7 * org.apestaart at thomas/buildbot--waterfall--0--patch-8 * org.apestaart at thomas/buildbot--waterfall--0--patch-9 merge for test-case-name * org.apestaart at thomas/buildbot--waterfall--0--patch-10 unittests + fixes for status.mail category filtering * org.apestaart at thomas/buildbot--waterfall--0--patch-11 fix testsuite by prefixing page title with BuildBot * org.apestaart at thomas/buildbot--waterfall--0--patch-12 move category from Builder to BuilderStatus * org.apestaart at thomas/buildbot--waterfall--0--patch-13 fix silly bug, makes order in waterfall work again * org.apestaart at thomas/buildbot--waterfall--0--patch-14 document category and categories for builders and statusclients * org.apestaart at thomas/buildbot--waterfall--0--patch-15 remove prints from test_run * org.apestaart at thomas/buildbot--waterfall--0--patch-16 remove FIXME and unneeded code for category * org.apestaart at thomas/buildbot--waterfall--0--patch-17 put back "builders" argument * org.apestaart at thomas/buildbot--waterfall--0--patch-18 use class_ to assign a class="" to the html blocks * org.apestaart at thomas/buildbot--waterfall--0--patch-19 cssclass->class_ * org.apestaart at thomas/buildbot--waterfall--0--patch-20 give classes names as agreed * org.apestaart at thomas/buildbot--waterfall--0--patch-21 finish class styling and add EXCEPTION result * org.apestaart at thomas/buildbot--waterfall--0--patch-22 classic buildbot stylesheet Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.375 retrieving revision 1.376 diff -u -d -r1.375 -r1.376 --- ChangeLog 23 Apr 2005 20:07:47 -0000 1.375 +++ ChangeLog 24 Apr 2005 21:30:26 -0000 1.376 @@ -1,3 +1,151 @@ +2005-04-24 Thomas Vander Stichele + + * docs/waterfall.classic.css: + add a stylesheet that's almost the same as the "classic" + buildbot style + + * buildbot/status/builder.py: + add EXCEPTION as a result - this is a problem for the bot + maintainer, not a build problem for the changers + * buildbot/process/step.py: + use EXCEPTION instead of FAILURE for exceptions + * buildbot/status/html.py: + add build_get_class to get a class out of a build/buildstep + finish naming the classes + split out sourceNames to changeNames and builderNames so we + can style them separately + * docs/config.xhtml: + finish documenting classes as they are right now + + * buildbot/status/html.py: + name the classes as we agreed on IRC + * docs/config.xhtml: + and document them + + * buildbot/status/html.py: + same for cssclass->class_ + + * buildbot/status/html.py: + as decided on IRC, use class_ for the "class" attribute to not + conflict with the class keyword, and clean up the messy **{} stuff. + + * buildbot/status/mail.py: + put back "builders" argument, and fix docstring, because the + code *ignores* builders listed in this argument + + * buildbot/process/builder.py: + remove FIXME notes - category is now indeed a cvar of BuilderStatus + + * docs/config.xhtml: + describe the category argument for builders + + * buildbot/status/builder.py: + Fix a silly bug due to merging + + * buildbot/process/builder.py: + remove category from the process Builder ... + * buildbot/status/builder.py: + ... and add it to BuilderStatus instead. + Set category on unpickled builder statuses, they might not have it. + * buildbot/master.py: + include category when doing builderAdded + * buildbot/status/mail.py: + return None instead of self for builders we are not interested in. + * buildbot/test/test_run.py: + fix a bug due to only doing deferredResult on "dummy" waiting + * buildbot/test/test_status.py: + add checks for the Mail IStatusReceiver returning None or self + + * buildbot/status/html.py: + fix testsuite by prefixing page title with BuildBot + + * buildbot/status/builder.py: + have .category in builder status ... + * buildbot/process/builder.py: + ... and set it from Builder + * buildbot/status/html.py: + make .css a class variable + * buildbot/test/test_status.py: + write more tests to cover our categories stuff ... + * buildbot/status/mail.py: + ... and fix the bug that this uncovered + + * buildbot/changes/mail.py: + * buildbot/changes/pb.py: + * buildbot/master.py: + * buildbot/process/base.py: + * buildbot/process/factory.py: + * buildbot/process/interlock.py: + * buildbot/process/step.py: + * buildbot/process/step_twisted.py: + * buildbot/slave/commands.py: + * buildbot/status/builder.py: + * buildbot/status/client.py: + * buildbot/status/html.py: + * buildbot/status/mail.py: + * buildbot/status/progress.py: + * buildbot/test/test_changes.py: + * buildbot/test/test_config.py: + * buildbot/test/test_control.py: + * buildbot/test/test_interlock.py: + * buildbot/test/test_maildir.py: + * buildbot/test/test_mailparse.py: + * buildbot/test/test_run.py: + * buildbot/test/test_slavecommand.py: + * buildbot/test/test_status.py: + * buildbot/test/test_steps.py: + * buildbot/test/test_twisted.py: + * buildbot/test/test_util.py: + * buildbot/test/test_vc.py: + * buildbot/test/test_web.py: + * buildbot/util.py: + add test-case-name at the top of a whole set of files + + * buildbot/status/builder.py: + keep order of addition when getting builder names + * buildbot/status/words.py: + * buildbot/test/test_run.py: + add test for getBuilderNames + + * buildbot/process/base.py: + * buildbot/process/step.py: + * buildbot/status/builder.py: + * buildbot/status/html.py: + make buildbot css-able + replace the color code for purple with purple, don't understand + why it wasn't purple to start with + + * buildbot/status/words.py: + ok, so it doesn't look like BuilderStatus.remote is still valid. + Use what waterfall uses instead. + + * buildbot/interfaces.py: + * buildbot/status/builder.py: + * buildbot/status/html.py: + * buildbot/status/mail.py: + * buildbot/status/words.py: + * buildbot/test/test_run.py: + use categories everywhere and make it be a list. More sensible + for the future. Also make words actually respect this in + buildFinished. + + * buildbot/interfaces.py: + add category argument to getBuilderNames + * buildbot/process/builder.py: + * buildbot/status/builder.py: + * buildbot/status/html.py: + * buildbot/status/mail.py: + * buildbot/status/words.py: + * buildbot/test/test_run.py: + move from specifying builders by name to specifying the category + + * buildbot/status/html.py: + * buildbot/status/words.py: + add "builders=" to __init__ of status clients so they can + limit themselves to the given list of builders to report on + + * buildbot/status/html.py: set the title to the product name + 2005-04-23 Thomas Vander Stichele * buildbot/interfaces.py: From warner at users.sourceforge.net Sun Apr 24 21:30:26 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:30:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot interfaces.py,1.23,1.24 util.py,1.7,1.8 master.py,1.62,1.63 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29418/buildbot Modified Files: interfaces.py util.py master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-83 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--waterfall--0--patch-22 Merged builder-categories and waterfall CSS work from Thomas. Also added test-case-name tags. Patches applied: * org.apestaart at thomas/buildbot--trial--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--trial--0--patch-1 adding test-case-name * org.apestaart at thomas/buildbot--waterfall--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-1 * org.apestaart at thomas/buildbot--waterfall--0--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-3 * org.apestaart at thomas/buildbot--waterfall--0--patch-4 * org.apestaart at thomas/buildbot--waterfall--0--patch-5 * org.apestaart at thomas/buildbot--waterfall--0--patch-6 * org.apestaart at thomas/buildbot--waterfall--0--patch-7 * org.apestaart at thomas/buildbot--waterfall--0--patch-8 * org.apestaart at thomas/buildbot--waterfall--0--patch-9 merge for test-case-name * org.apestaart at thomas/buildbot--waterfall--0--patch-10 unittests + fixes for status.mail category filtering * org.apestaart at thomas/buildbot--waterfall--0--patch-11 fix testsuite by prefixing page title with BuildBot * org.apestaart at thomas/buildbot--waterfall--0--patch-12 move category from Builder to BuilderStatus * org.apestaart at thomas/buildbot--waterfall--0--patch-13 fix silly bug, makes order in waterfall work again * org.apestaart at thomas/buildbot--waterfall--0--patch-14 document category and categories for builders and statusclients * org.apestaart at thomas/buildbot--waterfall--0--patch-15 remove prints from test_run * org.apestaart at thomas/buildbot--waterfall--0--patch-16 remove FIXME and unneeded code for category * org.apestaart at thomas/buildbot--waterfall--0--patch-17 put back "builders" argument * org.apestaart at thomas/buildbot--waterfall--0--patch-18 use class_ to assign a class="" to the html blocks * org.apestaart at thomas/buildbot--waterfall--0--patch-19 cssclass->class_ * org.apestaart at thomas/buildbot--waterfall--0--patch-20 give classes names as agreed * org.apestaart at thomas/buildbot--waterfall--0--patch-21 finish class styling and add EXCEPTION result * org.apestaart at thomas/buildbot--waterfall--0--patch-22 classic buildbot stylesheet Index: interfaces.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- interfaces.py 23 Apr 2005 20:07:46 -0000 1.23 +++ interfaces.py 24 Apr 2005 21:30:23 -0000 1.24 @@ -58,7 +58,7 @@ """Return the URL of the top-most Buildbot status page, or None if this Buildbot does not provide a web status page.""" - def getBuilderNames(): + def getBuilderNames(categories=None): """Return a list of the names of all current Builders.""" def getBuilder(name): """Return the IBuilderStatus object for a given named Builder.""" Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- master.py 23 Apr 2005 10:22:10 -0000 1.62 +++ master.py 24 Apr 2005 21:30:23 -0000 1.63 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_run -*- from __future__ import generators import string, sys, os, time, warnings @@ -928,8 +928,11 @@ basedir = data['builddir'] # used on both master and slave #name, slave, builddir, factory = data if not old: # new - log.msg("adding new builder %s" % name) - statusbag = self.status.builderAdded(name, basedir) + # category added after 0.6.2 + category = data.get('category', None) + log.msg("adding new builder %s for category %s" % + (name, category)) + statusbag = self.status.builderAdded(name, basedir, category) builder = Builder(data, statusbag) d = self.botmaster.addBuilder(builder) dl.append(d) Index: util.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/util.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- util.py 29 Sep 2004 04:13:21 -0000 1.7 +++ util.py 24 Apr 2005 21:30:23 -0000 1.8 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_util -*- from twisted.internet.defer import Deferred from twisted.python import log From warner at users.sourceforge.net Sun Apr 24 21:30:26 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:30:26 +0000 Subject: [Buildbot-commits] buildbot/docs waterfall.classic.css,NONE,1.1 config.xhtml,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29418/docs Modified Files: config.xhtml Added Files: waterfall.classic.css Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-83 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--waterfall--0--patch-22 Merged builder-categories and waterfall CSS work from Thomas. Also added test-case-name tags. Patches applied: * org.apestaart at thomas/buildbot--trial--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--trial--0--patch-1 adding test-case-name * org.apestaart at thomas/buildbot--waterfall--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-1 * org.apestaart at thomas/buildbot--waterfall--0--patch-2 * org.apestaart at thomas/buildbot--waterfall--0--patch-3 * org.apestaart at thomas/buildbot--waterfall--0--patch-4 * org.apestaart at thomas/buildbot--waterfall--0--patch-5 * org.apestaart at thomas/buildbot--waterfall--0--patch-6 * org.apestaart at thomas/buildbot--waterfall--0--patch-7 * org.apestaart at thomas/buildbot--waterfall--0--patch-8 * org.apestaart at thomas/buildbot--waterfall--0--patch-9 merge for test-case-name * org.apestaart at thomas/buildbot--waterfall--0--patch-10 unittests + fixes for status.mail category filtering * org.apestaart at thomas/buildbot--waterfall--0--patch-11 fix testsuite by prefixing page title with BuildBot * org.apestaart at thomas/buildbot--waterfall--0--patch-12 move category from Builder to BuilderStatus * org.apestaart at thomas/buildbot--waterfall--0--patch-13 fix silly bug, makes order in waterfall work again * org.apestaart at thomas/buildbot--waterfall--0--patch-14 document category and categories for builders and statusclients * org.apestaart at thomas/buildbot--waterfall--0--patch-15 remove prints from test_run * org.apestaart at thomas/buildbot--waterfall--0--patch-16 remove FIXME and unneeded code for category * org.apestaart at thomas/buildbot--waterfall--0--patch-17 put back "builders" argument * org.apestaart at thomas/buildbot--waterfall--0--patch-18 use class_ to assign a class="" to the html blocks * org.apestaart at thomas/buildbot--waterfall--0--patch-19 cssclass->class_ * org.apestaart at thomas/buildbot--waterfall--0--patch-20 give classes names as agreed * org.apestaart at thomas/buildbot--waterfall--0--patch-21 finish class styling and add EXCEPTION result * org.apestaart at thomas/buildbot--waterfall--0--patch-22 classic buildbot stylesheet Index: config.xhtml =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/config.xhtml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- config.xhtml 19 Apr 2005 08:22:35 -0000 1.7 +++ config.xhtml 24 Apr 2005 21:30:24 -0000 1.8 @@ -81,8 +81,7 @@ from:

    -
  • buildbot.status.html.Waterfall(http_port=int, - distrib_port=int/str, favicon=str): +
  • buildbot.status.html.Waterfall(): This creates an HTML waterfall display, which shows a time-based chart of events. This display provides detailed information about all steps @@ -92,12 +91,11 @@ listen. If instead distrib_port is provided, a twisted.web distributed server will be started either on a TCP port (if distrib_port is an int) or more likely on a UNIX socket (if - distrib_port is a string). favicon can be used to - point at an image that many browsers will use as an icon in any bookmarks - made to pages on the site.
  • + distrib_port is a string). The HTML page can have a favicon + and custom CSS: see the docstring for details.
  • buildbot.status.words.IRC(stuff): @@ -117,6 +115,12 @@
+

More details are available in the docstrings for each class, use pydoc +buildbot.status.html.Waterfall to see them. Most status delivery objects +take a categories= argument, which can contain a list of +category names: in this case, it will only show status for Builders +that are in one of the named categories.

+

(implementor's note: each of these objects should be a service.MultiService which will be attached to the BuildMaster object when the configuration is processed. They should use @@ -197,6 +201,16 @@ of seconds which should elapse between spontaneous timed builds. If you want a buildbot which just continually rebuilds the tree every hour, set this to 60*60. + +

  • category (optional): if provided, a string that + identifies a category for the builder to be a part of. Status clients + can limit themselves to a subset of the available categories. A common + use for this is to add new builders to your setup (for a new module, or + for a new buildslave) that do not work correctly yet and allow you to + integrate them with the active builders. You can put these new builders + in a test category, make your main status clients ignore them, and have + only private status clients pick them up. As soon as they work, you can + move them over to the active category.
  • --- NEW FILE: waterfall.classic.css --- a:visited { color: #800080; } td.Event, td.BuildStep, td.Activity, td.Change, td.Time, td.Builder { border-top: 1px solid; border-right: 1px solid; } /* Activity states */ .idle { background-color: white; } /* LastBuild, BuildStep states */ .success { background-color: #72ff75; } .failure { background-color: red; } .warnings { background-color: orange; } .exception { background-color: #c000c0; } .start,.running { background-color: yellow; } From warner at users.sourceforge.net Sun Apr 24 21:56:43 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 21:56:43 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process step.py,1.62,1.63 base.py,1.48,1.49 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12063/buildbot/process Modified Files: step.py base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-85 Creator: Brian Warner Merged from org.apestaart at thomas/buildbot--slaveEnvironment--0--patch-1 Added Build.slaveEnvironment patch from Thomas, allowing Steps to set environment keys for later Steps in the same build. Patches applied: * org.apestaart at thomas/buildbot--slaveEnvironment--0--patch-1 slaveEnvironment patch * org.apestaart at thomas/buildbot--slaveEnvironment--0--patch-2 make slaveEnvironment an instance attribute :) Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- base.py 24 Apr 2005 21:30:24 -0000 1.48 +++ base.py 24 Apr 2005 21:56:41 -0000 1.49 @@ -69,6 +69,7 @@ self.progress = None self.currentStep = None + self.slaveEnvironment = {} def setBuilder(self, builder): """ Index: step.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- step.py 24 Apr 2005 21:30:24 -0000 1.62 +++ step.py 24 Apr 2005 21:56:41 -0000 1.63 @@ -666,6 +666,18 @@ return ["'%s" % words[0], "%s" % words[1], "...'"] def start(self, errorMessage=None): + # merge in anything from Build.slaveEnvironment . Earlier steps + # (perhaps ones which compile libraries or sub-projects that need to + # be referenced by later steps) can add keys to + # self.build.slaveEnvironment to affect later steps. + slaveEnv = self.build.slaveEnvironment + if slaveEnv: + if self.cmd.args['env'] is None: + self.cmd.args['env'] = {} + self.cmd.args['env'].update(slaveEnv) + # note that each RemoteShellCommand gets its own copy of the + # dictionary, so we shouldn't be affecting anyone but ourselves. + self.step_status.setColor("yellow") self.step_status.setText(self.describe(False)) loog = self.addLog("log") From warner at users.sourceforge.net Sun Apr 24 23:02:24 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 24 Apr 2005 23:02:24 +0000 Subject: [Buildbot-commits] site index.html,1.35,1.36 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13892 Modified Files: index.html Log Message: add Monotone buildbot, now that it's on their front page Index: index.html =================================================================== RCS file: /cvsroot/buildbot/site/index.html,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- index.html 23 Apr 2005 00:39:22 -0000 1.35 +++ index.html 24 Apr 2005 23:02:21 -0000 1.36 @@ -100,6 +100,12 @@ testing to run under a buildbot. +
  • The Monotone version + control system is using a buildbot to + run unit tests. Their buildbot has been extended to handle Monotone's + somewhat-unique VC scheme by Nathaniel Smith, and hopefully the patches + will be merged into the main release soon.
  • +
  • install a Buildbot today and get your name added here!
  • @@ -122,5 +128,5 @@ align="right" /> -Last modified: Fri Apr 22 17:38:58 PDT 2005 +Last modified: Sun Apr 24 16:01:29 PDT 2005 From warner at users.sourceforge.net Mon Apr 25 19:06:26 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 25 Apr 2005 19:06:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave bot.py,1.11,1.12 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14714/buildbot/slave Modified Files: bot.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-89 Creator: Brian Warner make sure the slave's basedir exists at startup 2005-04-25 Brian Warner * buildbot/slave/bot.py (Bot.startService): make sure the basedir really exists at startup, might save some confusion somewhere. Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- bot.py 22 Apr 2005 21:29:18 -0000 1.11 +++ bot.py 25 Apr 2005 19:06:23 -0000 1.12 @@ -244,6 +244,10 @@ self.not_really = not_really self.builders = {} + def startService(self): + assert os.path.isdir(self.basedir) + service.MultiService.startService(self) + def remote_getDirs(self): return filter(lambda d: os.path.isdir(d), os.listdir(self.basedir)) From warner at users.sourceforge.net Mon Apr 25 19:06:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 25 Apr 2005 19:06:27 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.376,1.377 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14714 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-89 Creator: Brian Warner make sure the slave's basedir exists at startup 2005-04-25 Brian Warner * buildbot/slave/bot.py (Bot.startService): make sure the basedir really exists at startup, might save some confusion somewhere. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.376 retrieving revision 1.377 diff -u -d -r1.376 -r1.377 --- ChangeLog 24 Apr 2005 21:30:26 -0000 1.376 +++ ChangeLog 25 Apr 2005 19:06:24 -0000 1.377 @@ -1,3 +1,8 @@ +2005-04-25 Brian Warner + + * buildbot/slave/bot.py (Bot.startService): make sure the basedir + really exists at startup, might save some confusion somewhere. + 2005-04-24 Thomas Vander Stichele * docs/waterfall.classic.css: From warner at users.sourceforge.net Tue Apr 26 01:46:10 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 01:46:10 +0000 Subject: [Buildbot-commits] buildbot/contrib debug.gladep,1.1,NONE Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16981 Removed Files: debug.gladep Log Message: remove leftover Glade project file --- debug.gladep DELETED --- From warner at users.sourceforge.net Tue Apr 26 02:13:50 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 02:13:50 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.377,1.378 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv824 Modified Files: ChangeLog Log Message: (BuildMaster): oops, set .change_svc=None at the module level, because buildbot.tap files from 0.6.2 don't have it in their attribute dictionary. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.377 retrieving revision 1.378 diff -u -d -r1.377 -r1.378 --- ChangeLog 25 Apr 2005 19:06:24 -0000 1.377 +++ ChangeLog 26 Apr 2005 02:13:48 -0000 1.378 @@ -1,5 +1,9 @@ 2005-04-25 Brian Warner + * buildbot/master.py (BuildMaster): oops, set .change_svc=None at + the module level, because buildbot.tap files from 0.6.2 don't have + it in their attribute dictionary. + * buildbot/slave/bot.py (Bot.startService): make sure the basedir really exists at startup, might save some confusion somewhere. From warner at users.sourceforge.net Tue Apr 26 02:13:50 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 02:13:50 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.63,1.64 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv824/buildbot Modified Files: master.py Log Message: (BuildMaster): oops, set .change_svc=None at the module level, because buildbot.tap files from 0.6.2 don't have it in their attribute dictionary. Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- master.py 24 Apr 2005 21:30:23 -0000 1.63 +++ master.py 26 Apr 2005 02:13:47 -0000 1.64 @@ -577,6 +577,7 @@ projectName = "(unspecified)" projectURL = None buildbotURL = None + change_svc = None def __init__(self, basedir, configFileName="master.cfg"): service.MultiService.__init__(self) @@ -610,7 +611,6 @@ self.statusTargets = [] self.bots = [] - self.change_svc = None self.useChanges(ChangeMaster()) self.readConfig = False From warner at users.sourceforge.net Tue Apr 26 02:43:14 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 02:43:14 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status classic.css,NONE,1.1 html.py,1.55,1.56 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16751/buildbot/status Modified Files: html.py Added Files: classic.css Log Message: * buildbot/status/html.py (HtmlResource.content): make the stylesheet always point at "buildbot.css". (StatusResource.getChild): map "buildbot.css" to a static.File containing whatever css= argument was provided to Waterfall() (Waterfall): provide the "classic" css as the default. * docs/waterfall.classic.css: move default CSS from here .. * buildbot/status/classic.css: .. to here * MANIFEST.in: make sure classic.css is included in the tarball * setup.py: and that it is installed too, under buildbot/status/ --- NEW FILE: classic.css --- a:visited { color: #800080; } td.Event, td.BuildStep, td.Activity, td.Change, td.Time, td.Builder { border-top: 1px solid; border-right: 1px solid; } /* Activity states */ .idle { background-color: white; } /* LastBuild, BuildStep states */ .success { background-color: #72ff75; } .failure { background-color: red; } .warnings { background-color: orange; } .exception { background-color: #c000c0; } .start,.running { background-color: yellow; } Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- html.py 24 Apr 2005 21:30:25 -0000 1.55 +++ html.py 26 Apr 2005 02:43:12 -0000 1.56 @@ -150,9 +150,11 @@ def content(self, request): data = "\n" + self.title + "\n" if self.css: + # TODO: use some sort of relative link up to the root page, so + # this css can be used from child pages too data += ("\n" % self.css) + " type=\"text/css\">\n" % "buildbot.css") data += "\n" data += self.body(request) data += "\n" @@ -1349,7 +1351,7 @@ def getChild(self, path, request): if path == "buildbot.css" and self.css: - return static.File("buildbot.css") + return static.File(self.css) if path == "changes": return StatusResourceChanges(self.changemaster) if path == "favicon.ico": @@ -1369,6 +1371,7 @@ # the icon is sibpath(__file__, "../buildbot.png") . This is for portability. up = os.path.dirname buildbot_icon = os.path.abspath(os.path.join(up(up(__file__)), "buildbot.png")) +buildbot_css = os.path.abspath(os.path.join(up(__file__), "classic.css")) class Waterfall(service.MultiService, util.ComparableMixin): """I implement the primary web-page status interface, called a 'Waterfall @@ -1414,7 +1417,7 @@ "categories", "css"] def __init__(self, http_port=None, distrib_port=None, allowForce=True, - categories=None, css=None, favicon=buildbot_icon): + categories=None, css=buildbot_css, favicon=buildbot_icon): """ xxxTo have the buildbot run its own web server, pass a port number to From warner at users.sourceforge.net Tue Apr 26 02:43:14 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 02:43:14 +0000 Subject: [Buildbot-commits] buildbot setup.py,1.31,1.32 MANIFEST.in,1.14,1.15 ChangeLog,1.378,1.379 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16751 Modified Files: setup.py MANIFEST.in ChangeLog Log Message: * buildbot/status/html.py (HtmlResource.content): make the stylesheet always point at "buildbot.css". (StatusResource.getChild): map "buildbot.css" to a static.File containing whatever css= argument was provided to Waterfall() (Waterfall): provide the "classic" css as the default. * docs/waterfall.classic.css: move default CSS from here .. * buildbot/status/classic.css: .. to here * MANIFEST.in: make sure classic.css is included in the tarball * setup.py: and that it is installed too, under buildbot/status/ Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.378 retrieving revision 1.379 diff -u -d -r1.378 -r1.379 --- ChangeLog 26 Apr 2005 02:13:48 -0000 1.378 +++ ChangeLog 26 Apr 2005 02:43:12 -0000 1.379 @@ -1,5 +1,16 @@ 2005-04-25 Brian Warner + * buildbot/status/html.py (HtmlResource.content): make the + stylesheet always point at "buildbot.css". + (StatusResource.getChild): map "buildbot.css" to a static.File + containing whatever css= argument was provided to Waterfall() + (Waterfall): provide the "classic" css as the default. + * docs/waterfall.classic.css: move default CSS from here .. + * buildbot/status/classic.css: .. to here + + * MANIFEST.in: make sure classic.css is included in the tarball + * setup.py: and that it is installed too, under buildbot/status/ + * buildbot/master.py (BuildMaster): oops, set .change_svc=None at the module level, because buildbot.tap files from 0.6.2 don't have it in their attribute dictionary. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- MANIFEST.in 21 Apr 2005 00:46:34 -0000 1.14 +++ MANIFEST.in 26 Apr 2005 02:43:12 -0000 1.15 @@ -9,6 +9,7 @@ include buildbot/plugins.tml include buildbot/test/mail/* buildbot/test/subdir/* include buildbot/scripts/sample.cfg buildbot/scripts/sample.mk +include buildbot/status/classic.css include buildbot/buildbot.png exclude buildbot/test/test_trial.py Index: setup.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/setup.py,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- setup.py 19 Apr 2005 08:37:24 -0000 1.31 +++ setup.py 26 Apr 2005 02:43:12 -0000 1.32 @@ -54,6 +54,7 @@ "buildbot.test"], data_files=[("buildbot", ["buildbot/plugins.tml", "buildbot/buildbot.png"]), + ("buildbot/status", ["buildbot/status/classic.css"]), ("buildbot/scripts", ["buildbot/scripts/sample.cfg", "buildbot/scripts/sample.mk"]),], scripts = scripts, From warner at users.sourceforge.net Tue Apr 26 02:43:14 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 02:43:14 +0000 Subject: [Buildbot-commits] buildbot/docs waterfall.classic.css,1.1,NONE Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16751/docs Removed Files: waterfall.classic.css Log Message: * buildbot/status/html.py (HtmlResource.content): make the stylesheet always point at "buildbot.css". (StatusResource.getChild): map "buildbot.css" to a static.File containing whatever css= argument was provided to Waterfall() (Waterfall): provide the "classic" css as the default. * docs/waterfall.classic.css: move default CSS from here .. * buildbot/status/classic.css: .. to here * MANIFEST.in: make sure classic.css is included in the tarball * setup.py: and that it is installed too, under buildbot/status/ --- waterfall.classic.css DELETED --- From warner at users.sourceforge.net Tue Apr 26 02:54:38 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 02:54:38 +0000 Subject: [Buildbot-commits] buildbot README,1.24,1.25 NEWS,1.38,1.39 ChangeLog,1.379,1.380 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22836 Modified Files: README NEWS ChangeLog Log Message: * README (REQUIREMENTS): list necessary Twisted-2.0 packages * NEWS: update for the imminent 0.6.3 release Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.379 retrieving revision 1.380 diff -u -d -r1.379 -r1.380 --- ChangeLog 26 Apr 2005 02:43:12 -0000 1.379 +++ ChangeLog 26 Apr 2005 02:54:35 -0000 1.380 @@ -1,5 +1,9 @@ 2005-04-25 Brian Warner + * README (REQUIREMENTS): list necessary Twisted-2.0 packages + + * NEWS: update for the imminent 0.6.3 release + * buildbot/status/html.py (HtmlResource.content): make the stylesheet always point at "buildbot.css". (StatusResource.getChild): map "buildbot.css" to a static.File @@ -70,7 +74,7 @@ * buildbot/master.py: include category when doing builderAdded * buildbot/status/mail.py: - return None instead of self for builders we are not interested in. + return None instead of self for builders we are not interested in. * buildbot/test/test_run.py: fix a bug due to only doing deferredResult on "dummy" waiting * buildbot/test/test_status.py: Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- NEWS 22 Apr 2005 03:55:53 -0000 1.38 +++ NEWS 26 Apr 2005 02:54:35 -0000 1.39 @@ -1,17 +1,17 @@ User visible changes in Buildbot. -* Release X.X.X (XX) +* Release 0.6.3 (25 Apr 2005) ** 'buildbot' tool gets more uses -The 'buildbot' executable has acquired two new subcommands. 'buildbot +The 'buildbot' executable has acquired three new subcommands. 'buildbot debugclient' brings up the small remote-control panel that connects to a buildmaster (via the slave port and the c['debugPassword']). This tool, formerly in contrib/debugclient.py, lets you reload the config file, force builds, and simulate inbound commit messages. It requires gtk2, glade, and the python bindings for both to be installed. -'buildbot status_gui' brings up a live status client, formerly available by +'buildbot statusgui' brings up a live status client, formerly available by running buildbot/clients/gtkPanes.py as a program. This connects to the PB status port that you create with: @@ -21,8 +21,10 @@ activity. These boxes are updated in realtime. The effect is primitive, but is intended as an example of what's possible with the PB status interface. -Note: both names are subject to change. The status_gui is currently -completely broken, but I might manage to fix it before the next release. +'buildbot statuslog' provides a text-based running log of buildmaster events. + +Note: command names are subject to change. These should get much more useful +over time. ** web page has a favicon @@ -31,6 +33,26 @@ requested. Many web browsers display this as an icon next to the URL or bookmark. A goofy little default icon is included. +** web page has CSS + +Thanks to Thomas Vander Stichele, the Waterfall page is now themable through +CSS. The default CSS is located in buildbot/status/classic.css, and creates a +page that is mostly identical to the old, non-CSS based table. + +You can specify a different CSS file to use by passing it as the css= +argument to html.Waterfall(). See the docstring for Waterfall for some more +details. + +** builder "categories" + +Thomas has added code which places each Builder in an optional "category". +The various status targets (Waterfall, IRC, MailNotifier) can accept a list +of categories, and they will ignore any activity in builders outside this +list. This makes it easy to create some Builders which are "experimental" or +otherwise not yet ready for the world to see, or indicate that certain +builders should not harass developers when their tests fail, perhaps because +the build slaves for them are not yet fully functional. + ** Deprecated features *** defining Builders with tuples is deprecated @@ -68,6 +90,11 @@ The waterfall page has been improved a bit. A circular-reference bug in the web page's TextLog class was fixed, which caused a major memory leak in a long-running buildmaster with large logfiles that are viewed frequently. +Modifying the config file in a way which only changed a builder's base +directory now works correctly. The 'buildbot' command tries to create +slightly more useful master/slave directories, adding a Makefile entry to +re-create the .tap file, and removing global-read permissions from the files +that may contain buildslave passwords. ** twisted-2.0.0 compatibility @@ -85,7 +112,9 @@ ** win32 compatibility Thankt to Nick Trout, more compatibility fixes have been incorporated, -improving the chances that the unit tests will pass on windows systems. +improving the chances that the unit tests will pass on windows systems. There +are still some problems, and a step-by-step "running buildslaves on windows" +document would be greatly appreciated. ** API docs Index: README =================================================================== RCS file: /cvsroot/buildbot/buildbot/README,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- README 21 Apr 2005 00:57:34 -0000 1.24 +++ README 26 Apr 2005 02:54:35 -0000 1.25 @@ -59,8 +59,14 @@ Both the buildmaster and the buildslaves require Twisted-1.3.0 or later. They have been briefly tested against Twisted-1.2.0, and might even work with Twisted-1.1.0, but 1.3.0 is the version that has received the most - testing. They run against Twisted-2.0.0 as well, albeit with a number of - warnings about the use of deprecated features. + testing. + + They run against Twisted-2.0.0 as well, albeit with a number of warnings + about the use of deprecated features. If you use Twisted-2.0, you'll need + at least "Twisted" (the core package), and you'll also want TwistedMail, + TwistedWeb, TwistedWords, and TwistedLore (for sending email, serving a + web status page, delivering build status via IRC, and generating the HTML + documentation, respectively). CVSToys: http://purl.net/net/CVSToys @@ -79,11 +85,11 @@ PYTHONPATH=. trial -v buildbot.test -This should run about 83 tests. On my desktop machine it takes about 40 -seconds to complete. Nothing should fail, a few might be skipped. If any of -the tests fail, you should stop and investigate the cause before continuing -the installation process, as it will probably be easier to track down the bug -early. +This should run up to 109 tests, depending upon what VC tools you have +installed. On my desktop machine it takes about two minutes to complete. +Nothing should fail, a few might be skipped. If any of the tests fail, you +should stop and investigate the cause before continuing the installation +process, as it will probably be easier to track down the bug early. If you want to test the VC checkout process, you'll need to install a tarball of repositories, available from http://buildbot.sf.net/ . Otherwise From warner at users.sourceforge.net Tue Apr 26 03:10:36 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 03:10:36 +0000 Subject: [Buildbot-commits] buildbot/debian changelog,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/buildbot/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30817/debian Modified Files: changelog Log Message: update for 0.6.3 Index: changelog =================================================================== RCS file: /cvsroot/buildbot/buildbot/debian/changelog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- changelog 13 Dec 2004 08:23:41 -0000 1.4 +++ changelog 26 Apr 2005 03:10:33 -0000 1.5 @@ -1,3 +1,9 @@ +buildbot (0.6.3-1) unstable; urgency=low + + * New upstream release + + -- Brian Warner Mon, 25 Apr 2005 20:09:26 -0700 + buildbot (0.6.2-1) unstable; urgency=low * New upstream release From warner at users.sourceforge.net Tue Apr 26 03:11:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 03:11:17 +0000 Subject: [Buildbot-commits] buildbot/buildbot __init__.py,1.8,1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31051/buildbot Modified Files: __init__.py Log Message: * buildbot/__init__.py (version): Releasing buildbot-0.6.3 Index: __init__.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/__init__.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- __init__.py 1 Feb 2005 08:36:11 -0000 1.8 +++ __init__.py 26 Apr 2005 03:11:15 -0000 1.9 @@ -1,3 +1,3 @@ #! /usr/bin/python -version = "0.6.2+" +version = "0.6.3" From warner at users.sourceforge.net Tue Apr 26 03:11:18 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 03:11:18 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.380,1.381 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31051 Modified Files: ChangeLog Log Message: * buildbot/__init__.py (version): Releasing buildbot-0.6.3 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.380 retrieving revision 1.381 diff -u -d -r1.380 -r1.381 --- ChangeLog 26 Apr 2005 02:54:35 -0000 1.380 +++ ChangeLog 26 Apr 2005 03:11:15 -0000 1.381 @@ -1,5 +1,11 @@ 2005-04-25 Brian Warner + * buildbot/__init__.py (version): Releasing buildbot-0.6.3 + + * debian/changelog: update for 0.6.3 + +2005-04-25 Brian Warner + * README (REQUIREMENTS): list necessary Twisted-2.0 packages * NEWS: update for the imminent 0.6.3 release From warner at users.sourceforge.net Tue Apr 26 03:14:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 03:14:17 +0000 Subject: [Buildbot-commits] buildbot MANIFEST.in,1.15,1.16 ChangeLog,1.381,1.382 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv475 Modified Files: MANIFEST.in ChangeLog Log Message: make sure debug.glade is in the tarball Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.381 retrieving revision 1.382 diff -u -d -r1.381 -r1.382 --- ChangeLog 26 Apr 2005 03:11:15 -0000 1.381 +++ ChangeLog 26 Apr 2005 03:14:15 -0000 1.382 @@ -6,6 +6,8 @@ 2005-04-25 Brian Warner + * MANIFEST.in: make sure debug.glade is in the tarball + * README (REQUIREMENTS): list necessary Twisted-2.0 packages * NEWS: update for the imminent 0.6.3 release Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- MANIFEST.in 26 Apr 2005 02:43:12 -0000 1.15 +++ MANIFEST.in 26 Apr 2005 03:14:15 -0000 1.16 @@ -10,6 +10,7 @@ include buildbot/test/mail/* buildbot/test/subdir/* include buildbot/scripts/sample.cfg buildbot/scripts/sample.mk include buildbot/status/classic.css +include buildbot/clients/debug.glade include buildbot/buildbot.png exclude buildbot/test/test_trial.py From warner at users.sourceforge.net Tue Apr 26 03:44:43 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 03:44:43 +0000 Subject: [Buildbot-commits] site ChangeLog,1.18,1.19 NEWS,1.4,1.5 README,1.12,1.13 index.html,1.36,1.37 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17337 Modified Files: ChangeLog NEWS README index.html Log Message: updated for 0.6.3 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/site/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ChangeLog 13 Dec 2004 08:39:34 -0000 1.18 +++ ChangeLog 26 Apr 2005 03:44:41 -0000 1.19 @@ -1,3 +1,547 @@ +2005-04-25 Brian Warner + + * buildbot/__init__.py (version): Releasing buildbot-0.6.3 + + * debian/changelog: update for 0.6.3 + +2005-04-25 Brian Warner + + * MANIFEST.in: make sure debug.glade is in the tarball + + * README (REQUIREMENTS): list necessary Twisted-2.0 packages + + * NEWS: update for the imminent 0.6.3 release + + * buildbot/status/html.py (HtmlResource.content): make the + stylesheet always point at "buildbot.css". + (StatusResource.getChild): map "buildbot.css" to a static.File + containing whatever css= argument was provided to Waterfall() + (Waterfall): provide the "classic" css as the default. + * docs/waterfall.classic.css: move default CSS from here .. + * buildbot/status/classic.css: .. to here + + * MANIFEST.in: make sure classic.css is included in the tarball + * setup.py: and that it is installed too, under buildbot/status/ + + * buildbot/master.py (BuildMaster): oops, set .change_svc=None at + the module level, because buildbot.tap files from 0.6.2 don't have + it in their attribute dictionary. + + * buildbot/slave/bot.py (Bot.startService): make sure the basedir + really exists at startup, might save some confusion somewhere. + +2005-04-24 Thomas Vander Stichele + + * docs/waterfall.classic.css: + add a stylesheet that's almost the same as the "classic" + buildbot style + + * buildbot/status/builder.py: + add EXCEPTION as a result - this is a problem for the bot + maintainer, not a build problem for the changers + * buildbot/process/step.py: + use EXCEPTION instead of FAILURE for exceptions + * buildbot/status/html.py: + add build_get_class to get a class out of a build/buildstep + finish naming the classes + split out sourceNames to changeNames and builderNames so we + can style them separately + * docs/config.xhtml: + finish documenting classes as they are right now + + * buildbot/status/html.py: + name the classes as we agreed on IRC + * docs/config.xhtml: + and document them + + * buildbot/status/html.py: + same for cssclass->class_ + + * buildbot/status/html.py: + as decided on IRC, use class_ for the "class" attribute to not + conflict with the class keyword, and clean up the messy **{} stuff. + + * buildbot/status/mail.py: + put back "builders" argument, and fix docstring, because the + code *ignores* builders listed in this argument + + * buildbot/process/builder.py: + remove FIXME notes - category is now indeed a cvar of BuilderStatus + + * docs/config.xhtml: + describe the category argument for builders + + * buildbot/status/builder.py: + Fix a silly bug due to merging + + * buildbot/process/builder.py: + remove category from the process Builder ... + * buildbot/status/builder.py: + ... and add it to BuilderStatus instead. + Set category on unpickled builder statuses, they might not have it. + * buildbot/master.py: + include category when doing builderAdded + * buildbot/status/mail.py: + return None instead of self for builders we are not interested in. + * buildbot/test/test_run.py: + fix a bug due to only doing deferredResult on "dummy" waiting + * buildbot/test/test_status.py: + add checks for the Mail IStatusReceiver returning None or self + + * buildbot/status/html.py: + fix testsuite by prefixing page title with BuildBot + + * buildbot/status/builder.py: + have .category in builder status ... + * buildbot/process/builder.py: + ... and set it from Builder + * buildbot/status/html.py: + make .css a class variable + * buildbot/test/test_status.py: + write more tests to cover our categories stuff ... + * buildbot/status/mail.py: + ... and fix the bug that this uncovered + + * buildbot/changes/mail.py: + * buildbot/changes/pb.py: + * buildbot/master.py: + * buildbot/process/base.py: + * buildbot/process/factory.py: + * buildbot/process/interlock.py: + * buildbot/process/step.py: + * buildbot/process/step_twisted.py: + * buildbot/slave/commands.py: + * buildbot/status/builder.py: + * buildbot/status/client.py: + * buildbot/status/html.py: + * buildbot/status/mail.py: + * buildbot/status/progress.py: + * buildbot/test/test_changes.py: + * buildbot/test/test_config.py: + * buildbot/test/test_control.py: + * buildbot/test/test_interlock.py: + * buildbot/test/test_maildir.py: + * buildbot/test/test_mailparse.py: + * buildbot/test/test_run.py: + * buildbot/test/test_slavecommand.py: + * buildbot/test/test_status.py: + * buildbot/test/test_steps.py: + * buildbot/test/test_twisted.py: + * buildbot/test/test_util.py: + * buildbot/test/test_vc.py: + * buildbot/test/test_web.py: + * buildbot/util.py: + add test-case-name at the top of a whole set of files + + * buildbot/status/builder.py: + keep order of addition when getting builder names + * buildbot/status/words.py: + * buildbot/test/test_run.py: + add test for getBuilderNames + + * buildbot/process/base.py: + * buildbot/process/step.py: + * buildbot/status/builder.py: + * buildbot/status/html.py: + make buildbot css-able + replace the color code for purple with purple, don't understand + why it wasn't purple to start with + + * buildbot/status/words.py: + ok, so it doesn't look like BuilderStatus.remote is still valid. + Use what waterfall uses instead. + + * buildbot/interfaces.py: + * buildbot/status/builder.py: + * buildbot/status/html.py: + * buildbot/status/mail.py: + * buildbot/status/words.py: + * buildbot/test/test_run.py: + use categories everywhere and make it be a list. More sensible + for the future. Also make words actually respect this in + buildFinished. + + * buildbot/interfaces.py: + add category argument to getBuilderNames + * buildbot/process/builder.py: + * buildbot/status/builder.py: + * buildbot/status/html.py: + * buildbot/status/mail.py: + * buildbot/status/words.py: + * buildbot/test/test_run.py: + move from specifying builders by name to specifying the category + + * buildbot/status/html.py: + * buildbot/status/words.py: + add "builders=" to __init__ of status clients so they can + limit themselves to the given list of builders to report on + + * buildbot/status/html.py: set the title to the product name + +2005-04-23 Thomas Vander Stichele + + * buildbot/interfaces.py: + * buildbot/status/builder.py: + more documentation. Hm, not sure if ChangeLog entries make sense + here... + +2005-04-23 Brian Warner + + * buildbot/test/test_vc.py (SetupMixin.do_vc): increase timeouts + + * buildbot/test/test_slavecommand.py (Shell): increase timeouts + + * buildbot/scripts/runner.py: make 'statuslog' and 'statusgui' be + the sub-commands that log buildmaster status to stdout and to a + GUI window, respectively. + + * buildbot/clients/gtkPanes.py: overhaul. basic two-row + functionality is working again, but all the step-status and ETA + stuff is missing. Commented out a lot of code pending more + overhaul work. + + * buildbot/status/client.py: make sure that IRemote(None) is None + + * buildbot/changes/changes.py: import defer, oops + (ChangeMaster): remove the .sources list, rely upon the fact that + MultiServices can be treated as sequences of their children. This + cleans up the add/remove ChangeSource routines a lot, as we keep + exactly one list of the current sources instead of three. + + * buildbot/master.py (BuildMaster.__init__): remove .sources, set + up an empty ChangeMaster at init time. + (BuildMaster.loadChanges): if there are changes to be had from + disk, replace self.change_svc with the new ones. If not, keep + using the empty ChangeMaster set up in __init__. + (BuildMaster.loadConfig_Sources): use list(self.change_svc) + instead of a separate list, makes the code a bit cleaner. + * buildbot/test/test_config.py (ConfigTest.testSimple): match it + (ConfigTest.testSources): same, also wait for loadConfig to finish. + Extend the test to make sure we can get rid of the sources when + we're done. + +2005-04-22 Brian Warner + + * buildbot/scripts/runner.py (Maker.mkinfo): create the info/admin + and info/host files when making the slave directory + + * buildbot/test/test_run.py (RunMixin.shutdownSlave): remove the + whendone= argument, just return the Deferred and let the caller do + what they want with it. + (Disconnect.testBuild1): wait for shutdownSlave + (Basedir.testChangeBuilddir): new test to make sure changes to the + builddir actually get propagated to the slave + + * buildbot/slave/bot.py (SlaveBuilder.setBuilddir): use an + explicit method, rather than passing the builddir in __init__ . + Make sure to update self.basedir too, this was broken before. + (Bot.remote_setBuilderList): use b.setBuilddir for both new + builders and for ones that have just had their builddir changed. + (BotFactory): add a class-level .perspective attribute, so + BuildSlave.waitUntilDisconnected won't get upset when the + connection hasn't yet been established + (BuildSlave.__init__): keep track of the bot.Bot instance, so + tests can reach through it to inspect the SlaveBuilders + + * buildbot/process/base.py (Build.buildException): explain the + log.err with a log.msg + * buildbot/process/builder.py (Builder.startBuild): same + (Builder._startBuildFailed): improve error message + + * buildbot/pbutil.py (RBCP.failedToGetPerspective): if the failure + occurred because we lost the brand-new connection, retry instead + of giving up. If not, it's probably an authorization failure, and + it makes sense to stop trying. Make sure we log.msg the reason + that we're log.err'ing the failure, otherwise test failures are + really hard to figure out. + + * buildbot/master.py: change loadConfig() to return a Deferred + that doesn't fire until the change has been fully implemented. + This means any connected slaves have been updated with the new + builddir. This change makes it easier to test the code which + actually implements this builddir-updating. + (BotPerspective.addBuilder): return Deferred + (BotPerspective.removeBuilder): same + (BotPerspective.attached): same + (BotPerspective._attached): same. finish with remote_print before + starting the getSlaveInfo, instead of doing them in parallel + (BotPerspective.list_done): same + (BotMaster.removeSlave): same. Fix the typo that meant we weren't + actually calling slave.disconnect() + (BotMaster.addBuilder): same + (BotMaster.removeBuilder): same + (BuildMaster.loadConfig): same + (BuildMaster.loadConfig_Slaves): same + (BuildMaster.loadConfig_Sources): same + (BuildMaster.loadConfig_Builders): same + (BuildMaster.loadConfig_status): same + + * buildbot/changes/changes.py (ChangeMaster.removeSource): return + a Deferred that fires when the source is finally removed + + * buildbot/slave/commands.py (SourceBase.doClobber): when removing + the previous tree on win32, where we have to do it synchronously, + make sure we return a Deferred anyway. + (SourceBase.doCopy): same + + * buildbot/scripts/runner.py (statusgui): use the text client for + now, while I rewrite the Gtk one + * buildbot/clients/base.py: strip out old code, leaving just the + basic print-message-on-event functionality. I also remove the + ReconnectingPBClientFactory, but it does at least quit when it + loses the connection instead of going silent + +2005-04-21 Brian Warner + + * Makefile: minor tweaks + + * NEWS: point out deprecation warnings, new features for + /usr/bin/buildbot + + * buildbot/master.py (BuildMaster.loadConfig): emit + DeprecationWarnings for Builders defined with tuples. Rearrange + code to facility removal of deprecated configuration keys in the + next release. + + * buildbot/scripts/runner.py (createMaster,createSlave): rewrite + 'buildbot' command to put a little Makefile in the target that + helps you re-create the buildbot.tap file, start or stop the + master/slave, and reconfigure (i.e. SIGHUP) the master. Also chmod + all the files 0600, since they contain passwords. + (start): if there is a Makefile, and /usr/bin/make exists, use + 'make start' in preference to a raw twistd command. This lets + slave admins put things like PYTHONPATH variables in their + Makefiles and have them still work when the slave is started with + 'buildbot start ~/slave/foo'. The test is a bit clunky, it would + be nice to first try the 'make' command and only fall back to + twistd if it fails. TODO: the Makefile's "start" command does not + add the --reactor=win32 argument when running under windows. + (Options.debugclient, Options.statusgui): add sub-commands to launch + the debug client (formerly in contrib/debugclient.py) and the + Gtk status application (currently broken) + * buildbot/clients/debug.py: move from contrib/debugclient.py + * buildbot/clients/debug.glade: same + + * buildbot/test/test_trial.py: remove it. This requires some + functionality out of Twisted that isn't there yet, and until then + having it around just confuses things. + + * buildbot/test/test_slavecommand.py (Shell): test both with and + without PTYs, and make sure that command output is properly + interleaved in the with-PTY case. I think the without-PTY test + should pass on windows, where we never use PTYs anyway. + +2005-04-20 Brian Warner + + * README (REQUIREMENTS): mention Twisted-2.0.0 compatibility + + * MANIFEST.in: add epyrun, gen-reference, buildbot.png + + * NEWS: start creating entries for the next release + + * buildbot/slave/commands.py (ShellCommand.__init__): use os.pathsep + + * buildbot/test/test_web.py (WebTest.test_webPortnum): add timeout + (WebTest.test_webPathname): same + (WebTest.test_webPathname_port): same + (WebTest.test_waterfall): use the default favicon rather than + rooting around the filesystem for it. Open the expected-icon file + in binary mode, to make win32 tests happier (thanks to Nick Trout + for the catch) + * buildbot/status/html.py (buildbot_icon): win32 portability + + * buildbot/test/test_slavecommand.py (SlaveCommandTestCase.testShellZ): + win32-compatibility fixes from Nick Trout, the "file not found" message + is different under windows + (FakeSlaveBuilder.__init__): clean up setup a bit + * buildbot/test/test_vc.py (VCSupport.__init__): win32: use os.pathsep + +2005-04-19 Brian Warner + + * buildbot/test/test_vc.py (SetupMixin.setUpClass): fix the + skip-if-repositories-are-unavailable test to not kill the trial + that comes with Twisted-1.3.0 + + * setup.py: install buildbot.png icon file when installing code + + * buildbot/slave/commands.py (ShellCommand._startCommand): log the + environment used by the command, at least on the child side. + + * buildbot/status/html.py (TextLog.pauseProducing): add a note, + this method needs to be added and implemented because it gets + called under heavy load. I don't quite understand the + producer/consumer API enough to write it. + (StatusResource.getChild): add a resource for /favicon.ico + (Waterfall.__init__): add favicon= argument + * buildbot/test/test_web.py (WebTest.test_waterfall): test it + (WebTest.test_webPortnum): stop using deprecated 'webPortnum' + (WebTest.test_webPathname): same + (WebTest.test_webPathname_port): same + * docs/config.xhtml: mention favicon= + * buildbot/buildbot.png: add a default icon, dorky as it is + +2005-04-18 Thomas Vander Stichele + + * buildbot/master.py: + * buildbot/process/base.py: + * buildbot/process/builder.py: + * buildbot/process/interlock.py: + * buildbot/status/builder.py: + * buildbot/status/html.py: + * buildbot/status/mail.py: + * buildbot/status/words.py: + new documentation while digging through the code + +2005-04-17 Brian Warner + + * general: try to fix file modes on all .py files: a+r, a-x, + but let buildbot/clients/*.py be +x since they're tools + + * docs/epyrun (addMod): when an import fails, say why + + * Makefile: Add a 'docs' target, hack on the PYTHONPATH stuff + +2005-04-17 Thomas Vander Stichele + + * buildbot/process/base.py: + * buildbot/process/builder.py: + * buildbot/status/builder.py: + new documentation while digging through the code + +2005-04-17 Thomas Vander Stichele + + * buildbot/changes/changes.py: + * buildbot/changes/p4poller.py: + * buildbot/interfaces.py: + * buildbot/process/base.py: + * buildbot/process/builder.py: + * buildbot/process/step.py: + * buildbot/process/step_twisted.py: + * buildbot/slave/bot.py: + * buildbot/slave/commands.py: + * buildbot/status/builder.py: + fix all docstrings to make epydoc happy. In the process of fixing + some, I also moved pieces of docs, and removed some deprecated + documentation + +2005-04-17 Thomas Vander Stichele + + * buildbot/process/builder.py: + * buildbot/process/interlock.py: + * buildbot/process/process_twisted.py: + * buildbot/process/step.py: + BuildProcess -> Build, as it looks like that's what happened + * buildbot/process/base.py: + * buildbot/process/factory.py: + update epydoc stuff + +2005-04-17 Brian Warner + + * buildbot/process/process_twisted.py (QuickTwistedBuildFactory): + update compile command to accomodate the Twisted split.. now + instead of './setup.py build_ext -i', you do './setup.py all + build_ext -i', to run build_ext over all sub-projects. + (FullTwistedBuildFactory): same + (TwistedReactorsBuildFactory): same + + * buildbot/status/html.py (TextLog.finished): null out self.req + when we're done, otherwise the reference cycle of TextLog to .req + to .notifications to a Deferred to TextLog.stop keeps them from + being collected, and consumes a huge (610MB on pyramid at last + check) amount of memory. + +2005-04-11 Brian Warner + + * buildbot/test/test_vc.py (VCSupport.__init__): use abspath() to + normalize the VC-repository location.. makes SVN happier with + certain test environments. + + * buildbot/process/step.py (RemoteShellCommand.__init__): let each + RemoteShellCommand gets its own .env dictionary, so that code in + start() doesn't mutate the original. I think this should fix the + step_twisted.Trial problem where multiple identical components + kept getting added to PYTHONPATH= over and over again. + + * general: merge org.apestaart at thomas/buildbot--doc--0--patch-3, + adding epydoc-format docstrings to many classes. Thanks to Thomas + Vander Stichele for the patches. + * docs/epyrun, docs/gen-reference: add epydoc-generating tools + * buildbot/status/mail.py, buildbot/process/step_twisted.py: same + * buildbot/slave/bot.py, commands.py, registry.py: same + +2005-04-05 Brian Warner + + * buildbot/slave/commands.py (SourceBase.doCopy): use cp -p to + preserve timestamps, helps incremental builds of large trees. + Patch from Rene Rivera. + + * buildbot/slave/bot.py (SlaveBuilder.commandComplete): oops, log + 'failure' and not the non-existent 'why'. Thanks to Rene Rivera + for the catch. + +2005-04-03 Brian Warner + + * buildbot/master.py (BuildMaster.loadConfig): only call exec() + with one dict, apparently exec has some scoping bugs when used + with both global/local dicts. Thanks to Nathaniel Smith for the + catch. + +2005-04-02 Brian Warner + + * buildbot/process/step_twisted.py (countFailedTests): the new + trial in Twisted-2.0 emits a slightly different status line than + old trial ("PASSED.." instead of "OK.."). Handle it so we don't + mistakenly think the test count is unparseable. + (Trial.start): note that for some reason each build causes another + copy of self.testpath to be prepended to PYTHONPATH. This needs to + be fixed but I'm not sure quite where the problem is. + +2005-04-01 Brian Warner + + * buildbot/test/test_run.py (Run.testMaster): change some uses of + deferredResult to avoid hangs/warnings under twisted-2.0 + (RunMixin.tearDown): same + (RunMixin.shutdownSlave): same + (Disconnect.testIdle1): same + (Disconnect.testBuild2): same: wait one second after the build + finishes for test to really be done.. this should be cleaned up to + avoid wasting that second. Builder.detach uses a callLater(0), + either that should be done in-line (something else needed that + behavior), or it should return a Deferred that fires when the + builder is really offline. + (Disconnect.testBuild3): same + (Disconnect.testDisappear): same + + * buildbot/test/test_web.py: rearrange server-setup and teardown + code to remove unclean-reactor warnings from twisted-2.0 + + * buildbot/test/test_vc.py: rearrange probe-for-VC-program routine + so the tests don't hang under twisted-2.0 + +2005-03-31 Brian Warner + + * buildbot/slave/bot.py (Bot.remote_setBuilderList): fix typo that + caused a warning each time the master changed our set of builders + + * buildbot/status/builder.py (BuildStatus.saveYourself): under + w32, don't unlink the file unless it already exists. Thanks to + Baptiste Lepilleur for the catch. + (BuilderStatus.saveYourself): same + +2005-02-01 Brian Warner + + * buildbot/status/html.py (TextLog.getChild): use a /text child + URL, such as http://foo.com/svn-hello/builds/1/test/0/text instead + of http://foo.com/svn-hello/builds/1/test/0 , to retrieve the + logfile as text/plain (no markup, no headers). This replaces the + previous scheme (which used an ?text=1 argument), and gets us back + to a relative link (which works better when the buildbot lives + behind another web server, such as Apache configured as a reverse + proxy). Thanks to Gerald Combs for spotting the problem. + + * buildbot/__init__.py (version): bump to 0.6.2+ while between + releases + 2004-12-13 Brian Warner * buildbot/__init__.py (version): Releasing buildbot-0.6.2 Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/site/NEWS,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- NEWS 13 Dec 2004 08:39:35 -0000 1.4 +++ NEWS 26 Apr 2005 03:44:41 -0000 1.5 @@ -1,5 +1,130 @@ User visible changes in Buildbot. +* Release 0.6.3 (25 Apr 2005) + +** 'buildbot' tool gets more uses + +The 'buildbot' executable has acquired three new subcommands. 'buildbot +debugclient' brings up the small remote-control panel that connects to a +buildmaster (via the slave port and the c['debugPassword']). This tool, +formerly in contrib/debugclient.py, lets you reload the config file, force +builds, and simulate inbound commit messages. It requires gtk2, glade, and +the python bindings for both to be installed. + +'buildbot statusgui' brings up a live status client, formerly available by +running buildbot/clients/gtkPanes.py as a program. This connects to the PB +status port that you create with: + + c['status'].append(client.PBListener(portnum)) + +and shows two boxes per Builder, one for the last build, one for current +activity. These boxes are updated in realtime. The effect is primitive, but +is intended as an example of what's possible with the PB status interface. + +'buildbot statuslog' provides a text-based running log of buildmaster events. + +Note: command names are subject to change. These should get much more useful +over time. + +** web page has a favicon + +When constructing the html.Waterfall instance, you can provide the filename +of an image that will be provided when the "favicon.ico" resource is +requested. Many web browsers display this as an icon next to the URL or +bookmark. A goofy little default icon is included. + +** web page has CSS + +Thanks to Thomas Vander Stichele, the Waterfall page is now themable through +CSS. The default CSS is located in buildbot/status/classic.css, and creates a +page that is mostly identical to the old, non-CSS based table. + +You can specify a different CSS file to use by passing it as the css= +argument to html.Waterfall(). See the docstring for Waterfall for some more +details. + +** builder "categories" + +Thomas has added code which places each Builder in an optional "category". +The various status targets (Waterfall, IRC, MailNotifier) can accept a list +of categories, and they will ignore any activity in builders outside this +list. This makes it easy to create some Builders which are "experimental" or +otherwise not yet ready for the world to see, or indicate that certain +builders should not harass developers when their tests fail, perhaps because +the build slaves for them are not yet fully functional. + +** Deprecated features + +*** defining Builders with tuples is deprecated + +For a long time, the preferred way to define builders in the config file has +been with a dictionary. The less-flexible old style of a 4-item tuple (name, +slavename, builddir, factory) is now officially deprecated (i.e., it will +emit a warning if you use it), and will be removed in the next release. +Dictionaries are more flexible: additional keys like periodicBuildTime are +simply unavailable to tuple-defined builders. + +Note: it is a good idea to watch the logfile (usually in twistd.log) when you +first start the buildmaster, or whenever you reload the config file. Any +warnings or errors in the config file will be found there. + +*** c['webPortnum'], c['webPathname'], c['irc'] are deprecated + +All status reporters should be defined in the c['status'] array, using +buildbot.status.html.Waterfall or buildbot.status.words.IRC . These have been +deprecated for a while, but this is fair warning that these keys will be +removed in the next release. + +*** c['manholePort'] is deprecated + +Again, this has been deprecated for a while, in favor of: + + c['manhole'] = master.Manhole(port, username, password) + +The preferred syntax will eventually let us use other, better kinds of debug +shells, such as the experimental curses-based ones in the Twisted sandbox +(which would offer command-line editing and history). + +** bug fixes + +The waterfall page has been improved a bit. A circular-reference bug in the +web page's TextLog class was fixed, which caused a major memory leak in a +long-running buildmaster with large logfiles that are viewed frequently. +Modifying the config file in a way which only changed a builder's base +directory now works correctly. The 'buildbot' command tries to create +slightly more useful master/slave directories, adding a Makefile entry to +re-create the .tap file, and removing global-read permissions from the files +that may contain buildslave passwords. + +** twisted-2.0.0 compatibility + +Both buildmaster and buildslave should run properly under Twisted-2.0 . There +are still some warnings about deprecated functions, some of which could be +fixed, but there are others that would require removing compatibility with +Twisted-1.3, and I don't expect to do that until 2.0 has been out and stable +for at least several months. The unit tests should pass under 2.0, whereas +the previous buildbot release had tests which could hang when run against the +new "trial" framework in 2.0. + +The Twisted-specific steps (including Trial) have been updated to match 2.0 +functionality. + +** win32 compatibility + +Thankt to Nick Trout, more compatibility fixes have been incorporated, +improving the chances that the unit tests will pass on windows systems. There +are still some problems, and a step-by-step "running buildslaves on windows" +document would be greatly appreciated. + +** API docs + +Thanks to Thomas Vander Stichele, most of the docstrings have been converted +to epydoc format. There is a utility in docs/gen-reference to turn these into +a tree of cross-referenced HTML pages. Eventually these docs will be +auto-generated and somehow published on the buildbot web page. + + + * Release 0.6.2 (13 Dec 2004) ** new features Index: README =================================================================== RCS file: /cvsroot/buildbot/site/README,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- README 23 Nov 2004 11:41:01 -0000 1.12 +++ README 26 Apr 2005 03:44:41 -0000 1.13 @@ -61,6 +61,13 @@ with Twisted-1.1.0, but 1.3.0 is the version that has received the most testing. + They run against Twisted-2.0.0 as well, albeit with a number of warnings + about the use of deprecated features. If you use Twisted-2.0, you'll need + at least "Twisted" (the core package), and you'll also want TwistedMail, + TwistedWeb, TwistedWords, and TwistedLore (for sending email, serving a + web status page, delivering build status via IRC, and generating the HTML + documentation, respectively). + CVSToys: http://purl.net/net/CVSToys If your buildmaster uses FreshCVSSource to receive change notification @@ -78,11 +85,11 @@ PYTHONPATH=. trial -v buildbot.test -This should run about 83 tests. On my desktop machine it takes about 40 -seconds to complete. Nothing should fail, a few might be skipped. If any of -the tests fail, you should stop and investigate the cause before continuing -the installation process, as it will probably be easier to track down the bug -early. +This should run up to 109 tests, depending upon what VC tools you have +installed. On my desktop machine it takes about two minutes to complete. +Nothing should fail, a few might be skipped. If any of the tests fail, you +should stop and investigate the cause before continuing the installation +process, as it will probably be easier to track down the bug early. If you want to test the VC checkout process, you'll need to install a tarball of repositories, available from http://buildbot.sf.net/ . Otherwise Index: index.html =================================================================== RCS file: /cvsroot/buildbot/site/index.html,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- index.html 24 Apr 2005 23:02:21 -0000 1.36 +++ index.html 26 Apr 2005 03:44:41 -0000 1.37 @@ -11,7 +11,7 @@ Current contents:
      -
    • The current release is buildbot-0.6.2 . You can download the source +
    • The current release is buildbot-0.6.3 . You can download the source from the sf.net download page here. The release is signed with my GPG public key, available -Last modified: Sun Apr 24 16:01:29 PDT 2005 +Last modified: Mon Apr 25 20:43:54 PDT 2005 From warner at users.sourceforge.net Tue Apr 26 06:32:11 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 06:32:11 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4477/buildbot/test Modified Files: test_web.py Log Message: * buildbot/status/html.py (StatusResourceChanges.body): oops, don't reference no-longer-existent changemaster.sources * buildbot/test/test_web.py (WebTest.test_waterfall): test for it * buildbot/__init__.py (version): bump to 0.6.3+ while between releases Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- test_web.py 24 Apr 2005 21:30:25 -0000 1.9 +++ test_web.py 26 Apr 2005 06:32:08 -0000 1.10 @@ -161,15 +161,17 @@ # this is the right way to configure the Waterfall status config1 = """ from buildbot.status import html +from buildbot.changes import mail BuildmasterConfig = { 'bots': [], - 'sources': [], + 'sources': [mail.SyncmailMaildirSource('my-maildir')], 'builders': [], 'slavePortnum': 0, 'status': [html.Waterfall(http_port=0)], } """ os.mkdir("test_web4") + os.mkdir("my-maildir"); os.mkdir("my-maildir/new") m = ConfiguredMaster("test_web4", config1) m.startService() # hack to find out what randomly-assigned port it is listening on @@ -186,4 +188,9 @@ expected = open(html.buildbot_icon,"rb").read() self.failUnless(icon == expected) + d = client.getPage("http://localhost:%d/changes" % port) + changes = dr(d) + self.failUnless("
    • Syncmail mailing list in maildir my-maildir
    • " + in changes) + dr(m.stopService()) From warner at users.sourceforge.net Tue Apr 26 06:32:14 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 06:32:14 +0000 Subject: [Buildbot-commits] buildbot/buildbot __init__.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4477/buildbot Modified Files: __init__.py Log Message: * buildbot/status/html.py (StatusResourceChanges.body): oops, don't reference no-longer-existent changemaster.sources * buildbot/test/test_web.py (WebTest.test_waterfall): test for it * buildbot/__init__.py (version): bump to 0.6.3+ while between releases Index: __init__.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/__init__.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- __init__.py 26 Apr 2005 03:11:15 -0000 1.9 +++ __init__.py 26 Apr 2005 06:32:10 -0000 1.10 @@ -1,3 +1,3 @@ #! /usr/bin/python -version = "0.6.3" +version = "0.6.3+" From warner at users.sourceforge.net Tue Apr 26 06:32:15 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 06:32:15 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.382,1.383 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4477 Modified Files: ChangeLog Log Message: * buildbot/status/html.py (StatusResourceChanges.body): oops, don't reference no-longer-existent changemaster.sources * buildbot/test/test_web.py (WebTest.test_waterfall): test for it * buildbot/__init__.py (version): bump to 0.6.3+ while between releases Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.382 retrieving revision 1.383 diff -u -d -r1.382 -r1.383 --- ChangeLog 26 Apr 2005 03:14:15 -0000 1.382 +++ ChangeLog 26 Apr 2005 06:32:12 -0000 1.383 @@ -1,5 +1,14 @@ 2005-04-25 Brian Warner + * buildbot/status/html.py (StatusResourceChanges.body): oops, don't + reference no-longer-existent changemaster.sources + * buildbot/test/test_web.py (WebTest.test_waterfall): test for it + + * buildbot/__init__.py (version): bump to 0.6.3+ while between + releases + +2005-04-25 Brian Warner + * buildbot/__init__.py (version): Releasing buildbot-0.6.3 * debian/changelog: update for 0.6.3 From warner at users.sourceforge.net Tue Apr 26 06:32:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 06:32:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.56,1.57 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4477/buildbot/status Modified Files: html.py Log Message: * buildbot/status/html.py (StatusResourceChanges.body): oops, don't reference no-longer-existent changemaster.sources * buildbot/test/test_web.py (WebTest.test_waterfall): test for it * buildbot/__init__.py (version): bump to 0.6.3+ while between releases Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- html.py 26 Apr 2005 02:43:12 -0000 1.56 +++ html.py 26 Apr 2005 06:32:09 -0000 1.57 @@ -493,7 +493,7 @@ def body(self, request): data = "" data += "Change sources:\n" - sources = self.changemaster.sources + sources = list(self.changemaster) if sources: data += "
        \n" for s in sources: From warner at users.sourceforge.net Tue Apr 26 06:35:38 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 06:35:38 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status words.py,1.34,1.35 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6402/buildbot/status Modified Files: words.py Log Message: (IrcStatusBot.buildFinished): fix a category-related exception when announcing a build has finished Index: words.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/words.py,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- words.py 24 Apr 2005 21:30:25 -0000 1.34 +++ words.py 26 Apr 2005 06:35:36 -0000 1.35 @@ -229,8 +229,11 @@ } # only notify about builders we are interested in - log.msg('builder %r in category %s finished' % (b, b.category)) - if self.categories != None and b.category not in self.categories: + builder = b.getBuilder() + log.msg('builder %r in category %s finished' % (builder, + builder.category)) + if (self.categories != None and + builder.category not in self.categories): return r = "Hey! build %s #%d is complete: %s" % \ From warner at users.sourceforge.net Tue Apr 26 06:35:39 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 06:35:39 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.383,1.384 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6402 Modified Files: ChangeLog Log Message: (IrcStatusBot.buildFinished): fix a category-related exception when announcing a build has finished Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.383 retrieving revision 1.384 diff -u -d -r1.383 -r1.384 --- ChangeLog 26 Apr 2005 06:32:12 -0000 1.383 +++ ChangeLog 26 Apr 2005 06:35:37 -0000 1.384 @@ -1,5 +1,8 @@ 2005-04-25 Brian Warner + * buildbot/status/words.py (IrcStatusBot.buildFinished): fix a + category-related exception when announcing a build has finished + * buildbot/status/html.py (StatusResourceChanges.body): oops, don't reference no-longer-existent changemaster.sources * buildbot/test/test_web.py (WebTest.test_waterfall): test for it From warner at users.sourceforge.net Tue Apr 26 07:16:39 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 07:16:39 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process builder.py,1.24,1.25 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27789/buildbot/process Modified Files: builder.py Log Message: * buildbot/process/builder.py (Builder.attached): always return a Deferred, even if the builder was already attached * buildbot/test/test_run.py (Basedir.testChangeBuilddir): test it Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/builder.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- builder.py 22 Apr 2005 21:29:19 -0000 1.24 +++ builder.py 26 Apr 2005 07:16:36 -0000 1.25 @@ -150,11 +150,16 @@ def attached(self, remote, commands): """This is invoked by the BotPerspective when the self.slavename bot - registers their builder.""" + registers their builder. + + @rtype : L{twisted.internet.defer.Deferred} + @return: a Deferred that fires (with 'self') when the slave-side + builder is fully attached and ready to accept commands. + """ if self.remote == remote: # already attached to them log.msg("Builder %s already attached" % self.name) - return + return defer.succeed(self) if self.remote: log.msg("WEIRD", self.remote, remote) self.remote = remote From warner at users.sourceforge.net Tue Apr 26 07:16:38 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 07:16:38 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_run.py,1.24,1.25 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27789/buildbot/test Modified Files: test_run.py Log Message: * buildbot/process/builder.py (Builder.attached): always return a Deferred, even if the builder was already attached * buildbot/test/test_run.py (Basedir.testChangeBuilddir): test it Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- test_run.py 24 Apr 2005 21:30:25 -0000 1.24 +++ test_run.py 26 Apr 2005 07:16:35 -0000 1.25 @@ -122,6 +122,27 @@ BuildmasterConfig = c """ +config_4_newbuilder = """ +from buildbot.process import factory, step + +def s(klass, **kwargs): + return (klass, kwargs) + +f1 = factory.BuildFactory([ + s(step.Dummy, timeout=1), + s(step.RemoteDummy, timeout=2), + ]) +c = {} +c['bots'] = [['bot1', 'sekrit']] +c['sources'] = [] +c['builders'] = [{'name': 'dummy', 'slavename': 'bot1', + 'builddir': 'dummy2', 'factory': f1}, + {'name': 'dummy2', 'slavename': 'bot1', + 'builddir': 'dummy23', 'factory': f1},] +c['slavePortnum'] = 0 +BuildmasterConfig = c +""" + class MyBot(bot.Bot): def remote_getSlaveInfo(self): return self.parent.info @@ -770,6 +791,8 @@ self.failUnlessEqual(builder.builddir, "dummy2") self.failUnlessEqual(builder.basedir, "slavebase/dummy2") - # done - + # add a new builder, which causes the basedir list to be reloaded + d = m.loadConfig(config_4_newbuilder) + dr(d) + From warner at users.sourceforge.net Tue Apr 26 07:16:40 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 07:16:40 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.384,1.385 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27789 Modified Files: ChangeLog Log Message: * buildbot/process/builder.py (Builder.attached): always return a Deferred, even if the builder was already attached * buildbot/test/test_run.py (Basedir.testChangeBuilddir): test it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.384 retrieving revision 1.385 diff -u -d -r1.384 -r1.385 --- ChangeLog 26 Apr 2005 06:35:37 -0000 1.384 +++ ChangeLog 26 Apr 2005 07:16:37 -0000 1.385 @@ -1,3 +1,9 @@ +2005-04-26 Brian Warner + + * buildbot/process/builder.py (Builder.attached): always return a + Deferred, even if the builder was already attached + * buildbot/test/test_run.py (Basedir.testChangeBuilddir): test it + 2005-04-25 Brian Warner * buildbot/status/words.py (IrcStatusBot.buildFinished): fix a From warner at users.sourceforge.net Tue Apr 26 07:35:10 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 07:35:10 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.385,1.386 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4421 Modified Files: ChangeLog Log Message: (Status.builderAdded): when loading a pickled BuilderStatus in from disk, set its name after loading. The config file might have changed its name (but not its directory) while it wasn't looking. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.385 retrieving revision 1.386 diff -u -d -r1.385 -r1.386 --- ChangeLog 26 Apr 2005 07:16:37 -0000 1.385 +++ ChangeLog 26 Apr 2005 07:35:07 -0000 1.386 @@ -1,5 +1,10 @@ 2005-04-26 Brian Warner + * buildbot/status/builder.py (Status.builderAdded): when loading a + pickled BuilderStatus in from disk, set its name after loading. + The config file might have changed its name (but not its + directory) while it wasn't looking. + * buildbot/process/builder.py (Builder.attached): always return a Deferred, even if the builder was already attached * buildbot/test/test_run.py (Basedir.testChangeBuilddir): test it From warner at users.sourceforge.net Tue Apr 26 07:35:09 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 07:35:09 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py,1.51,1.52 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4421/buildbot/status Modified Files: builder.py Log Message: (Status.builderAdded): when loading a pickled BuilderStatus in from disk, set its name after loading. The config file might have changed its name (but not its directory) while it wasn't looking. Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- builder.py 24 Apr 2005 21:30:25 -0000 1.51 +++ builder.py 26 Apr 2005 07:35:07 -0000 1.52 @@ -1472,6 +1472,7 @@ # so set it here to make sure builder_status.category = category builder_status.basedir = os.path.join(self.basedir, basedir) + builder_status.name = name # it might have been updated builder_status.status = self if not os.path.isdir(builder_status.basedir): From warner at users.sourceforge.net Tue Apr 26 09:08:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:08:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status client.py,1.16,1.17 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22070/buildbot/status Modified Files: client.py Log Message: * buildbot/status/client.py (makeRemote): new approach to making IRemote(None) be None, which works under Twisted-2.0 * buildbot/test/test_status.py (Client.testAdaptation): test it Index: client.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/client.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- client.py 24 Apr 2005 21:30:25 -0000 1.16 +++ client.py 26 Apr 2005 09:08:30 -0000 1.17 @@ -15,9 +15,12 @@ class IRemote(components.Interface): pass -# make sure that IRemote(None) is None -components.registerAdapter(lambda n: None, - type(None), IRemote) +def makeRemote(obj): + # we want IRemote(None) to be None, but you can't really do that with + # adapters, so we fake it + if obj is None: + return None + return IRemote(obj) class RemoteBuilder(pb.Referenceable): def __init__(self, builder): @@ -28,22 +31,19 @@ def remote_getState(self): state, ETA, build = self.b.getState() - return (state, ETA, IRemote(build)) + return (state, ETA, makeRemote(build)) def remote_getSlave(self): return IRemote(self.b.getSlave()) - def remote_getCurrentBuild(self): - return IRemote(self.b.getCurrentBuild()) - def remote_getLastFinishedBuild(self): - return IRemote(self.b.getLastFinishedBuild()) + return makeRemote(self.b.getLastFinishedBuild()) def remote_getCurrentBuild(self): - return IRemote(self.b.getCurrentBuild()) + return makeRemote(self.b.getCurrentBuild()) def remote_getBuild(self, number): - return IRemote(self.b.getBuild(number)) + return makeRemote(self.b.getBuild(number)) def remote_getEvent(self, number): return IRemote(self.b.getEvent(number)) @@ -88,7 +88,7 @@ return self.b.getETA() def remote_getCurrentStep(self): - return IRemote(self.b.getCurrentStep()) + return makeRemote(self.b.getCurrentStep()) def remote_getText(self): return self.b.getText() From warner at users.sourceforge.net Tue Apr 26 09:08:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:08:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_status.py,1.14,1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22070/buildbot/test Modified Files: test_status.py Log Message: * buildbot/status/client.py (makeRemote): new approach to making IRemote(None) be None, which works under Twisted-2.0 * buildbot/test/test_status.py (Client.testAdaptation): test it Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test_status.py 24 Apr 2005 21:30:25 -0000 1.14 +++ test_status.py 26 Apr 2005 09:08:29 -0000 1.15 @@ -372,3 +372,11 @@ interfaces.IStatusLogStub)) self.failUnlessEqual(stub.getName(), l.getName()) self.failUnlessEqual(stub.getStep(), l.getStep()) + +class Client(unittest.TestCase): + def testAdaptation(self): + b = builder.BuilderStatus("bname") + b2 = client.makeRemote(b) + self.failUnless(isinstance(b2, client.RemoteBuilder)) + b3 = client.makeRemote(None) + self.failUnless(b3 is None) From warner at users.sourceforge.net Tue Apr 26 09:08:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:08:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.386,1.387 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22070 Modified Files: ChangeLog Log Message: * buildbot/status/client.py (makeRemote): new approach to making IRemote(None) be None, which works under Twisted-2.0 * buildbot/test/test_status.py (Client.testAdaptation): test it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.386 retrieving revision 1.387 diff -u -d -r1.386 -r1.387 --- ChangeLog 26 Apr 2005 07:35:07 -0000 1.386 +++ ChangeLog 26 Apr 2005 09:08:30 -0000 1.387 @@ -1,5 +1,9 @@ 2005-04-26 Brian Warner + * buildbot/status/client.py (makeRemote): new approach to making + IRemote(None) be None, which works under Twisted-2.0 + * buildbot/test/test_status.py (Client.testAdaptation): test it + * buildbot/status/builder.py (Status.builderAdded): when loading a pickled BuilderStatus in from disk, set its name after loading. The config file might have changed its name (but not its From warner at users.sourceforge.net Tue Apr 26 09:09:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:09:00 +0000 Subject: [Buildbot-commits] site index.html,1.37,1.38 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22377 Modified Files: index.html Log Message: s/Johan/Thomas/, add Fluendo pointer Index: index.html =================================================================== RCS file: /cvsroot/buildbot/site/index.html,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- index.html 26 Apr 2005 03:44:41 -0000 1.37 +++ index.html 26 Apr 2005 09:08:58 -0000 1.38 @@ -69,10 +69,11 @@
      1. 'nbm' reports that the first-or-second-largest media company in South Africa uses buildbot, testing PHP code.
      2. -
      3. Johan Dahlin at the GStreamer project is - using a Buildbot to run - multi-distribution tests for their streaming multimedia framework.
      4. +
      5. Thomas Vander Stichele at Fluendo + is using a Buildbot to run + multi-distribution tests for their GStreamer-based streaming + multimedia framework.
      6. Dave Peticolas at Industrial Light & Magic is using a Buildbot internally to test lots of python code.
      7. @@ -128,5 +129,5 @@ align="right" /> -Last modified: Mon Apr 25 20:43:54 PDT 2005 +Last modified: Tue Apr 26 01:53:46 PDT 2005 From warner at users.sourceforge.net Tue Apr 26 09:14:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:14:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24822/buildbot/test Added Files: test_runner.py Log Message: * buildbot/scripts/runner.py (loadOptions): add code to search for ~/.buildbot/, a directory with things like 'options', containing defaults for various 'buildbot' subcommands. .buildbot/ can be in the current directory, your $HOME directory, or anywhere inbetween, as long as you're somewhere inside your home directory. (debugclient): look in ~/.buildbot/options for master and passwd (statuslog): look in ~/.buildbot/options for 'masterstatus' * buildbot/test/test_runner.py (Options.testFindOptions): test it --- NEW FILE: test_runner.py --- # this file tests the 'buildbot' command, with its various sub-commands from twisted.trial import unittest import os, os.path from buildbot.scripts import runner class Options(unittest.TestCase): optionsFile = "SDFsfsFSdfsfsFSD" def setUp(self): self.savedHome = os.environ['HOME'] def tearDown(self): os.environ['HOME'] = self.savedHome def make(self, d, key): # we use a wacky filename here in case the test code discovers the # user's real ~/.buildbot/ directory os.makedirs(os.path.sep.join(d + [".buildbot"])) f = open(os.path.sep.join(d + [".buildbot", self.optionsFile]), "w") f.write("key = '%s'\n" % key) f.close() def check(self, d, key=None): basedir = os.path.sep.join(d) options = runner.loadOptions(basedir, self.optionsFile) if key is None: self.failIf(options.has_key('key')) else: self.failUnlessEqual(options['key'], key) def testFindOptions(self): self.make(["home", "dir1", "dir2", "dir3"], "one") self.make(["home", "dir1", "dir2"], "two") self.make(["home"], "home") self.make(["nothome", "dir1", "dir2"], "three") self.make(["nothome"], "nothome") os.environ['HOME'] = os.path.abspath("home") self.check(["home", "dir1", "dir2", "dir3"], "one") self.check(["home", "dir1", "dir2"], "two") self.check(["home", "dir1"], "home") self.check(["nothome", "dir1", "dir2"], "home") self.check(["nothome", "dir1"], "home") self.check(["nothome"], "home") self.check(["home", "dir1"], "home") os.environ['HOME'] = os.path.abspath("reallynothome") self.check(["home", "dir1"], None) From warner at users.sourceforge.net Tue Apr 26 09:14:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:14:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.12,1.13 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24822/buildbot/scripts Modified Files: runner.py Log Message: * buildbot/scripts/runner.py (loadOptions): add code to search for ~/.buildbot/, a directory with things like 'options', containing defaults for various 'buildbot' subcommands. .buildbot/ can be in the current directory, your $HOME directory, or anywhere inbetween, as long as you're somewhere inside your home directory. (debugclient): look in ~/.buildbot/options for master and passwd (statuslog): look in ~/.buildbot/options for 'masterstatus' * buildbot/test/test_runner.py (Options.testFindOptions): test it Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- runner.py 23 Apr 2005 10:37:00 -0000 1.12 +++ runner.py 26 Apr 2005 09:14:10 -0000 1.13 @@ -1,4 +1,4 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_runner -*- # N.B.: don't import anything that might pull in a reactor yet. Some of our # subcommands want to load modules that need the gtk reactor. @@ -141,6 +141,57 @@ # TODO: poll once per second until twistd.pid goes away sys.exit(0) +def loadOptions(here=None, filename="options"): + """Find the .buildbot/FILENAME file. If we're somewhere under the user's + home directory, look in all directories between here and $HOME. If we're + elsewhere, only look in $HOME. exec() the first 'options' file we find. + + @rtype : dict + @return: a dictionary of names defined in the options file. If no options + file was found, return an empty dict.""" + + if here is None: + here = os.getcwd() + here = os.path.abspath(here) + home = os.path.expanduser("~") + searchpath = [] + toomany = 20 + while True: + searchpath.append(here) + if here == home: + break + next = os.path.dirname(here) + if next == here: + # we've hit the root, without seeing $HOME, so ignore everything + # except the user's home directory + searchpath = [home] + break # we've hit the root + here = next + toomany -= 1 # just in case + if toomany == 0: + raise ValueError("Hey, I seem to have wandered up into the " + "infinite glories of the heavens. Oops.") + + localDict = {} + + for d in searchpath: + if os.path.isdir(os.path.join(d, ".buildbot")): + optfile = os.path.join(d, ".buildbot", filename) + if os.path.exists(optfile): + try: + f = open(optfile, "r") + options = f.read() + exec options in localDict + except: + print "error while reading %s" % optfile + raise + break + + for k in localDict.keys(): + if k.startswith("__"): + del localDict[k] + return localDict + class Base(usage.Options): optFlags = [ ['help', 'h', "Display this message"], @@ -192,9 +243,9 @@ ['help', 'h', "Display this message"], ] optParameters = [ - ["master", "m", "localhost:8007", + ["master", "m", None, "Location of the buildmaster's slaveport (host:port)"], - ["passwd", "p", "debugpw", "Debug password to use"], + ["passwd", "p", None, "Debug password to use"], ] def parseArgs(self, *args): @@ -207,8 +258,23 @@ def debugclient(config): from buildbot.clients import debug - print "config is", config - d = debug.DebugWidget(config['master'], config['passwd']) + opts = loadOptions() + + master = config.get('master') + if not master: + master = opts.get('master') + if master is None: + raise usage.UsageError("master must be specified: on the command " + "line or in ~/.buildbot/options") + + passwd = config.get('passwd') + if not passwd: + passwd = opts.get('debugPassword') + if passwd is None: + raise usage.UsageError("passwd must be specified: on the command " + "line or in ~/.buildbot/options") + + d = debug.DebugWidget(master, passwd) d.run() class StatusClientOptions(usage.Options): @@ -216,7 +282,7 @@ ['help', 'h', "Display this message"], ] optParameters = [ - ["master", "m", "localhost:8007", + ["master", "m", None, "Location of the buildmaster's status port (host:port)"], ] @@ -228,12 +294,26 @@ def statuslog(config): from buildbot.clients import base - c = base.TextClient(config['master']) + opts = loadOptions() + master = config.get('master') + if not master: + master = opts.get('masterstatus') + if master is None: + raise usage.UsageError("master must be specified: on the command " + "line or in ~/.buildbot/options") + c = base.TextClient(master) c.run() def statusgui(config): from buildbot.clients import gtkPanes - c = gtkPanes.GtkClient(config['master']) + opts = loadOptions() + master = config.get('master') + if not master: + master = opts.get('masterstatus') + if master is None: + raise usage.UsageError("master must be specified: on the command " + "line or in ~/.buildbot/options") + c = gtkPanes.GtkClient(master) c.run() class Options(usage.Options): From warner at users.sourceforge.net Tue Apr 26 09:14:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:14:13 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.387,1.388 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24822 Modified Files: ChangeLog Log Message: * buildbot/scripts/runner.py (loadOptions): add code to search for ~/.buildbot/, a directory with things like 'options', containing defaults for various 'buildbot' subcommands. .buildbot/ can be in the current directory, your $HOME directory, or anywhere inbetween, as long as you're somewhere inside your home directory. (debugclient): look in ~/.buildbot/options for master and passwd (statuslog): look in ~/.buildbot/options for 'masterstatus' * buildbot/test/test_runner.py (Options.testFindOptions): test it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.387 retrieving revision 1.388 diff -u -d -r1.387 -r1.388 --- ChangeLog 26 Apr 2005 09:08:30 -0000 1.387 +++ ChangeLog 26 Apr 2005 09:14:10 -0000 1.388 @@ -1,5 +1,14 @@ 2005-04-26 Brian Warner + * buildbot/scripts/runner.py (loadOptions): add code to search for + ~/.buildbot/, a directory with things like 'options', containing + defaults for various 'buildbot' subcommands. .buildbot/ can be in + the current directory, your $HOME directory, or anywhere + inbetween, as long as you're somewhere inside your home directory. + (debugclient): look in ~/.buildbot/options for master and passwd + (statuslog): look in ~/.buildbot/options for 'masterstatus' + * buildbot/test/test_runner.py (Options.testFindOptions): test it + * buildbot/status/client.py (makeRemote): new approach to making IRemote(None) be None, which works under Twisted-2.0 * buildbot/test/test_status.py (Client.testAdaptation): test it From warner at users.sourceforge.net Tue Apr 26 09:43:25 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:43:25 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.10,1.11 test_vc.py,1.25,1.26 test_twisted.py,1.4,1.5 test_runner.py,1.1,1.2 test_run.py,1.25,1.26 test_control.py,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8738/buildbot/test Modified Files: test_web.py test_vc.py test_twisted.py test_runner.py test_run.py test_control.py Log Message: * buildbot/test/test_control.py (Force.rmtree): python2.2 compatibility, apparently its shutil.rmtree ignore_errors= argument is ignored. * buildbot/test/test_run.py (Run.rmtree): same (RunMixin.setUp): same * buildbot/test/test_runner.py (make): python2.2 has os.sep but not os.path.sep * buildbot/test/test_twisted.py (Parse.failUnlessIn): 2.2 has no 'substring in string' operator, must use string.find(substr)!=-1 * buildbot/test/test_vc.py (Patch.failUnlessIn): same * buildbot/test/test_web.py (WebTest.failUnlessIn): same Index: test_control.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_control.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- test_control.py 24 Apr 2005 21:30:25 -0000 1.4 +++ test_control.py 26 Apr 2005 09:43:20 -0000 1.5 @@ -1,6 +1,6 @@ # -*- test-case-name: buildbot.test.test_control -*- -import sys, os, signal, shutil, time +import sys, os, signal, shutil, time, errno from twisted.trial import unittest dr = unittest.deferredResult @@ -52,14 +52,22 @@ class Force(unittest.TestCase): + def rmtree(self, d): + try: + shutil.rmtree(d, ignore_errors=1) + except OSError, e: + # stupid 2.2 appears to ignore ignore_errors + if e.errno != errno.ENOENT: + raise + def setUp(self): self.master = None self.slave = None - shutil.rmtree("control_basedir", ignore_errors=1) + self.rmtree("control_basedir") os.mkdir("control_basedir") self.master = master.BuildMaster("control_basedir") self.slavebase = os.path.abspath("control_slavebase") - shutil.rmtree(self.slavebase, ignore_errors=1) + self.rmtree(self.slavebase) os.mkdir("control_slavebase") def connectSlave(self): Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- test_run.py 26 Apr 2005 07:16:35 -0000 1.25 +++ test_run.py 26 Apr 2005 09:43:20 -0000 1.26 @@ -4,7 +4,7 @@ dr = unittest.deferredResult from twisted.internet import reactor, defer from twisted.python import log -import sys, os, shutil, time +import sys, os, shutil, time, errno #log.startLogging(sys.stderr) from buildbot import master, interfaces @@ -209,8 +209,16 @@ self.announce() class Run(unittest.TestCase): + def rmtree(self, d): + try: + shutil.rmtree(d, ignore_errors=1) + except OSError, e: + # stupid 2.2 appears to ignore ignore_errors + if e.errno != errno.ENOENT: + raise + def testMaster(self): - shutil.rmtree("basedir", ignore_errors=1) + self.rmtree("basedir") os.mkdir("basedir") m = master.BuildMaster("basedir") m.loadConfig(config_1) @@ -231,10 +239,18 @@ slave = None slave2 = None + def rmtree(self, d): + try: + shutil.rmtree(d, ignore_errors=1) + except OSError, e: + # stupid 2.2 appears to ignore ignore_errors + if e.errno != errno.ENOENT: + raise + def setUp(self): - shutil.rmtree("basedir", ignore_errors=1) - shutil.rmtree("slavebase", ignore_errors=1) - shutil.rmtree("slavebase2", ignore_errors=1) + self.rmtree("basedir") + self.rmtree("slavebase") + self.rmtree("slavebase2") os.mkdir("basedir") self.master = master.BuildMaster("basedir") Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_runner.py 26 Apr 2005 09:14:10 -0000 1.1 +++ test_runner.py 26 Apr 2005 09:43:20 -0000 1.2 @@ -17,13 +17,13 @@ def make(self, d, key): # we use a wacky filename here in case the test code discovers the # user's real ~/.buildbot/ directory - os.makedirs(os.path.sep.join(d + [".buildbot"])) - f = open(os.path.sep.join(d + [".buildbot", self.optionsFile]), "w") + os.makedirs(os.sep.join(d + [".buildbot"])) + f = open(os.sep.join(d + [".buildbot", self.optionsFile]), "w") f.write("key = '%s'\n" % key) f.close() def check(self, d, key=None): - basedir = os.path.sep.join(d) + basedir = os.sep.join(d) options = runner.loadOptions(basedir, self.optionsFile) if key is None: self.failIf(options.has_key('key')) Index: test_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_twisted.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- test_twisted.py 24 Apr 2005 21:30:25 -0000 1.4 +++ test_twisted.py 26 Apr 2005 09:43:19 -0000 1.5 @@ -126,6 +126,9 @@ self.assertEquals(count, self.count(total=None)) class Parse(unittest.TestCase): + def failUnlessIn(self, substr, string): + self.failUnless(string.find(substr) != -1) + def testParse(self): t = MyTrial(build=None, workdir=".", testpath=None, testChanges=True) t.results = [] @@ -141,7 +144,7 @@ "FlowTest", "testProtocolLocalhost")) self.failUnlessEqual(results, builder.SKIPPED) self.failUnlessEqual(text, ['skipped']) - self.failUnless("XXX freezes, fixme" in logs) + self.failUnlessIn("XXX freezes, fixme", logs) self.failUnless(logs.startswith("SKIPPED:")) self.failUnless(logs.endswith("fixme\n")) @@ -161,7 +164,7 @@ self.failUnlessEqual(results, builder.SUCCESS) self.failUnlessEqual(text, ['expected', 'failure']) self.failUnless(logs.startswith("EXPECTED FAILURE: ")) - self.failUnless("\nTraceback " in logs) + self.failUnlessIn("\nTraceback ", logs) self.failUnless(logs.endswith("layout differs from 'SlottedClass'\n")) testname, results, text, logs = r4 @@ -171,6 +174,6 @@ self.failUnlessEqual(results, builder.FAILURE) self.failUnlessEqual(text, ['failure']) self.failUnless(logs.startswith("FAILURE: ")) - self.failUnless("Traceback " in logs) + self.failUnlessIn("Traceback ", logs) self.failUnless(logs.endswith("'testRenameFile', 'testfile1']\n")) Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- test_vc.py 24 Apr 2005 21:30:25 -0000 1.25 +++ test_vc.py 26 Apr 2005 09:43:17 -0000 1.26 @@ -79,7 +79,7 @@ log.msg("running svn --version..") v = dr(utils.getProcessOutput('svn', ["--version"], env=os.environ)) - if "handles 'file' schema" in v: + if v.find("handles 'file' schema") != -1: self.have['svn'] = True else: log.msg(("%s found but it does not support 'file:' " + @@ -412,6 +412,8 @@ os.system("tla register-archive -d test at buildbot.sf.net--testvc") class Patch(SetupMixin, unittest.TestCase): + def failUnlessIn(self, substr, string): + self.failUnless(string.find(substr) != -1) def doPatch(self, vc, revision, **kwargs): m = self.master @@ -435,8 +437,8 @@ f = open(os.path.join(self.slavebase, "vc-dir", "build", "good.c"), "r") data = f.read() - self.failUnless("this is a hello-world program" in data) - self.failUnless("Hello, world.\\n" in data) + self.failUnlessIn("this is a hello-world program", data) + self.failUnlessIn("Hello, world.\\n", data) # make sure that a rebuild does not use the leftover patched workdir build.setSourceStamp(None, None) @@ -451,7 +453,7 @@ f = open(os.path.join(self.slavebase, "vc-dir", "build", "good.c"), "r") data = f.read() - self.failUnless("Hello world\\n" in data) # no comma + self.failUnlessIn("Hello world\\n", data) # no comma def testPatchCVS(self): Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- test_web.py 26 Apr 2005 06:32:08 -0000 1.10 +++ test_web.py 26 Apr 2005 09:43:16 -0000 1.11 @@ -70,6 +70,9 @@ class WebTest(unittest.TestCase): + def failUnlessIn(self, substr, string): + self.failUnless(string.find(substr) != -1) + def tearDown(self): # grr. from twisted.protocols import http @@ -180,8 +183,8 @@ d = client.getPage("http://localhost:%d/" % port) page = dr(d) self.failUnless(page) - self.failUnless("current activity" in page) - self.failUnless("" in page) + self.failUnlessIn("current activity", page) + self.failUnlessIn("", page) d = client.getPage("http://localhost:%d/favicon.ico" % port) icon = dr(d) @@ -190,7 +193,7 @@ d = client.getPage("http://localhost:%d/changes" % port) changes = dr(d) - self.failUnless("
      8. Syncmail mailing list in maildir my-maildir
      9. " - in changes) + self.failUnlessIn("
      10. Syncmail mailing list in maildir " + + "my-maildir
      11. ", changes) dr(m.stopService()) From warner at users.sourceforge.net Tue Apr 26 09:43:26 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 09:43:26 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.388,1.389 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8738 Modified Files: ChangeLog Log Message: * buildbot/test/test_control.py (Force.rmtree): python2.2 compatibility, apparently its shutil.rmtree ignore_errors= argument is ignored. * buildbot/test/test_run.py (Run.rmtree): same (RunMixin.setUp): same * buildbot/test/test_runner.py (make): python2.2 has os.sep but not os.path.sep * buildbot/test/test_twisted.py (Parse.failUnlessIn): 2.2 has no 'substring in string' operator, must use string.find(substr)!=-1 * buildbot/test/test_vc.py (Patch.failUnlessIn): same * buildbot/test/test_web.py (WebTest.failUnlessIn): same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.388 retrieving revision 1.389 diff -u -d -r1.388 -r1.389 --- ChangeLog 26 Apr 2005 09:14:10 -0000 1.388 +++ ChangeLog 26 Apr 2005 09:43:23 -0000 1.389 @@ -1,5 +1,19 @@ 2005-04-26 Brian Warner + * buildbot/test/test_control.py (Force.rmtree): python2.2 + compatibility, apparently its shutil.rmtree ignore_errors= + argument is ignored. + * buildbot/test/test_run.py (Run.rmtree): same + (RunMixin.setUp): same + + * buildbot/test/test_runner.py (make): python2.2 has os.sep but + not os.path.sep + + * buildbot/test/test_twisted.py (Parse.failUnlessIn): 2.2 has no + 'substring in string' operator, must use string.find(substr)!=-1 + * buildbot/test/test_vc.py (Patch.failUnlessIn): same + * buildbot/test/test_web.py (WebTest.failUnlessIn): same + * buildbot/scripts/runner.py (loadOptions): add code to search for ~/.buildbot/, a directory with things like 'options', containing defaults for various 'buildbot' subcommands. .buildbot/ can be in From warner at users.sourceforge.net Tue Apr 26 18:36:08 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 18:36:08 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py,1.2,1.3 test_run.py,1.26,1.27 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25811/buildbot/test Modified Files: test_runner.py test_run.py Log Message: * buildbot/test/test_runner.py (Options.optionsFile): disable on windows for now, I don't know what ~/.buildbot/ should mean there. * buildbot/test/test_run.py (BuilderNames.testGetBuilderNames): win32 compatibility, don't use "/tmp" (Basedir.testChangeBuilddir): remove more unixisms Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- test_run.py 26 Apr 2005 09:43:20 -0000 1.26 +++ test_run.py 26 Apr 2005 18:36:06 -0000 1.27 @@ -4,7 +4,7 @@ dr = unittest.deferredResult from twisted.internet import reactor, defer from twisted.python import log -import sys, os, shutil, time, errno +import sys, os, os.path, shutil, time, errno #log.startLogging(sys.stderr) from buildbot import master, interfaces @@ -502,7 +502,8 @@ class BuilderNames(unittest.TestCase): def testGetBuilderNames(self): - m = master.BuildMaster("/tmp") + os.mkdir("bnames") + m = master.BuildMaster("bnames") s = m.getStatus() m.loadConfig(config_3) @@ -794,7 +795,8 @@ builder = bot.builders.get("dummy") self.failUnless(builder) self.failUnlessEqual(builder.builddir, "dummy") - self.failUnlessEqual(builder.basedir, "slavebase/dummy") + self.failUnlessEqual(builder.basedir, + os.path.join("slavebase", "dummy")) d = m.loadConfig(config_4_newbasedir) dr(d) @@ -805,7 +807,8 @@ self.failUnless(builder) # the basedir should be updated self.failUnlessEqual(builder.builddir, "dummy2") - self.failUnlessEqual(builder.basedir, "slavebase/dummy2") + self.failUnlessEqual(builder.basedir, + os.path.join("slavebase", "dummy2")) # add a new builder, which causes the basedir list to be reloaded d = m.loadConfig(config_4_newbuilder) Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test_runner.py 26 Apr 2005 09:43:20 -0000 1.2 +++ test_runner.py 26 Apr 2005 18:36:05 -0000 1.3 @@ -47,4 +47,7 @@ self.check(["home", "dir1"], "home") os.environ['HOME'] = os.path.abspath("reallynothome") self.check(["home", "dir1"], None) - + +if runtime.platformType != 'posix': + # I need to figure out what "home directory" might mean on windows + del Options From warner at users.sourceforge.net Tue Apr 26 18:36:09 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 18:36:09 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.389,1.390 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25811 Modified Files: ChangeLog Log Message: * buildbot/test/test_runner.py (Options.optionsFile): disable on windows for now, I don't know what ~/.buildbot/ should mean there. * buildbot/test/test_run.py (BuilderNames.testGetBuilderNames): win32 compatibility, don't use "/tmp" (Basedir.testChangeBuilddir): remove more unixisms Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.389 retrieving revision 1.390 diff -u -d -r1.389 -r1.390 --- ChangeLog 26 Apr 2005 09:43:23 -0000 1.389 +++ ChangeLog 26 Apr 2005 18:36:06 -0000 1.390 @@ -1,5 +1,14 @@ 2005-04-26 Brian Warner + * buildbot/test/test_runner.py (Options.optionsFile): disable on + windows for now, I don't know what ~/.buildbot/ should mean there. + + * buildbot/test/test_run.py (BuilderNames.testGetBuilderNames): + win32 compatibility, don't use "/tmp" + (Basedir.testChangeBuilddir): remove more unixisms + +2005-04-26 Brian Warner + * buildbot/test/test_control.py (Force.rmtree): python2.2 compatibility, apparently its shutil.rmtree ignore_errors= argument is ignored. From warner at users.sourceforge.net Tue Apr 26 18:36:55 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 18:36:55 +0000 Subject: [Buildbot-commits] buildbot Makefile,1.6,1.7 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26307 Modified Files: Makefile Log Message: update the deb-snapshot target's base version number Index: Makefile =================================================================== RCS file: /cvsroot/buildbot/buildbot/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 22 Apr 2005 03:55:53 -0000 1.6 +++ Makefile 26 Apr 2005 18:36:53 -0000 1.7 @@ -22,7 +22,7 @@ #debuild -uc -us deb-snapshot: - debchange --newversion 0.5.0.snapshot.`date +%Y.%m.%d.%H.%M.%S` \ + debchange --newversion 0.6.3.snapshot.`date +%Y.%m.%d.%H.%M.%S` \ "snapshot build" debuild binary From warner at users.sourceforge.net Tue Apr 26 18:40:09 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 18:40:09 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py,1.3,1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28413 Modified Files: test_runner.py Log Message: import 'runtime' before using it. Bad programmer! Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_runner.py 26 Apr 2005 18:36:05 -0000 1.3 +++ test_runner.py 26 Apr 2005 18:40:07 -0000 1.4 @@ -2,6 +2,7 @@ # this file tests the 'buildbot' command, with its various sub-commands from twisted.trial import unittest +from twisted.python import runtime import os, os.path from buildbot.scripts import runner From warner at users.sourceforge.net Tue Apr 26 18:45:55 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 18:45:55 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_slavecommand.py,1.11,1.12 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32356/buildbot/test Modified Files: test_slavecommand.py Log Message: (Shell.checkOutput): replace any "\n" in the expected output with the platform-specific line separator. Make this separator "\r\n" on PTYs under unix, they seem to do that and I don't know why Index: test_slavecommand.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- test_slavecommand.py 24 Apr 2005 21:30:25 -0000 1.11 +++ test_slavecommand.py 26 Apr 2005 18:45:53 -0000 1.12 @@ -10,7 +10,7 @@ import sys startLogging(sys.stdout) -import re, time, sys +import os, re, time, sys import signal from buildbot.slave.commands import SlaveShellCommand @@ -107,10 +107,13 @@ @type expected: list of (streamname, contents) tuples @param expected: the expected output """ + expected_linesep = os.linesep if self.usePTY: # PTYs change the line ending. I'm not sure why. - expected = [(stream, contents.replace("\n", "\r\n", 1000)) - for (stream, contents) in expected] + expected_linesep = "\r\n" + expected = [(stream, contents.replace("\n", expected_linesep, 1000)) + for (stream, contents) in expected] + if self.usePTY: # PTYs merge stdout+stderr into a single stream expected = [('stdout', contents) for (stream, contents) in expected] From warner at users.sourceforge.net Tue Apr 26 18:45:56 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 18:45:56 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.390,1.391 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32356 Modified Files: ChangeLog Log Message: (Shell.checkOutput): replace any "\n" in the expected output with the platform-specific line separator. Make this separator "\r\n" on PTYs under unix, they seem to do that and I don't know why Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.390 retrieving revision 1.391 diff -u -d -r1.390 -r1.391 --- ChangeLog 26 Apr 2005 18:36:06 -0000 1.390 +++ ChangeLog 26 Apr 2005 18:45:53 -0000 1.391 @@ -1,5 +1,10 @@ 2005-04-26 Brian Warner + * buildbot/test/test_slavecommand.py (Shell.checkOutput): replace + any "\n" in the expected output with the platform-specific line + separator. Make this separator "\r\n" on PTYs under unix, they + seem to do that and I don't know why + * buildbot/test/test_runner.py (Options.optionsFile): disable on windows for now, I don't know what ~/.buildbot/ should mean there. From warner at users.sourceforge.net Tue Apr 26 20:10:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 20:10:21 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.391,1.392 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452 Modified Files: ChangeLog Log Message: * buildbot/scripts/runner.py (loadOptions): do something sane for windows, I think. We use %APPDATA%/buildbot instead of ~/.buildbot, but we still search everywhere from the current directory up to the root for a .buildbot/ subdir. The "is it under $HOME" security test was replaced with "is it owned by the current user", which is only performed under posix. * buildbot/test/test_runner.py (Options.testFindOptions): update tests to match. The "is it owned by the current user" check is untested. The test has been re-enabled for windows. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.391 retrieving revision 1.392 diff -u -d -r1.391 -r1.392 --- ChangeLog 26 Apr 2005 18:45:53 -0000 1.391 +++ ChangeLog 26 Apr 2005 20:10:10 -0000 1.392 @@ -1,5 +1,15 @@ 2005-04-26 Brian Warner + * buildbot/scripts/runner.py (loadOptions): do something sane for + windows, I think. We use %APPDATA%/buildbot instead of + ~/.buildbot, but we still search everywhere from the current + directory up to the root for a .buildbot/ subdir. The "is it under + $HOME" security test was replaced with "is it owned by the current + user", which is only performed under posix. + * buildbot/test/test_runner.py (Options.testFindOptions): update + tests to match. The "is it owned by the current user" check is + untested. The test has been re-enabled for windows. + * buildbot/test/test_slavecommand.py (Shell.checkOutput): replace any "\n" in the expected output with the platform-specific line separator. Make this separator "\r\n" on PTYs under unix, they From warner at users.sourceforge.net Tue Apr 26 20:10:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 20:10:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.13,1.14 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452/buildbot/scripts Modified Files: runner.py Log Message: * buildbot/scripts/runner.py (loadOptions): do something sane for windows, I think. We use %APPDATA%/buildbot instead of ~/.buildbot, but we still search everywhere from the current directory up to the root for a .buildbot/ subdir. The "is it under $HOME" security test was replaced with "is it owned by the current user", which is only performed under posix. * buildbot/test/test_runner.py (Options.testFindOptions): update tests to match. The "is it owned by the current user" check is untested. The test has been re-enabled for windows. Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- runner.py 26 Apr 2005 09:14:10 -0000 1.13 +++ runner.py 26 Apr 2005 20:10:10 -0000 1.14 @@ -2,8 +2,8 @@ # N.B.: don't import anything that might pull in a reactor yet. Some of our # subcommands want to load modules that need the gtk reactor. -import os, os.path, sys, shutil -from twisted.python import usage, util +import os, os.path, sys, shutil, stat +from twisted.python import usage, util, runtime # this is mostly just a front-end for mktap, twistd, and kill(1), but in the # future it will also provide an interface to some developer tools that talk @@ -141,11 +141,12 @@ # TODO: poll once per second until twistd.pid goes away sys.exit(0) -def loadOptions(here=None, filename="options"): - """Find the .buildbot/FILENAME file. If we're somewhere under the user's - home directory, look in all directories between here and $HOME. If we're - elsewhere, only look in $HOME. exec() the first 'options' file we find. - +def loadOptions(filename="options", here=None, home=None): + """Find the .buildbot/FILENAME file. Crawl from the current directory up + towards the root, and also look in ~/.buildbot . The first directory + that's owned by the user and has the file we're looking for wins. Windows + skips the owned-by-user test. + @rtype : dict @return: a dictionary of names defined in the options file. If no options file was found, return an empty dict.""" @@ -153,30 +154,36 @@ if here is None: here = os.getcwd() here = os.path.abspath(here) - home = os.path.expanduser("~") + + if home is None: + if runtime.platformType == 'win32': + home = os.path.join(os.environ['APPDATA'], "buildbot") + else: + home = os.path.expanduser("~/.buildbot") + searchpath = [] toomany = 20 while True: - searchpath.append(here) - if here == home: - break + searchpath.append(os.path.join(here, ".buildbot")) next = os.path.dirname(here) if next == here: - # we've hit the root, without seeing $HOME, so ignore everything - # except the user's home directory - searchpath = [home] break # we've hit the root here = next toomany -= 1 # just in case if toomany == 0: raise ValueError("Hey, I seem to have wandered up into the " "infinite glories of the heavens. Oops.") + searchpath.append(home) localDict = {} for d in searchpath: - if os.path.isdir(os.path.join(d, ".buildbot")): - optfile = os.path.join(d, ".buildbot", filename) + if os.path.isdir(d): + if runtime.platformType != 'win32': + if os.stat(d)[stat.ST_UID] != os.getuid(): + print "skipping %s because you don't own it" % d + continue # security, skip other people's directories + optfile = os.path.join(d, filename) if os.path.exists(optfile): try: f = open(optfile, "r") From warner at users.sourceforge.net Tue Apr 26 20:10:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 20:10:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452/buildbot/test Modified Files: test_runner.py Log Message: * buildbot/scripts/runner.py (loadOptions): do something sane for windows, I think. We use %APPDATA%/buildbot instead of ~/.buildbot, but we still search everywhere from the current directory up to the root for a .buildbot/ subdir. The "is it under $HOME" security test was replaced with "is it owned by the current user", which is only performed under posix. * buildbot/test/test_runner.py (Options.testFindOptions): update tests to match. The "is it owned by the current user" check is untested. The test has been re-enabled for windows. Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- test_runner.py 26 Apr 2005 18:40:07 -0000 1.4 +++ test_runner.py 26 Apr 2005 20:10:07 -0000 1.5 @@ -10,11 +10,6 @@ class Options(unittest.TestCase): optionsFile = "SDFsfsFSdfsfsFSD" - def setUp(self): - self.savedHome = os.environ['HOME'] - def tearDown(self): - os.environ['HOME'] = self.savedHome - def make(self, d, key): # we use a wacky filename here in case the test code discovers the # user's real ~/.buildbot/ directory @@ -23,9 +18,10 @@ f.write("key = '%s'\n" % key) f.close() - def check(self, d, key=None): + def check(self, d, key): basedir = os.sep.join(d) - options = runner.loadOptions(basedir, self.optionsFile) + options = runner.loadOptions(self.optionsFile, here=basedir, + home=self.home) if key is None: self.failIf(options.has_key('key')) else: @@ -35,20 +31,12 @@ self.make(["home", "dir1", "dir2", "dir3"], "one") self.make(["home", "dir1", "dir2"], "two") self.make(["home"], "home") - self.make(["nothome", "dir1", "dir2"], "three") - self.make(["nothome"], "nothome") - os.environ['HOME'] = os.path.abspath("home") + self.home = os.path.abspath("home") self.check(["home", "dir1", "dir2", "dir3"], "one") self.check(["home", "dir1", "dir2"], "two") self.check(["home", "dir1"], "home") - self.check(["nothome", "dir1", "dir2"], "home") - self.check(["nothome", "dir1"], "home") - self.check(["nothome"], "home") - self.check(["home", "dir1"], "home") - os.environ['HOME'] = os.path.abspath("reallynothome") - self.check(["home", "dir1"], None) -if runtime.platformType != 'posix': - # I need to figure out what "home directory" might mean on windows - del Options + self.home = os.path.abspath("nothome") + os.makedirs(os.sep.join(["nothome", "dir1"])) + self.check(["nothome", "dir1"], None) From warner at users.sourceforge.net Tue Apr 26 20:25:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 20:25:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.57,1.58 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19248/buildbot/status Modified Files: html.py Log Message: * buildbot/status/html.py (WaterfallStatusResource.body): add the timezone to the timestamp column. * buildbot/test/test_web.py (WebTest.test_waterfall): test it Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- html.py 26 Apr 2005 06:32:09 -0000 1.57 +++ html.py 26 Apr 2005 20:25:30 -0000 1.58 @@ -907,7 +907,8 @@ data += " \n" data += "
    \n" - data += td("time", align="center", class_="Time") + TZ = time.tzname[time.daylight] + data += td("time (%s)" % TZ, align="center", class_="Time") name = changeNames[0] data += td( "%s" % (urllib.quote(name), name), From warner at users.sourceforge.net Tue Apr 26 20:25:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 20:25:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.11,1.12 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19248/buildbot/test Modified Files: test_web.py Log Message: * buildbot/status/html.py (WaterfallStatusResource.body): add the timezone to the timestamp column. * buildbot/test/test_web.py (WebTest.test_waterfall): test it Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- test_web.py 26 Apr 2005 09:43:16 -0000 1.11 +++ test_web.py 26 Apr 2005 20:25:30 -0000 1.12 @@ -1,6 +1,6 @@ # -*- test-case-name: buildbot.test.test_web -*- -import sys, os, os.path +import sys, os, os.path, time from twisted.python import log, components, util #log.startLogging(sys.stderr) @@ -155,8 +155,7 @@ d = client.getPage("http://localhost:%d/remote/" % p.portnum) page = dr(d, 10) - #print page - self.failUnless(page) + self.failUnlessIn("BuildBot", page) dr(p.shutdown()) dr(m.stopService()) @@ -185,6 +184,8 @@ self.failUnless(page) self.failUnlessIn("current activity", page) self.failUnlessIn("", page) + TZ = time.tzname[time.daylight] + self.failUnlessIn("time (%s)" % TZ, page) d = client.getPage("http://localhost:%d/favicon.ico" % port) icon = dr(d) From warner at users.sourceforge.net Tue Apr 26 20:25:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 20:25:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.392,1.393 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19248 Modified Files: ChangeLog Log Message: * buildbot/status/html.py (WaterfallStatusResource.body): add the timezone to the timestamp column. * buildbot/test/test_web.py (WebTest.test_waterfall): test it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.392 retrieving revision 1.393 diff -u -d -r1.392 -r1.393 --- ChangeLog 26 Apr 2005 20:10:10 -0000 1.392 +++ ChangeLog 26 Apr 2005 20:25:31 -0000 1.393 @@ -1,5 +1,9 @@ 2005-04-26 Brian Warner + * buildbot/status/html.py (WaterfallStatusResource.body): add the + timezone to the timestamp column. + * buildbot/test/test_web.py (WebTest.test_waterfall): test it + * buildbot/scripts/runner.py (loadOptions): do something sane for windows, I think. We use %APPDATA%/buildbot instead of ~/.buildbot, but we still search everywhere from the current From warner at users.sourceforge.net Tue Apr 26 21:37:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 21:37:22 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.393,1.394 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28679 Modified Files: ChangeLog Log Message: (ShellCommand._startCommand): prepend 'cmd.exe' (or rather os.environ['COMSPEC']) to the argv list when running under windows. This appears to be the best way to allow BuildSteps to do something normal like 'trial -v buildbot.test' or 'make foo' and still expect it to work. The idea is to make the BuildSteps look as much like what a developer would type when compiling or testing the tree by hand. This approach probably has problems when there are spaces in the arguments, so if you've got windows buildslaves, you'll need to pay close attention to your commands. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.393 retrieving revision 1.394 diff -u -d -r1.393 -r1.394 --- ChangeLog 26 Apr 2005 20:25:31 -0000 1.393 +++ ChangeLog 26 Apr 2005 21:37:17 -0000 1.394 @@ -1,5 +1,16 @@ 2005-04-26 Brian Warner + * buildbot/slave/commands.py (ShellCommand._startCommand): prepend + 'cmd.exe' (or rather os.environ['COMSPEC']) to the argv list when + running under windows. This appears to be the best way to allow + BuildSteps to do something normal like 'trial -v buildbot.test' or + 'make foo' and still expect it to work. The idea is to make the + BuildSteps look as much like what a developer would type when + compiling or testing the tree by hand. This approach probably has + problems when there are spaces in the arguments, so if you've got + windows buildslaves, you'll need to pay close attention to your + commands. + * buildbot/status/html.py (WaterfallStatusResource.body): add the timezone to the timestamp column. * buildbot/test/test_web.py (WebTest.test_waterfall): test it From warner at users.sourceforge.net Tue Apr 26 21:37:19 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 26 Apr 2005 21:37:19 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.26,1.27 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28679/buildbot/slave Modified Files: commands.py Log Message: (ShellCommand._startCommand): prepend 'cmd.exe' (or rather os.environ['COMSPEC']) to the argv list when running under windows. This appears to be the best way to allow BuildSteps to do something normal like 'trial -v buildbot.test' or 'make foo' and still expect it to work. The idea is to make the BuildSteps look as much like what a developer would type when compiling or testing the tree by hand. This approach probably has problems when there are spaces in the arguments, so if you've got windows buildslaves, you'll need to pay close attention to your commands. Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- commands.py 24 Apr 2005 21:30:27 -0000 1.26 +++ commands.py 26 Apr 2005 21:37:16 -0000 1.27 @@ -163,7 +163,10 @@ # hurt to try argv = ['/bin/sh', '-c', self.command] else: - argv = self.command + if runtime.platformType == 'win32': + argv = [os.environ['COMSPEC'], '/c'] + list(self.command) + else: + argv = self.command # self.stdin is handled in ShellCommandPP.connectionMade From warner at users.sourceforge.net Wed Apr 27 01:40:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 01:40:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot buildbot.png,1.1,1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7533/buildbot Modified Files: buildbot.png Log Message: use a new, smaller (16x16) icon image, rendered with Blender.. looks a bit nicer. Index: buildbot.png =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/buildbot.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsplneth and /tmp/cvsmVgsdo differ From warner at users.sourceforge.net Wed Apr 27 01:40:14 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 01:40:14 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.394,1.395 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7533 Modified Files: ChangeLog Log Message: use a new, smaller (16x16) icon image, rendered with Blender.. looks a bit nicer. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.394 retrieving revision 1.395 diff -u -d -r1.394 -r1.395 --- ChangeLog 26 Apr 2005 21:37:17 -0000 1.394 +++ ChangeLog 27 Apr 2005 01:40:11 -0000 1.395 @@ -1,5 +1,8 @@ 2005-04-26 Brian Warner + * buildbot/buildbot.png: use a new, smaller (16x16) icon image, + rendered with Blender.. looks a bit nicer. + * buildbot/slave/commands.py (ShellCommand._startCommand): prepend 'cmd.exe' (or rather os.environ['COMSPEC']) to the argv list when running under windows. This appears to be the best way to allow From warner at users.sourceforge.net Wed Apr 27 01:42:42 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 01:42:42 +0000 Subject: [Buildbot-commits] buildbot/docs/images - New directory Message-ID: Update of /cvsroot/buildbot/buildbot/docs/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8842/images Log Message: Directory /cvsroot/buildbot/buildbot/docs/images added to the repository From warner at users.sourceforge.net Wed Apr 27 01:45:39 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 01:45:39 +0000 Subject: [Buildbot-commits] buildbot/docs/images icon.blend,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/docs/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10689/docs/images Added Files: icon.blend Log Message: * buildbot/docs/images/icon.blend: add the Blender file for it --- NEW FILE: icon.blend --- (This appears to be a binary file; contents omitted.) From warner at users.sourceforge.net Wed Apr 27 01:45:39 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 01:45:39 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.395,1.396 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10689 Modified Files: ChangeLog Log Message: * buildbot/docs/images/icon.blend: add the Blender file for it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.395 retrieving revision 1.396 diff -u -d -r1.395 -r1.396 --- ChangeLog 27 Apr 2005 01:40:11 -0000 1.395 +++ ChangeLog 27 Apr 2005 01:45:37 -0000 1.396 @@ -2,6 +2,7 @@ * buildbot/buildbot.png: use a new, smaller (16x16) icon image, rendered with Blender.. looks a bit nicer. + * buildbot/docs/images/icon.blend: add the Blender file for it * buildbot/slave/commands.py (ShellCommand._startCommand): prepend 'cmd.exe' (or rather os.environ['COMSPEC']) to the argv list when From warner at users.sourceforge.net Wed Apr 27 10:35:31 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 10:35:31 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.64,1.65 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16033/buildbot Modified Files: master.py Log Message: (BuildMaster.loadChanges): fix change_svc setup, it was completely broken for new buildmasters (those which did not have a 'change.pck' already saved. Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- master.py 26 Apr 2005 02:13:47 -0000 1.64 +++ master.py 27 Apr 2005 10:35:27 -0000 1.65 @@ -611,13 +611,14 @@ self.statusTargets = [] self.bots = [] - self.useChanges(ChangeMaster()) self.readConfig = False def __getstate__(self): state = service.MultiService.__getstate__(self) state = styles.Versioned.__getstate__(self, state) + if state.has_key('change_svc'): + del state['change_svc'] return state def upgradeToVersion1(self): @@ -655,8 +656,8 @@ self.change_svc.basedir = self.basedir self.change_svc.botmaster = self.botmaster self.change_svc.setName("changemaster") - self.change_svc.setServiceParent(self) self.dispatcher.changemaster = self.change_svc + self.change_svc.setServiceParent(self) def loadChanges(self): filename = os.path.join(self.basedir, "changes.pck") @@ -664,10 +665,10 @@ changes = pickle.load(open(filename, "r")) except IOError: log.msg("changes.pck missing, using new one") - return # __init__ created a ChangeMaster() already, just use it + changes = ChangeMaster() except EOFError: log.msg("corrupted changes.pck, using new one") - return # ditto + changes = ChangeMaster() self.useChanges(changes) def _handleSIGHUP(self, *args): @@ -888,6 +889,8 @@ return defer.DeferredList(dl) def loadConfig_Sources(self, sources): + log.msg("loadConfig_Sources, change_svc is", self.change_svc, + self.change_svc.parent) # shut down any that were removed, start any that were added oldsources = list(self.change_svc) dl = [self.change_svc.removeSource(source) From warner at users.sourceforge.net Wed Apr 27 10:35:31 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 10:35:31 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.396,1.397 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16033 Modified Files: ChangeLog Log Message: (BuildMaster.loadChanges): fix change_svc setup, it was completely broken for new buildmasters (those which did not have a 'change.pck' already saved. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.396 retrieving revision 1.397 diff -u -d -r1.396 -r1.397 --- ChangeLog 27 Apr 2005 01:45:37 -0000 1.396 +++ ChangeLog 27 Apr 2005 10:35:29 -0000 1.397 @@ -1,3 +1,9 @@ +2005-04-27 Brian Warner + + * buildbot/master.py (BuildMaster.loadChanges): fix change_svc + setup, it was completely broken for new buildmasters (those which + did not have a 'change.pck' already saved. + 2005-04-26 Brian Warner * buildbot/buildbot.png: use a new, smaller (16x16) icon image, From warner at users.sourceforge.net Wed Apr 27 11:46:16 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 11:46:16 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_config.py,1.15,1.16 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23292/buildbot/test Modified Files: test_config.py Log Message: * buildbot/master.py (BuildMaster.loadChanges): fix change_svc setup, it was completely broken for new buildmasters (those which did not have a 'change.pck' already saved. Thanks to Paul Warren for catching this (embarrassing!) bug. (Dispatcher.__getstate__): don't save our registered avatar factories, since they'll be re-populated when the config file is re-read. (BuildMaster.__init__): add a dummy ChangeMaster, used only by tests (since the real mktap-generated BuildMaster doesn't save this attribute). (BuildMaster.__getstate__): don't save any service children, they'll all be re-populated when the config file is re-read. * buildbot/test/test_config.py (Save.testSave): test for this Index: test_config.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- test_config.py 24 Apr 2005 21:30:25 -0000 1.15 +++ test_config.py 27 Apr 2005 11:46:13 -0000 1.16 @@ -6,6 +6,7 @@ from twisted.trial import unittest dr = unittest.deferredResult from twisted.python import components +from twisted.internet import defer try: import cvstoys @@ -907,3 +908,55 @@ m = BuildMaster("test_cf", "alternate.cfg") m.loadTheConfigFile() self.failUnlessEqual(m.slavePortnum, 9000) + +saveCfg1 = \ +""" +from buildbot.changes import pb +from buildbot.status import html, client +c = {} +c['bots'] = [] +c['sources'] = [pb.PBChangeSource()] +c['builders'] = [] +c['slavePortnum'] = 0 +c['status'] = [html.Waterfall(http_port=0), client.PBListener(0)] +BuildmasterConfig = c +""" + +class Save(unittest.TestCase): + def setUp(self): + self.saved_argv = sys.argv + def tearDown(self): + sys.argv = self.saved_argv + + def testSave(self): + # the idea here is to create the same buildbot.tap file that 'mktap + # buildbot master --basedir test_save' would create. Then we load it, + # and make sure it looks ok. We copy some code from + # twisted.scripts.mktap to avoid spawning a mktap instance (who knows + # how to accomplish such a thing under windows). + + from twisted.scripts import mktap, twistd + os.mkdir("test_save") + f = open(os.path.join("test_save", "master.cfg"), "w") + f.write(saveCfg1) + f.close() + tapname = os.path.join("test_save", "buildbot.tap") + self.failIf(os.path.exists(tapname)) # shouldn't ever happen + sys.argv = ["mktap", "-a", tapname, + "buildbot", "master", "--basedir", "test_save"] + mktap.run() # creates test_save/buildbot.tap + + # now start the buildmaster from there + a = service.loadApplication(tapname, "pickle", None) + service.IService(a).startService() + + # the buildmaster ought to be running now + m = service.IService(a).getServiceNamed("buildmaster") + self.failUnless(m.running) + self.failUnlessEqual(len(list(m.change_svc)), 1) + + # now shut it down + d = defer.maybeDeferred(service.IService(a).stopService) + dr(d) + + # done From warner at users.sourceforge.net Wed Apr 27 11:46:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 11:46:17 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.65,1.66 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23292/buildbot Modified Files: master.py Log Message: * buildbot/master.py (BuildMaster.loadChanges): fix change_svc setup, it was completely broken for new buildmasters (those which did not have a 'change.pck' already saved. Thanks to Paul Warren for catching this (embarrassing!) bug. (Dispatcher.__getstate__): don't save our registered avatar factories, since they'll be re-populated when the config file is re-read. (BuildMaster.__init__): add a dummy ChangeMaster, used only by tests (since the real mktap-generated BuildMaster doesn't save this attribute). (BuildMaster.__getstate__): don't save any service children, they'll all be re-populated when the config file is re-read. * buildbot/test/test_config.py (Save.testSave): test for this Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- master.py 27 Apr 2005 10:35:27 -0000 1.65 +++ master.py 27 Apr 2005 11:46:14 -0000 1.66 @@ -524,6 +524,11 @@ def upgradeToVersion2(self): self.names = {} + def __getstate__(self): + state = styles.Versioned.__getstate__(self) + state['names'] = {} + return state + def register(self, name, afactory): self.names[name] = afactory def unregister(self, name): @@ -611,6 +616,10 @@ self.statusTargets = [] self.bots = [] + # this ChangeMaster is a dummy, only used by tests. In the real + # buildmaster, where the BuildMaster instance is created by mktap, + # this attribute is not saved in the buildbot.tap file. + self.useChanges(ChangeMaster()) self.readConfig = False @@ -619,6 +628,8 @@ state = styles.Versioned.__getstate__(self, state) if state.has_key('change_svc'): del state['change_svc'] + state['services'] = [] + state['namedServices'] = {} return state def upgradeToVersion1(self): From warner at users.sourceforge.net Wed Apr 27 11:46:18 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 11:46:18 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.397,1.398 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23292 Modified Files: ChangeLog Log Message: * buildbot/master.py (BuildMaster.loadChanges): fix change_svc setup, it was completely broken for new buildmasters (those which did not have a 'change.pck' already saved. Thanks to Paul Warren for catching this (embarrassing!) bug. (Dispatcher.__getstate__): don't save our registered avatar factories, since they'll be re-populated when the config file is re-read. (BuildMaster.__init__): add a dummy ChangeMaster, used only by tests (since the real mktap-generated BuildMaster doesn't save this attribute). (BuildMaster.__getstate__): don't save any service children, they'll all be re-populated when the config file is re-read. * buildbot/test/test_config.py (Save.testSave): test for this Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.397 retrieving revision 1.398 diff -u -d -r1.397 -r1.398 --- ChangeLog 27 Apr 2005 10:35:29 -0000 1.397 +++ ChangeLog 27 Apr 2005 11:46:15 -0000 1.398 @@ -2,7 +2,17 @@ * buildbot/master.py (BuildMaster.loadChanges): fix change_svc setup, it was completely broken for new buildmasters (those which - did not have a 'change.pck' already saved. + did not have a 'change.pck' already saved. Thanks to Paul Warren + for catching this (embarrassing!) bug. + (Dispatcher.__getstate__): don't save our registered avatar + factories, since they'll be re-populated when the config file is + re-read. + (BuildMaster.__init__): add a dummy ChangeMaster, used only by + tests (since the real mktap-generated BuildMaster doesn't save + this attribute). + (BuildMaster.__getstate__): don't save any service children, + they'll all be re-populated when the config file is re-read. + * buildbot/test/test_config.py (Save.testSave): test for this 2005-04-26 Brian Warner From warner at users.sourceforge.net Wed Apr 27 12:02:54 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 12:02:54 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_run.py,1.27,1.28 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv339/buildbot/test Modified Files: test_run.py Log Message: (Disconnect.testBuild2): crank up some timeouts to help the slow metabuildbot not flunk them so much (Disconnect.testBuild3): same Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- test_run.py 26 Apr 2005 18:36:06 -0000 1.27 +++ test_run.py 27 Apr 2005 12:02:51 -0000 1.28 @@ -667,8 +667,8 @@ d = bs.waitUntilFinished() d.addCallback(self._testBuild2_1, s1, bs) - return maybeWait(d, 5) - testBuild2.timeout = 5 + return maybeWait(d, 30) + testBuild2.timeout = 30 def _testBuild2_1(self, res, s1, bs): # we hit here when the build has finished. The builder is still being @@ -693,8 +693,8 @@ reactor.callLater(0.5, self.killSlave) d = bs.waitUntilFinished() d.addCallback(self._testBuild3_1, s1, bs) - return maybeWait(d, 5) - testBuild3.timeout = 5 + return maybeWait(d, 30) + testBuild3.timeout = 30 def _testBuild3_1(self, res, s1, bs): # the builder is still being torn down, so give it another second From warner at users.sourceforge.net Wed Apr 27 12:02:55 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 12:02:55 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.398,1.399 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv339 Modified Files: ChangeLog Log Message: (Disconnect.testBuild2): crank up some timeouts to help the slow metabuildbot not flunk them so much (Disconnect.testBuild3): same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.398 retrieving revision 1.399 diff -u -d -r1.398 -r1.399 --- ChangeLog 27 Apr 2005 11:46:15 -0000 1.398 +++ ChangeLog 27 Apr 2005 12:02:52 -0000 1.399 @@ -1,5 +1,9 @@ 2005-04-27 Brian Warner + * buildbot/test/test_run.py (Disconnect.testBuild2): crank up some + timeouts to help the slow metabuildbot not flunk them so much + (Disconnect.testBuild3): same + * buildbot/master.py (BuildMaster.loadChanges): fix change_svc setup, it was completely broken for new buildmasters (those which did not have a 'change.pck' already saved. Thanks to Paul Warren From warner at users.sourceforge.net Wed Apr 27 12:10:18 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 12:10:18 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.399,1.400 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4199 Modified Files: ChangeLog Log Message: (Disconnect.testBuild2): crank up some timeouts to help the slow metabuildbot not flunk them so much (Disconnect.testBuild3): same (Disconnect.testBuild4): same (Disconnect.testInterrupt): same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.399 retrieving revision 1.400 diff -u -d -r1.399 -r1.400 --- ChangeLog 27 Apr 2005 12:02:52 -0000 1.399 +++ ChangeLog 27 Apr 2005 12:10:16 -0000 1.400 @@ -3,6 +3,8 @@ * buildbot/test/test_run.py (Disconnect.testBuild2): crank up some timeouts to help the slow metabuildbot not flunk them so much (Disconnect.testBuild3): same + (Disconnect.testBuild4): same + (Disconnect.testInterrupt): same * buildbot/master.py (BuildMaster.loadChanges): fix change_svc setup, it was completely broken for new buildmasters (those which From warner at users.sourceforge.net Wed Apr 27 12:10:18 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 12:10:18 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_run.py,1.28,1.29 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4199/buildbot/test Modified Files: test_run.py Log Message: (Disconnect.testBuild2): crank up some timeouts to help the slow metabuildbot not flunk them so much (Disconnect.testBuild3): same (Disconnect.testBuild4): same (Disconnect.testInterrupt): same Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- test_run.py 27 Apr 2005 12:02:51 -0000 1.28 +++ test_run.py 27 Apr 2005 12:10:15 -0000 1.29 @@ -716,7 +716,7 @@ # kill the slave while it's running the second (remote) step reactor.callLater(1.5, self.killSlave) - dr(bs.waitUntilFinished(), 5) + dr(bs.waitUntilFinished(), 30) # at this point, the slave is in the process of being removed, so it # could either be 'idle' or 'offline'. I think there is a # reactor.callLater(0) standing between here and the offline state. @@ -733,7 +733,7 @@ # halt the build while it's running the first step reactor.callLater(0.5, bc.stopBuild, "bang go splat") - dr(bs.waitUntilFinished(), 5) + dr(bs.waitUntilFinished(), 30) self.verifyDisconnect(bs) From warner at users.sourceforge.net Wed Apr 27 20:35:29 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 20:35:29 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes changes.py,1.20,1.21 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8787/buildbot/changes Modified Files: changes.py Log Message: (ChangeMaster.saveYourself): accomodate win32 which can't do atomic-rename Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/changes.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- changes.py 23 Apr 2005 10:22:10 -0000 1.20 +++ changes.py 27 Apr 2005 20:35:27 -0000 1.21 @@ -1,7 +1,7 @@ #! /usr/bin/python from __future__ import generators -import string, os, os.path, time, types +import string, sys, os, os.path, time, types try: import cPickle as pickle except ImportError: @@ -240,6 +240,10 @@ tmpfilename = filename + ".tmp" try: pickle.dump(self, open(tmpfilename, "w")) + if sys.platform == 'win32': + # windows cannot rename a file on top of an existing one + if os.path.exists(filename): + os.unlink(filename) os.rename(tmpfilename, filename) except Exception, e: log.msg("unable to save changes") From warner at users.sourceforge.net Wed Apr 27 20:35:30 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 20:35:30 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.400,1.401 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8787 Modified Files: ChangeLog Log Message: (ChangeMaster.saveYourself): accomodate win32 which can't do atomic-rename Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.400 retrieving revision 1.401 diff -u -d -r1.400 -r1.401 --- ChangeLog 27 Apr 2005 12:10:16 -0000 1.400 +++ ChangeLog 27 Apr 2005 20:35:27 -0000 1.401 @@ -1,5 +1,10 @@ 2005-04-27 Brian Warner + * buildbot/changes/changes.py (ChangeMaster.saveYourself): + accomodate win32 which can't do atomic-rename + +2005-04-27 Brian Warner + * buildbot/test/test_run.py (Disconnect.testBuild2): crank up some timeouts to help the slow metabuildbot not flunk them so much (Disconnect.testBuild3): same From warner at users.sourceforge.net Wed Apr 27 23:24:07 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 23:24:07 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.401,1.402 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2111 Modified Files: ChangeLog Log Message: (Save.testSave): don't pull in twisted.scripts.twistd, we don't need it and it isn't for windows anyway. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.401 retrieving revision 1.402 diff -u -d -r1.401 -r1.402 --- ChangeLog 27 Apr 2005 20:35:27 -0000 1.401 +++ ChangeLog 27 Apr 2005 23:24:05 -0000 1.402 @@ -1,5 +1,9 @@ 2005-04-27 Brian Warner + * buildbot/test/test_config.py (Save.testSave): don't pull in + twisted.scripts.twistd, we don't need it and it isn't for windows + anyway. + * buildbot/changes/changes.py (ChangeMaster.saveYourself): accomodate win32 which can't do atomic-rename From warner at users.sourceforge.net Wed Apr 27 23:24:07 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 27 Apr 2005 23:24:07 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_config.py,1.16,1.17 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2111/buildbot/test Modified Files: test_config.py Log Message: (Save.testSave): don't pull in twisted.scripts.twistd, we don't need it and it isn't for windows anyway. Index: test_config.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- test_config.py 27 Apr 2005 11:46:13 -0000 1.16 +++ test_config.py 27 Apr 2005 23:24:04 -0000 1.17 @@ -935,7 +935,7 @@ # twisted.scripts.mktap to avoid spawning a mktap instance (who knows # how to accomplish such a thing under windows). - from twisted.scripts import mktap, twistd + from twisted.scripts import mktap os.mkdir("test_save") f = open(os.path.join("test_save", "master.cfg"), "w") f.write(saveCfg1) From warner at users.sourceforge.net Thu Apr 28 00:51:04 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 28 Apr 2005 00:51:04 +0000 Subject: [Buildbot-commits] buildbot NEWS,1.39,1.40 ChangeLog,1.402,1.403 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20126 Modified Files: NEWS ChangeLog Log Message: update in preparation for new release Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.402 retrieving revision 1.403 diff -u -d -r1.402 -r1.403 --- ChangeLog 27 Apr 2005 23:24:05 -0000 1.402 +++ ChangeLog 28 Apr 2005 00:51:01 -0000 1.403 @@ -1,5 +1,7 @@ 2005-04-27 Brian Warner + * NEWS: update in preparation for new release + * buildbot/test/test_config.py (Save.testSave): don't pull in twisted.scripts.twistd, we don't need it and it isn't for windows anyway. Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- NEWS 26 Apr 2005 02:54:35 -0000 1.39 +++ NEWS 28 Apr 2005 00:51:01 -0000 1.40 @@ -1,5 +1,65 @@ User visible changes in Buildbot. +* Release 0.6.4 (XX) + +** major bugs fixed + +The 'buildbot' tool in 0.6.3, when used to create a new buildmaster, failed +unless it found a 'changes.pck' file. As this file is created by a running +buildmaster, this made 0.6.3 completely unusable for first-time +installations. This has been fixed. + +** minor bugs fixed + +The IRC bot had a bug wherein asking it to watch a certain builder (the "I'll +give a shout when the build finishes" message) would cause an exception, so +it would not, in fact, shout. The HTML page had an exception in the "change +sources" page (reached by following the "Changes" link at the top of the +column that shows the names of commiters). Re-loading the config file while +builders were already attached would result in a benign error message. The +server side of the PBListener status client had an exception when providing +information about a non-existent Build (e.g., when the client asks for the +Build that is currently running, and the server says "None"). + +These bugs have all been fixed. + +The unit tests now pass under python2.2; they were failing before because of +some 2.3isms that crept in. More unit tests which failed under windows now +pass, only one (test_webPathname_port) is still failing. + +** 'buildbot' tool looks for a .buildbot/options file + +The 'statusgui' and the 'debugclient' subcommands can both look for a +.buildbot/ directory, and an 'options' file therein, to extract default +values for the location of the buildmaster. This directory is searched in the +current directory, its parent, etc, all the way up to the filesystem root +(assuming you own the directories in question). It also look in ~/.buildbot/ +for this file. This feature allows you to put a .buildbot at the top of your +working tree, telling any 'buildbot' invocations you perform therein how to +get to the buildmaster associated with that tree's project. + +Windows users get something similar, using %APPDATA%/buildbot instead of +~/.buildbot . + +** windows ShellCommands are launched with 'cmd.exe' + +The buildslave has been modified to run all list-based ShellCommands by +prepending [os.environ['COMSPEC'], '/c'] to the argv list before execution. +This should allow the buildslave's PATH to be searched for commands, +improving the chances that it can run the same 'trial -o foo' commands as a +unix buildslave. The potential downside is that spaces in argv elements might +be re-parsed, or quotes might be re-interpreted. The consensus on the mailing +list was that this is a useful thing to do, but please report any problems +you encounter with it. + +** minor features + +The Waterfall display now shows the buildbot's home timezone at the top of +the timestamp column. The default favicon.ico is now much nicer-looking (it +is generated with Blender.. the icon.blend file is available in CVS in +docs/images/ should you care to play with it). + + * Release 0.6.3 (25 Apr 2005) ** 'buildbot' tool gets more uses From warner at users.sourceforge.net Thu Apr 28 07:34:31 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 28 Apr 2005 07:34:31 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.66,1.67 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv901/buildbot Modified Files: master.py Log Message: (BuildMaster.upgradeToVersion3): deal with broken .tap files from 0.6.3 by getting rid of .services, .namedServices, and .change_svc at load time. Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- master.py 27 Apr 2005 11:46:14 -0000 1.66 +++ master.py 28 Apr 2005 07:34:27 -0000 1.67 @@ -576,7 +576,7 @@ class BuildMaster(service.MultiService, styles.Versioned): debug = 0 - persistenceVersion = 2 + persistenceVersion = 3 manhole = None debugPassword = None projectName = "(unspecified)" @@ -642,6 +642,13 @@ del self.webUNIXPort self.configFileName = "master.cfg" + def upgradeToVersion3(self): + # post 0.6.3, solely to deal with the 0.6.3 breakage. Starting with + # 0.6.5 I intend to do away with .tap files altogether + self.services = [] + self.namedServices = {} + del self.change_svc + def startService(self): service.MultiService.startService(self) self.loadChanges() # must be done before loading the config file From warner at users.sourceforge.net Thu Apr 28 07:34:41 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 28 Apr 2005 07:34:41 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.403,1.404 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv901 Modified Files: ChangeLog Log Message: (BuildMaster.upgradeToVersion3): deal with broken .tap files from 0.6.3 by getting rid of .services, .namedServices, and .change_svc at load time. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.403 retrieving revision 1.404 diff -u -d -r1.403 -r1.404 --- ChangeLog 28 Apr 2005 00:51:01 -0000 1.403 +++ ChangeLog 28 Apr 2005 07:34:29 -0000 1.404 @@ -1,3 +1,9 @@ +2005-04-28 Brian Warner + + * buildbot/master.py (BuildMaster.upgradeToVersion3): deal with + broken .tap files from 0.6.3 by getting rid of .services, + .namedServices, and .change_svc at load time. + 2005-04-27 Brian Warner * NEWS: update in preparation for new release From warner at users.sourceforge.net Thu Apr 28 07:57:30 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 28 Apr 2005 07:57:30 +0000 Subject: [Buildbot-commits] buildbot/buildbot __init__.py,1.10,1.11 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14423/buildbot Modified Files: __init__.py Log Message: * buildbot/__init__.py (version): Releasing buildbot-0.6.4 * debian/changelog: update for 0.6.4 * README.w32: add a checklist of steps for getting buildbot running on windows. * MANIFEST.in: include it in the tarball * NEWS: update Index: __init__.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/__init__.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- __init__.py 26 Apr 2005 06:32:10 -0000 1.10 +++ __init__.py 28 Apr 2005 07:57:28 -0000 1.11 @@ -1,3 +1,3 @@ #! /usr/bin/python -version = "0.6.3+" +version = "0.6.4" From warner at users.sourceforge.net Thu Apr 28 07:57:30 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 28 Apr 2005 07:57:30 +0000 Subject: [Buildbot-commits] buildbot/debian changelog,1.5,1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14423/debian Modified Files: changelog Log Message: * buildbot/__init__.py (version): Releasing buildbot-0.6.4 * debian/changelog: update for 0.6.4 * README.w32: add a checklist of steps for getting buildbot running on windows. * MANIFEST.in: include it in the tarball * NEWS: update Index: changelog =================================================================== RCS file: /cvsroot/buildbot/buildbot/debian/changelog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- changelog 26 Apr 2005 03:10:33 -0000 1.5 +++ changelog 28 Apr 2005 07:57:27 -0000 1.6 @@ -1,3 +1,9 @@ +buildbot (0.6.4-1) unstable; urgency=low + + * New upstream release + + -- Brian Warner Thu, 28 Apr 2005 00:54:53 -0700 + buildbot (0.6.3-1) unstable; urgency=low * New upstream release From warner at users.sourceforge.net Thu Apr 28 07:57:31 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 28 Apr 2005 07:57:31 +0000 Subject: [Buildbot-commits] buildbot README.w32,NONE,1.1 NEWS,1.40,1.41 MANIFEST.in,1.16,1.17 ChangeLog,1.404,1.405 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14423 Modified Files: NEWS MANIFEST.in ChangeLog Added Files: README.w32 Log Message: * buildbot/__init__.py (version): Releasing buildbot-0.6.4 * debian/changelog: update for 0.6.4 * README.w32: add a checklist of steps for getting buildbot running on windows. * MANIFEST.in: include it in the tarball * NEWS: update Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.404 retrieving revision 1.405 diff -u -d -r1.404 -r1.405 --- ChangeLog 28 Apr 2005 07:34:29 -0000 1.404 +++ ChangeLog 28 Apr 2005 07:57:28 -0000 1.405 @@ -1,5 +1,17 @@ 2005-04-28 Brian Warner + * buildbot/__init__.py (version): Releasing buildbot-0.6.4 + + * debian/changelog: update for 0.6.4 + +2005-04-28 Brian Warner + + * README.w32: add a checklist of steps for getting buildbot + running on windows. + * MANIFEST.in: include it in the tarball + + * NEWS: update + * buildbot/master.py (BuildMaster.upgradeToVersion3): deal with broken .tap files from 0.6.3 by getting rid of .services, .namedServices, and .change_svc at load time. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- MANIFEST.in 26 Apr 2005 03:14:15 -0000 1.16 +++ MANIFEST.in 28 Apr 2005 07:57:28 -0000 1.17 @@ -1,5 +1,5 @@ -include ChangeLog MANIFEST.in README NEWS +include ChangeLog MANIFEST.in README README.w32 NEWS include docs/PyCon-2003/buildbot.html docs/PyCon-2003/stylesheet.css include docs/PyCon-2003/overview.png docs/PyCon-2003/slave.png include docs/PyCon-2003/waterfall.png Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- NEWS 28 Apr 2005 00:51:01 -0000 1.40 +++ NEWS 28 Apr 2005 07:57:28 -0000 1.41 @@ -1,6 +1,6 @@ User visible changes in Buildbot. -* Release 0.6.4 (XX) +* Release 0.6.4 (28 Apr 2005) ** major bugs fixed @@ -60,6 +60,7 @@ docs/images/ should you care to play with it). + * Release 0.6.3 (25 Apr 2005) ** 'buildbot' tool gets more uses --- NEW FILE: README.w32 --- Several users have reported success in running a buildslave under Windows. The following list of steps might help you accomplish the same. They are a list of what I did as a unix guy struggling to make a winXP box run the buildbot unit tests. When I was done, most of the unit tests passed. If you discover things that are missing or incorrect, please send your corrections to the buildbot-devel mailing list (archives and subscription information are available at http://buildbot.sourceforge.net). Many thanks to Mike "Bear" Taylor for developing this list. 0. Check to make sure your PATHEXT environment variable has ";.PY" in it -- if not set your global environment to include it. Control Panels / System / Advanced / Environment Variables / System variables 1. Install python -- 2.4 -- http://python.org * run win32 installer - no special options needed so far 2. install zope interface package -- 3.0.1final -- http://www.zope.org/Products/ZopeInterface * run win32 installer - it should auto-detect your python 2.4 installation 3. python for windows extensions -- build 203 -- http://pywin32.sourceforge.net/ * run win32 installer - it should auto-detect your python 2.4 installation the installer complains about a missing DLL. Download mfc71.dll from the site mentioned in the warning (http://starship.python.net/crew/mhammond/win32/) and move it into c:\Python24\DLLs 4. at this point, to preserve my own sanity, I grabbed cygwin.com's setup.exe and started it. It behaves a lot like dselect. I installed bash and other tools (but *not* python). I added C:\cygwin\bin to PATH, allowing me to use tar, md5sum, cvs, all the usual stuff. I also installed emacs, going from the notes at http://www.gnu.org/software/emacs/windows/ntemacs.html . Their FAQ at http://www.gnu.org/software/emacs/windows/faq3.html#install has a note on how to swap CapsLock and Control. I also modified PATH (in the same place as PATHEXT) to include C:\Python24 and C:\Python24\Scripts . This will allow 'python' and (eventually) 'trial' to work in a regular command shell. 5. twisted -- 2.0 -- http://twistedmatrix.com/projects/core/ * unpack tarball and run python setup.py install Note: if you want to test your setup - run: python c:\python24\Scripts\trial.py -o -R twisted (the -o will format the output for console and the "-R twisted" will recursively run all unit tests) I had to edit Twisted (core)'s setup.py, to make detectExtensions() return an empty list before running builder._compile_helper(). Apparently the test it uses to detect if the (optional) C modules can be compiled causes the install process to simply quit without actually installing anything. I installed several packages: core, Lore, Mail, Web, and Words. They all got copied to C:\Python24\Lib\site-packages\ At this point trial --version works, so 'trial -o -R twisted' will run the Twisted test suite. Note that this is not necessarily setting PYTHONPATH, so it may be running the test suite that was installed, not the one in the current directory. 6. I used CVS to grab a copy of the latest Buildbot sources. To run the tests, you must first add the buildbot directory to PYTHONPATH. Windows does not appear to have a Bourne-shell-style syntax to set a variable just for a single command, so you have to set it once and remember it will affect all commands for the lifetime of that shell session. set PYTHONPATH=. trial -o -r win32 buildbot.test To run against both buildbot-CVS and, say, Twisted-SVN, do: set PYTHONPATH=.;C:\path to\Twisted-SVN All commands are done using the normal cmd.exe command shell. As of buildbot-0.6.4, only one unit test fails (test_webPathname_port) when you run under the 'win32' reactor. (if you run under the default reactor, many of the child-process-spawning commands fail, but test_webPathname_port passes. go figure.) Actually setting up a buildslave is not yet covered by this document. Patches gladly accepted. -Brian From warner at users.sourceforge.net Thu Apr 28 08:21:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 28 Apr 2005 08:21:17 +0000 Subject: [Buildbot-commits] site ChangeLog,1.19,1.20 NEWS,1.5,1.6 index.html,1.38,1.39 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26270 Modified Files: ChangeLog NEWS index.html Log Message: update for 0.6.4 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/site/ChangeLog,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ChangeLog 26 Apr 2005 03:44:41 -0000 1.19 +++ ChangeLog 28 Apr 2005 08:21:10 -0000 1.20 @@ -1,3 +1,147 @@ +2005-04-28 Brian Warner + + * buildbot/__init__.py (version): Releasing buildbot-0.6.4 + + * debian/changelog: update for 0.6.4 + +2005-04-28 Brian Warner + + * README.w32: add a checklist of steps for getting buildbot + running on windows. + * MANIFEST.in: include it in the tarball + + * NEWS: update + + * buildbot/master.py (BuildMaster.upgradeToVersion3): deal with + broken .tap files from 0.6.3 by getting rid of .services, + .namedServices, and .change_svc at load time. + +2005-04-27 Brian Warner + + * NEWS: update in preparation for new release + + * buildbot/test/test_config.py (Save.testSave): don't pull in + twisted.scripts.twistd, we don't need it and it isn't for windows + anyway. + + * buildbot/changes/changes.py (ChangeMaster.saveYourself): + accomodate win32 which can't do atomic-rename + +2005-04-27 Brian Warner + + * buildbot/test/test_run.py (Disconnect.testBuild2): crank up some + timeouts to help the slow metabuildbot not flunk them so much + (Disconnect.testBuild3): same + (Disconnect.testBuild4): same + (Disconnect.testInterrupt): same + + * buildbot/master.py (BuildMaster.loadChanges): fix change_svc + setup, it was completely broken for new buildmasters (those which + did not have a 'change.pck' already saved. Thanks to Paul Warren + for catching this (embarrassing!) bug. + (Dispatcher.__getstate__): don't save our registered avatar + factories, since they'll be re-populated when the config file is + re-read. + (BuildMaster.__init__): add a dummy ChangeMaster, used only by + tests (since the real mktap-generated BuildMaster doesn't save + this attribute). + (BuildMaster.__getstate__): don't save any service children, + they'll all be re-populated when the config file is re-read. + * buildbot/test/test_config.py (Save.testSave): test for this + +2005-04-26 Brian Warner + + * buildbot/buildbot.png: use a new, smaller (16x16) icon image, + rendered with Blender.. looks a bit nicer. + * buildbot/docs/images/icon.blend: add the Blender file for it + + * buildbot/slave/commands.py (ShellCommand._startCommand): prepend + 'cmd.exe' (or rather os.environ['COMSPEC']) to the argv list when + running under windows. This appears to be the best way to allow + BuildSteps to do something normal like 'trial -v buildbot.test' or + 'make foo' and still expect it to work. The idea is to make the + BuildSteps look as much like what a developer would type when + compiling or testing the tree by hand. This approach probably has + problems when there are spaces in the arguments, so if you've got + windows buildslaves, you'll need to pay close attention to your + commands. + + * buildbot/status/html.py (WaterfallStatusResource.body): add the + timezone to the timestamp column. + * buildbot/test/test_web.py (WebTest.test_waterfall): test it + + * buildbot/scripts/runner.py (loadOptions): do something sane for + windows, I think. We use %APPDATA%/buildbot instead of + ~/.buildbot, but we still search everywhere from the current + directory up to the root for a .buildbot/ subdir. The "is it under + $HOME" security test was replaced with "is it owned by the current + user", which is only performed under posix. + * buildbot/test/test_runner.py (Options.testFindOptions): update + tests to match. The "is it owned by the current user" check is + untested. The test has been re-enabled for windows. + + * buildbot/test/test_slavecommand.py (Shell.checkOutput): replace + any "\n" in the expected output with the platform-specific line + separator. Make this separator "\r\n" on PTYs under unix, they + seem to do that and I don't know why + + * buildbot/test/test_runner.py (Options.optionsFile): disable on + windows for now, I don't know what ~/.buildbot/ should mean there. + + * buildbot/test/test_run.py (BuilderNames.testGetBuilderNames): + win32 compatibility, don't use "/tmp" + (Basedir.testChangeBuilddir): remove more unixisms + +2005-04-26 Brian Warner + + * buildbot/test/test_control.py (Force.rmtree): python2.2 + compatibility, apparently its shutil.rmtree ignore_errors= + argument is ignored. + * buildbot/test/test_run.py (Run.rmtree): same + (RunMixin.setUp): same + + * buildbot/test/test_runner.py (make): python2.2 has os.sep but + not os.path.sep + + * buildbot/test/test_twisted.py (Parse.failUnlessIn): 2.2 has no + 'substring in string' operator, must use string.find(substr)!=-1 + * buildbot/test/test_vc.py (Patch.failUnlessIn): same + * buildbot/test/test_web.py (WebTest.failUnlessIn): same + + * buildbot/scripts/runner.py (loadOptions): add code to search for + ~/.buildbot/, a directory with things like 'options', containing + defaults for various 'buildbot' subcommands. .buildbot/ can be in + the current directory, your $HOME directory, or anywhere + inbetween, as long as you're somewhere inside your home directory. + (debugclient): look in ~/.buildbot/options for master and passwd + (statuslog): look in ~/.buildbot/options for 'masterstatus' + * buildbot/test/test_runner.py (Options.testFindOptions): test it + + * buildbot/status/client.py (makeRemote): new approach to making + IRemote(None) be None, which works under Twisted-2.0 + * buildbot/test/test_status.py (Client.testAdaptation): test it + + * buildbot/status/builder.py (Status.builderAdded): when loading a + pickled BuilderStatus in from disk, set its name after loading. + The config file might have changed its name (but not its + directory) while it wasn't looking. + + * buildbot/process/builder.py (Builder.attached): always return a + Deferred, even if the builder was already attached + * buildbot/test/test_run.py (Basedir.testChangeBuilddir): test it + +2005-04-25 Brian Warner + + * buildbot/status/words.py (IrcStatusBot.buildFinished): fix a + category-related exception when announcing a build has finished + + * buildbot/status/html.py (StatusResourceChanges.body): oops, don't + reference no-longer-existent changemaster.sources + * buildbot/test/test_web.py (WebTest.test_waterfall): test for it + + * buildbot/__init__.py (version): bump to 0.6.3+ while between + releases + 2005-04-25 Brian Warner * buildbot/__init__.py (version): Releasing buildbot-0.6.3 Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/site/NEWS,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- NEWS 26 Apr 2005 03:44:41 -0000 1.5 +++ NEWS 28 Apr 2005 08:21:13 -0000 1.6 @@ -1,5 +1,66 @@ User visible changes in Buildbot. +* Release 0.6.4 (28 Apr 2005) + +** major bugs fixed + +The 'buildbot' tool in 0.6.3, when used to create a new buildmaster, failed +unless it found a 'changes.pck' file. As this file is created by a running +buildmaster, this made 0.6.3 completely unusable for first-time +installations. This has been fixed. + +** minor bugs fixed + +The IRC bot had a bug wherein asking it to watch a certain builder (the "I'll +give a shout when the build finishes" message) would cause an exception, so +it would not, in fact, shout. The HTML page had an exception in the "change +sources" page (reached by following the "Changes" link at the top of the +column that shows the names of commiters). Re-loading the config file while +builders were already attached would result in a benign error message. The +server side of the PBListener status client had an exception when providing +information about a non-existent Build (e.g., when the client asks for the +Build that is currently running, and the server says "None"). + +These bugs have all been fixed. + +The unit tests now pass under python2.2; they were failing before because of +some 2.3isms that crept in. More unit tests which failed under windows now +pass, only one (test_webPathname_port) is still failing. + +** 'buildbot' tool looks for a .buildbot/options file + +The 'statusgui' and the 'debugclient' subcommands can both look for a +.buildbot/ directory, and an 'options' file therein, to extract default +values for the location of the buildmaster. This directory is searched in the +current directory, its parent, etc, all the way up to the filesystem root +(assuming you own the directories in question). It also look in ~/.buildbot/ +for this file. This feature allows you to put a .buildbot at the top of your +working tree, telling any 'buildbot' invocations you perform therein how to +get to the buildmaster associated with that tree's project. + +Windows users get something similar, using %APPDATA%/buildbot instead of +~/.buildbot . + +** windows ShellCommands are launched with 'cmd.exe' + +The buildslave has been modified to run all list-based ShellCommands by +prepending [os.environ['COMSPEC'], '/c'] to the argv list before execution. +This should allow the buildslave's PATH to be searched for commands, +improving the chances that it can run the same 'trial -o foo' commands as a +unix buildslave. The potential downside is that spaces in argv elements might +be re-parsed, or quotes might be re-interpreted. The consensus on the mailing +list was that this is a useful thing to do, but please report any problems +you encounter with it. + +** minor features + +The Waterfall display now shows the buildbot's home timezone at the top of +the timestamp column. The default favicon.ico is now much nicer-looking (it +is generated with Blender.. the icon.blend file is available in CVS in +docs/images/ should you care to play with it). + + + * Release 0.6.3 (25 Apr 2005) ** 'buildbot' tool gets more uses Index: index.html =================================================================== RCS file: /cvsroot/buildbot/site/index.html,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- index.html 26 Apr 2005 09:08:58 -0000 1.38 +++ index.html 28 Apr 2005 08:21:13 -0000 1.39 @@ -11,7 +11,7 @@ Current contents:
      -
    • The current release is buildbot-0.6.3 . You can download the source +
    • The current release is buildbot-0.6.4 . You can download the source from the sf.net download page here. The release is signed with my GPG public key, available -Last modified: Tue Apr 26 01:53:46 PDT 2005 +Last modified: Thu Apr 28 01:19:22 PDT 2005