From warner at users.sourceforge.net Sat Apr 14 23:41:03 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 14 Apr 2007 23:41:03 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status mail.py,1.32,1.33 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15280/buildbot/status Modified Files: mail.py Log Message: [project @ MailNotifier: add the project name to the subject line and message body. Thanks to Benoit Sigoure for the patch.] Original author: warner at lothar.com Date: 2007-04-14 02:15:57 Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- mail.py 5 Feb 2007 18:47:22 -0000 1.32 +++ mail.py 14 Apr 2007 23:41:01 -0000 1.33 @@ -61,7 +61,7 @@ def __init__(self, fromaddr, mode="all", categories=None, builders=None, addLogs=False, relayhost="localhost", - subject="buildbot %(result)s in %(builder)s", + subject="buildbot %(result)s in %(projectName)s on %(builder)s", lookup=None, extraRecipients=[], sendToInterestedUsers=True): """ @@ -214,13 +214,15 @@ return self.buildMessage(name, build, results) def buildMessage(self, name, build, results): + projectName = self.status.getProjectName() text = "" if self.mode == "all": - text += "The Buildbot has finished a build of %s.\n" % name + text += "The Buildbot has finished a build" elif self.mode == "failing": - text += "The Buildbot has detected a failed build of %s.\n" % name + text += "The Buildbot has detected a failed build" else: - text += "The Buildbot has detected a new failure of %s.\n" % name + text += "The Buildbot has detected a new failure" + text += " of %s on %s.\n" % (name, projectName) buildurl = self.status.getURLForThing(build) if buildurl: text += "Full details are available at:\n %s\n" % buildurl @@ -304,6 +306,7 @@ m['Date'] = formatdate(localtime=True) m['Subject'] = self.subject % { 'result': res, + 'projectName': projectName, 'builder': name, } m['From'] = self.fromaddr From warner at users.sourceforge.net Sat Apr 14 23:41:03 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 14 Apr 2007 23:41:03 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.848,1.849 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15280 Modified Files: ChangeLog Log Message: [project @ MailNotifier: add the project name to the subject line and message body. Thanks to Benoit Sigoure for the patch.] Original author: warner at lothar.com Date: 2007-04-14 02:15:57 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.848 retrieving revision 1.849 diff -u -d -r1.848 -r1.849 --- ChangeLog 24 Mar 2007 18:40:23 -0000 1.848 +++ ChangeLog 14 Apr 2007 23:41:01 -0000 1.849 @@ -1,3 +1,11 @@ +2007-04-13 Brian Warner + + * buildbot/status/mail.py (MailNotifier): add the project name to + the subject line and message body, to make it easier to + distinguish email coming from different buildmasters. Thanks to + Benoit Sigoure for the patch. + * buildbot/test/test_status.py (Mail): update to match + 2007-03-24 Brian Warner * buildbot/steps/transfer.py: open all files in 'b' binary mode to From warner at users.sourceforge.net Sat Apr 14 23:41:03 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 14 Apr 2007 23:41:03 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_status.py, 1.38, 1.39 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15280/buildbot/test Modified Files: test_status.py Log Message: [project @ MailNotifier: add the project name to the subject line and message body. Thanks to Benoit Sigoure for the patch.] Original author: warner at lothar.com Date: 2007-04-14 02:15:57 Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- test_status.py 11 Dec 2006 09:06:36 -0000 1.38 +++ test_status.py 14 Apr 2007 23:41:01 -0000 1.39 @@ -135,7 +135,11 @@ return MyBuild(self.builder, number, results) def failUnlessIn(self, substring, string): - self.failUnless(string.find(substring) != -1) + self.failUnless(string.find(substring) != -1, + "didn't see '%s' in '%s'" % (substring, string)) + + def getProjectName(self): + return "PROJECT" def getBuildbotURL(self): return "BUILDBOT_URL" @@ -162,7 +166,7 @@ self.failUnlessIn("To: bob at dev.com, recip2 at example.com, " "recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot success in builder1\n", t) + self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t) self.failUnlessIn("Date: ", t) self.failUnlessIn("Build succeeded!\n", t) self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t) @@ -187,7 +191,7 @@ self.failUnlessIn("To: recip2 at example.com, " "recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot success in builder1\n", t) + self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t) self.failUnlessIn("Build succeeded!\n", t) self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t) @@ -288,7 +292,7 @@ self.failUnlessIn("To: dev3 at dev.com, dev4 at dev.com, " "recip2 at example.com, recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot failure in builder1\n", t) + self.failUnlessIn("Subject: buildbot failure in PROJECT on builder1\n", t) self.failUnlessIn("The Buildbot has detected a new failure", t) self.failUnlessIn("BUILD FAILED: snarkleack polarization failed\n", t) self.failUnlessEqual(r, ["dev3 at dev.com", "dev4 at dev.com", @@ -314,7 +318,7 @@ self.failUnless(len(self.messages) == 1) m,r = self.messages.pop() t = m.as_string() - self.failUnlessIn("Subject: buildbot warnings in builder1\n", t) + self.failUnlessIn("Subject: buildbot warnings in PROJECT on builder1\n", t) m2 = email.message_from_string(t) p = m2.get_payload() self.failUnlessEqual(len(p), 3) From warner at users.sourceforge.net Sun Apr 15 01:28:48 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 Apr 2007 01:28:48 +0000 Subject: [Buildbot-commits] buildbot/buildbot interfaces.py,1.51,1.52 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24911/buildbot Modified Files: interfaces.py Log Message: [project @ web-parts: start rearranging web status files] Original author: warner at lothar.com Date: 2007-02-27 20:33:22+00:00 Index: interfaces.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- interfaces.py 1 Mar 2007 09:06:15 -0000 1.51 +++ interfaces.py 15 Apr 2007 01:28:46 -0000 1.52 @@ -111,8 +111,7 @@ 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. Raises - KeyError if there is no Builder by that name.""" + """Return the IBuilderStatus object for a given named Builder.""" def getSlave(name): """Return the ISlaveStatus object for a given named buildslave.""" From warner at users.sourceforge.net Sun Apr 15 01:28:48 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 Apr 2007 01:28:48 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes p4poller.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24911/buildbot/changes Modified Files: p4poller.py Log Message: [project @ web-parts: start rearranging web status files] Original author: warner at lothar.com Date: 2007-02-27 20:33:22+00:00 Index: p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/p4poller.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- p4poller.py 28 Feb 2007 06:27:49 -0000 1.9 +++ p4poller.py 15 Apr 2007 01:28:46 -0000 1.10 @@ -28,7 +28,7 @@ them to the change master.""" compare_attrs = ["p4port", "p4user", "p4passwd", "p4base", - "p4bin", "pollinterval"] + "p4bin", "pollinterval", "histmax"] changes_line_re = re.compile( r"Change (?P\d+) on \S+ by \S+@\S+ '.+'$") @@ -45,7 +45,7 @@ def __init__(self, p4port=None, p4user=None, p4passwd=None, p4base='//', p4bin='p4', split_file=lambda branchfile: (None, branchfile), - pollinterval=60 * 10, histmax=None): + pollinterval=60 * 10, histmax=100): """ @type p4port: string @param p4port: p4 port definition (host:portno) @@ -63,8 +63,7 @@ @type pollinterval: int @param pollinterval: interval in seconds between polls @type histmax: int - @param histmax: (obsolete) maximum number of changes to look back through. - ignored; accepted for backwards compatibility. + @param histmax: maximum number of changes to look back through """ self.p4port = p4port @@ -74,6 +73,7 @@ self.p4bin = p4bin self.split_file = split_file self.pollinterval = pollinterval + self.histmax = histmax self.loop = LoopingCall(self.checkp4) def startService(self): @@ -121,11 +121,7 @@ args.extend(['-u', self.p4user]) if self.p4passwd: args.extend(['-P', self.p4passwd]) - args.extend(['changes']) - if self.last_change is not None: - args.extend(['%s...@%d,now' % (self.p4base, self.last_change+1)]) - else: - args.extend(['-m', '1', '%s...' % (self.p4base,)]) + args.extend(['changes', '-m', str(self.histmax), self.p4base + '...']) env = {} return getProcessOutput(self.p4bin, args, env) @@ -137,11 +133,13 @@ if not line: continue m = self.changes_line_re.match(line) assert m, "Unexpected 'p4 changes' output: %r" % result - num = int(m.group('num')) + num = m.group('num') if last_change is None: - log.msg('P4Poller: starting at change %d' % num) + log.msg('P4Poller: starting at change %s' % num) self.last_change = num return [] + if last_change == num: + break changelists.append(num) changelists.reverse() # oldest first @@ -160,7 +158,7 @@ args.extend(['-u', self.p4user]) if self.p4passwd: args.extend(['-P', self.p4passwd]) - args.extend(['describe', '-s', str(num)]) + args.extend(['describe', '-s', num]) env = {} d = getProcessOutput(self.p4bin, args, env) return d From warner at users.sourceforge.net Sun Apr 15 01:28:48 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 Apr 2007 01:28:48 +0000 Subject: [Buildbot-commits] buildbot ChangeLog, 1.849, 1.850 MANIFEST.in, 1.24, 1.25 setup.py, 1.42, 1.43 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24911 Modified Files: ChangeLog MANIFEST.in setup.py Log Message: [project @ web-parts: start rearranging web status files] Original author: warner at lothar.com Date: 2007-02-27 20:33:22+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.849 retrieving revision 1.850 diff -u -d -r1.849 -r1.850 --- ChangeLog 14 Apr 2007 23:41:01 -0000 1.849 +++ ChangeLog 15 Apr 2007 01:28:46 -0000 1.850 @@ -1,44 +1,3 @@ -2007-04-13 Brian Warner - - * buildbot/status/mail.py (MailNotifier): add the project name to - the subject line and message body, to make it easier to - distinguish email coming from different buildmasters. Thanks to - Benoit Sigoure for the patch. - * buildbot/test/test_status.py (Mail): update to match - -2007-03-24 Brian Warner - - * buildbot/steps/transfer.py: open all files in 'b' binary mode to - avoid text-conversion problems between DOS/windows and unix. - Thanks to Phil Thompson for the patch. Fixes SF#1674927. - -2007-03-03 Brian Warner - - * buildbot/status/html.py (_hush_pyflakes): hush a pyflakes - warning about the use of Waterfall here - -2007-03-01 Brian Warner - - * buildbot/interfaces.py (IStatus.getBuilder): mention exceptions - -2007-02-28 Brian Warner - - * buildbot/changes/p4poller.py (P4Source): apply change from Scott - Lamb to use a more optimal form of 'p4 changes', to reduce server - load. He reports that this optimization was added to p4d release - 2005.2, but it should work in all versions. Closes #27. - * buildbot/test/test_p4poller.py: match it - -2007-02-27 Brian Warner - - * buildbot/status/web/*.py: move all web status stuff into a - separate directory, in anticipation of splitting it into smaller - pieces and adding more files. html.py was getting way too big. - * buildbot/status/classic.css: move it too - * setup.py: add the new sub-package - * buildbot/test/test_web.py: match the changes - * MANIFEST.in: handle the move of classic.css - 2007-02-07 Brian Warner * contrib/OS-X/*: add some launchd .plist files for automatically Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- MANIFEST.in 27 Feb 2007 23:07:24 -0000 1.24 +++ MANIFEST.in 15 Apr 2007 01:28:46 -0000 1.25 @@ -7,7 +7,7 @@ include docs/epyrun docs/gen-reference include buildbot/test/mail/* buildbot/test/subdir/* include buildbot/scripts/sample.cfg -include buildbot/status/web/classic.css +include buildbot/status/classic.css include buildbot/clients/debug.glade include buildbot/buildbot.png Index: setup.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/setup.py,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- setup.py 27 Feb 2007 23:07:16 -0000 1.42 +++ setup.py 15 Apr 2007 01:28:46 -0000 1.43 @@ -64,7 +64,7 @@ ], packages=["buildbot", - "buildbot.status", "buildbot.status.web", + "buildbot.status", "buildbot.changes", "buildbot.steps", "buildbot.process", @@ -75,7 +75,7 @@ ], data_files=[("buildbot", ["buildbot/buildbot.png"]), ("buildbot/clients", ["buildbot/clients/debug.glade"]), - ("buildbot/status/web", ["buildbot/status/web/classic.css"]), + ("buildbot/status", ["buildbot/status/classic.css"]), ("buildbot/scripts", ["buildbot/scripts/sample.cfg"]), ("buildbot/test/mail", testmsgs), ("buildbot/test/subdir", ["buildbot/test/subdir/emit.py"]), From warner at users.sourceforge.net Sun Apr 15 01:28:49 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 Apr 2007 01:28:49 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.78,1.79 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24911/buildbot/slave Modified Files: commands.py Log Message: [project @ web-parts: start rearranging web status files] Original author: warner at lothar.com Date: 2007-02-27 20:33:22+00:00 Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- commands.py 24 Mar 2007 18:40:23 -0000 1.78 +++ commands.py 15 Apr 2007 01:28:46 -0000 1.79 @@ -701,7 +701,7 @@ self.workdir, os.path.expanduser(self.filename)) try: - self.fp = open(self.path, 'rb') + self.fp = open(self.path, 'r') if self.debug: log.msg('Opened %r for upload' % self.path) except: @@ -813,7 +813,7 @@ self.workdir, os.path.expanduser(self.filename)) try: - self.fp = open(self.path, 'wb') + self.fp = open(self.path, 'w') if self.debug: log.msg('Opened %r for download' % self.path) if self.mode is not None: From warner at users.sourceforge.net Sun Apr 15 01:28:49 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 Apr 2007 01:28:49 +0000 Subject: [Buildbot-commits] buildbot/buildbot/steps transfer.py,1.8,1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/steps In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24911/buildbot/steps Modified Files: transfer.py Log Message: [project @ web-parts: start rearranging web status files] Original author: warner at lothar.com Date: 2007-02-27 20:33:22+00:00 Index: transfer.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/transfer.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- transfer.py 24 Mar 2007 18:40:23 -0000 1.8 +++ transfer.py 15 Apr 2007 01:28:47 -0000 1.9 @@ -16,7 +16,7 @@ def __init__(self, destfile, maxsize, mode): self.destfile = destfile - self.fp = open(destfile, "wb") + self.fp = open(destfile, "w") if mode is not None: os.chmod(destfile, mode) self.remaining = maxsize @@ -240,7 +240,7 @@ # setup structures for reading the file try: - fp = open(source, 'rb') + fp = open(source, 'r') except IOError: # if file does not exist, bail out with an error self.addCompleteLog('stderr', From warner at users.sourceforge.net Sun Apr 15 01:28:49 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 Apr 2007 01:28:49 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py, 1.98, 1.99 mail.py, 1.33, 1.34 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24911/buildbot/status Modified Files: html.py mail.py Log Message: [project @ web-parts: start rearranging web status files] Original author: warner at lothar.com Date: 2007-02-27 20:33:22+00:00 Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- html.py 4 Mar 2007 07:32:47 -0000 1.98 +++ html.py 15 Apr 2007 01:28:47 -0000 1.99 @@ -1,7 +1,1731 @@ -#! /usr/bin/python +# -*- test-case-name: buildbot.test.test_web -*- -# compatibility wrapper. This is currently the preferred place for master.cfg -# to import from. +from __future__ import generators -from buildbot.status.web.waterfall import Waterfall -_hush_pyflakes = [Waterfall] +from twisted.python import log, components +import urllib, re [...1705 lines suppressed...] + def setup(self): + status = self.parent.getStatus() + if self.allowForce: + control = interfaces.IControl(self.parent) + else: + control = None + change_svc = self.parent.change_svc + sr = StatusResource(status, control, change_svc, self.categories, + self.css) + sr.favicon = self.favicon + sr.robots_txt = self.robots_txt + self.site = server.Site(sr) + + if self.http_port is not None: + s = strports.service(self.http_port, self.site) + s.setServiceParent(self) + if self.distrib_port is not None: + f = pb.PBServerFactory(distrib.ResourcePublisher(self.site)) + s = strports.service(self.distrib_port, f) + s.setServiceParent(self) Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- mail.py 14 Apr 2007 23:41:01 -0000 1.33 +++ mail.py 15 Apr 2007 01:28:47 -0000 1.34 @@ -61,7 +61,7 @@ def __init__(self, fromaddr, mode="all", categories=None, builders=None, addLogs=False, relayhost="localhost", - subject="buildbot %(result)s in %(projectName)s on %(builder)s", + subject="buildbot %(result)s in %(builder)s", lookup=None, extraRecipients=[], sendToInterestedUsers=True): """ @@ -214,15 +214,13 @@ return self.buildMessage(name, build, results) def buildMessage(self, name, build, results): - projectName = self.status.getProjectName() text = "" if self.mode == "all": - text += "The Buildbot has finished a build" + text += "The Buildbot has finished a build of %s.\n" % name elif self.mode == "failing": - text += "The Buildbot has detected a failed build" + text += "The Buildbot has detected a failed build of %s.\n" % name else: - text += "The Buildbot has detected a new failure" - text += " of %s on %s.\n" % (name, projectName) + text += "The Buildbot has detected a new failure of %s.\n" % name buildurl = self.status.getURLForThing(build) if buildurl: text += "Full details are available at:\n %s\n" % buildurl @@ -306,7 +304,6 @@ m['Date'] = formatdate(localtime=True) m['Subject'] = self.subject % { 'result': res, - 'projectName': projectName, 'builder': name, } m['From'] = self.fromaddr From warner at users.sourceforge.net Sun Apr 15 01:28:49 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 Apr 2007 01:28:49 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_p4poller.py, 1.5, 1.6 test_status.py, 1.39, 1.40 test_web.py, 1.41, 1.42 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24911/buildbot/test Modified Files: test_p4poller.py test_status.py test_web.py Log Message: [project @ web-parts: start rearranging web status files] Original author: warner at lothar.com Date: 2007-02-27 20:33:22+00:00 Index: test_p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_p4poller.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- test_p4poller.py 28 Feb 2007 06:27:50 -0000 1.5 +++ test_p4poller.py 15 Apr 2007 01:28:47 -0000 1.6 @@ -38,20 +38,20 @@ """ p4change = { - 3: change_3_log + + '3': change_3_log + """Affected files ... ... //depot/myproject/branch_b/branch_b_file#1 add ... //depot/myproject/branch_b/whatbranch#1 branch ... //depot/myproject/branch_c/whatbranch#1 branch """, - 2: change_2_log + + '2': change_2_log + """Affected files ... ... //depot/myproject/trunk/whatbranch#1 add ... //depot/otherproject/trunk/something#1 add """, - 5: change_4_log + + '5': change_4_log + """Affected files ... ... //depot/myproject/branch_b/branch_b_file#1 add @@ -108,14 +108,14 @@ def _testCheck2(self, res): self.assertEquals(self.changes, []) - self.assertEquals(self.t.last_change, 1) + self.assertEquals(self.t.last_change, '1') # Subsequent times, it returns Change objects for new changes. return self.t.checkp4().addCallback(self._testCheck3) def _testCheck3(self, res): self.assertEquals(len(self.changes), 3) - self.assertEquals(self.t.last_change, 3) + self.assertEquals(self.t.last_change, '3') self.assert_(not self.t.working) # They're supposed to go oldest to newest, so this one must be first. @@ -170,7 +170,7 @@ def testFailedDescribe(self): """'p4 describe' failure is properly reported""" c = dict(p4change) - c[3] = 'Perforce client error:\n...' + c['3'] = 'Perforce client error:\n...' self.t = MockP4Source(p4changes=[first_p4changes, second_p4changes], p4change=c, p4port=None, p4user=None) self.t.parent = self @@ -186,7 +186,7 @@ self.assert_(isinstance(f, failure.Failure)) self.failUnlessIn('Perforce client error', str(f)) self.assert_(not self.t.working) - self.assertEquals(self.t.last_change, 2) + self.assertEquals(self.t.last_change, '2') def testAlreadyWorking(self): """don't launch a new poll while old is still going""" @@ -213,4 +213,4 @@ def _testSplitFile(self, res): self.assertEquals(len(self.changes), 2) - self.assertEquals(self.t.last_change, 5) + self.assertEquals(self.t.last_change, '5') Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- test_status.py 14 Apr 2007 23:41:01 -0000 1.39 +++ test_status.py 15 Apr 2007 01:28:47 -0000 1.40 @@ -135,11 +135,7 @@ return MyBuild(self.builder, number, results) def failUnlessIn(self, substring, string): - self.failUnless(string.find(substring) != -1, - "didn't see '%s' in '%s'" % (substring, string)) - - def getProjectName(self): - return "PROJECT" + self.failUnless(string.find(substring) != -1) def getBuildbotURL(self): return "BUILDBOT_URL" @@ -166,7 +162,7 @@ self.failUnlessIn("To: bob at dev.com, recip2 at example.com, " "recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t) + self.failUnlessIn("Subject: buildbot success in builder1\n", t) self.failUnlessIn("Date: ", t) self.failUnlessIn("Build succeeded!\n", t) self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t) @@ -191,7 +187,7 @@ self.failUnlessIn("To: recip2 at example.com, " "recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t) + self.failUnlessIn("Subject: buildbot success in builder1\n", t) self.failUnlessIn("Build succeeded!\n", t) self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t) @@ -292,7 +288,7 @@ self.failUnlessIn("To: dev3 at dev.com, dev4 at dev.com, " "recip2 at example.com, recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot failure in PROJECT on builder1\n", t) + self.failUnlessIn("Subject: buildbot failure in builder1\n", t) self.failUnlessIn("The Buildbot has detected a new failure", t) self.failUnlessIn("BUILD FAILED: snarkleack polarization failed\n", t) self.failUnlessEqual(r, ["dev3 at dev.com", "dev4 at dev.com", @@ -318,7 +314,7 @@ self.failUnless(len(self.messages) == 1) m,r = self.messages.pop() t = m.as_string() - self.failUnlessIn("Subject: buildbot warnings in PROJECT on builder1\n", t) + self.failUnlessIn("Subject: buildbot warnings in builder1\n", t) m2 = email.message_from_string(t) p = m2.get_payload() self.failUnlessEqual(len(p), 3) Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- test_web.py 27 Feb 2007 23:07:16 -0000 1.41 +++ test_web.py 15 Apr 2007 01:28:47 -0000 1.42 @@ -12,7 +12,6 @@ from buildbot import master, interfaces, sourcestamp from buildbot.status import html, builder -from buildbot.status.web import waterfall from buildbot.changes.changes import Change from buildbot.process import base from buildbot.process.buildstep import BuildStep @@ -231,7 +230,7 @@ d.addCallback(self._test_waterfall_3) return d def _test_waterfall_3(self, icon): - expected = open(waterfall.buildbot_icon,"rb").read() + expected = open(html.buildbot_icon,"rb").read() self.failUnless(icon == expected) d = client.getPage("http://localhost:%d/changes" % self.port) @@ -265,7 +264,7 @@ s = setupBuildStepStatus("test_web.test_urls") s.addURL("coverage", "http://coverage.example.org/target") s.addURL("icon", "http://coverage.example.org/icon.png") - box = waterfall.IBox(s).getBox() + box = html.IBox(s).getBox() td = box.td() e1 = '[coverage]' self.failUnlessSubstring(e1, td) From warner at users.sourceforge.net Tue Apr 17 06:38:52 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 Apr 2007 06:38:52 +0000 Subject: [Buildbot-commits] buildbot ChangeLog, 1.850, 1.851 MANIFEST.in, 1.25, 1.26 setup.py, 1.43, 1.44 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7812 Modified Files: ChangeLog MANIFEST.in setup.py Log Message: [project @ update CREDITS] Original author: warner at lothar.com Date: 2007-04-17 06:38:12+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.850 retrieving revision 1.851 diff -u -d -r1.850 -r1.851 --- ChangeLog 15 Apr 2007 01:28:46 -0000 1.850 +++ ChangeLog 17 Apr 2007 06:38:49 -0000 1.851 @@ -1,3 +1,44 @@ +2007-04-13 Brian Warner + + * buildbot/status/mail.py (MailNotifier): add the project name to + the subject line and message body, to make it easier to + distinguish email coming from different buildmasters. Thanks to + Benoit Sigoure for the patch. + * buildbot/test/test_status.py (Mail): update to match + +2007-03-24 Brian Warner + + * buildbot/steps/transfer.py: open all files in 'b' binary mode to + avoid text-conversion problems between DOS/windows and unix. + Thanks to Phil Thompson for the patch. Fixes SF#1674927. + +2007-03-03 Brian Warner + + * buildbot/status/html.py (_hush_pyflakes): hush a pyflakes + warning about the use of Waterfall here + +2007-03-01 Brian Warner + + * buildbot/interfaces.py (IStatus.getBuilder): mention exceptions + +2007-02-28 Brian Warner + + * buildbot/changes/p4poller.py (P4Source): apply change from Scott + Lamb to use a more optimal form of 'p4 changes', to reduce server + load. He reports that this optimization was added to p4d release + 2005.2, but it should work in all versions. Closes #27. + * buildbot/test/test_p4poller.py: match it + +2007-02-27 Brian Warner + + * buildbot/status/web/*.py: move all web status stuff into a + separate directory, in anticipation of splitting it into smaller + pieces and adding more files. html.py was getting way too big. + * buildbot/status/classic.css: move it too + * setup.py: add the new sub-package + * buildbot/test/test_web.py: match the changes + * MANIFEST.in: handle the move of classic.css + 2007-02-07 Brian Warner * contrib/OS-X/*: add some launchd .plist files for automatically Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- MANIFEST.in 15 Apr 2007 01:28:46 -0000 1.25 +++ MANIFEST.in 17 Apr 2007 06:38:49 -0000 1.26 @@ -7,7 +7,7 @@ include docs/epyrun docs/gen-reference include buildbot/test/mail/* buildbot/test/subdir/* include buildbot/scripts/sample.cfg -include buildbot/status/classic.css +include buildbot/status/web/classic.css include buildbot/clients/debug.glade include buildbot/buildbot.png Index: setup.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/setup.py,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- setup.py 15 Apr 2007 01:28:46 -0000 1.43 +++ setup.py 17 Apr 2007 06:38:49 -0000 1.44 @@ -64,7 +64,7 @@ ], packages=["buildbot", - "buildbot.status", + "buildbot.status", "buildbot.status.web", "buildbot.changes", "buildbot.steps", "buildbot.process", @@ -75,7 +75,7 @@ ], data_files=[("buildbot", ["buildbot/buildbot.png"]), ("buildbot/clients", ["buildbot/clients/debug.glade"]), - ("buildbot/status", ["buildbot/status/classic.css"]), + ("buildbot/status/web", ["buildbot/status/web/classic.css"]), ("buildbot/scripts", ["buildbot/scripts/sample.cfg"]), ("buildbot/test/mail", testmsgs), ("buildbot/test/subdir", ["buildbot/test/subdir/emit.py"]), From warner at users.sourceforge.net Tue Apr 17 06:38:52 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 Apr 2007 06:38:52 +0000 Subject: [Buildbot-commits] buildbot/buildbot interfaces.py,1.52,1.53 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7812/buildbot Modified Files: interfaces.py Log Message: [project @ update CREDITS] Original author: warner at lothar.com Date: 2007-04-17 06:38:12+00:00 Index: interfaces.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- interfaces.py 15 Apr 2007 01:28:46 -0000 1.52 +++ interfaces.py 17 Apr 2007 06:38:50 -0000 1.53 @@ -111,7 +111,8 @@ 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.""" + """Return the IBuilderStatus object for a given named Builder. Raises + KeyError if there is no Builder by that name.""" def getSlave(name): """Return the ISlaveStatus object for a given named buildslave.""" From warner at users.sourceforge.net Tue Apr 17 06:38:53 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 Apr 2007 06:38:53 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.79,1.80 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7812/buildbot/slave Modified Files: commands.py Log Message: [project @ update CREDITS] Original author: warner at lothar.com Date: 2007-04-17 06:38:12+00:00 Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- commands.py 15 Apr 2007 01:28:46 -0000 1.79 +++ commands.py 17 Apr 2007 06:38:50 -0000 1.80 @@ -701,7 +701,7 @@ self.workdir, os.path.expanduser(self.filename)) try: - self.fp = open(self.path, 'r') + self.fp = open(self.path, 'rb') if self.debug: log.msg('Opened %r for upload' % self.path) except: @@ -813,7 +813,7 @@ self.workdir, os.path.expanduser(self.filename)) try: - self.fp = open(self.path, 'w') + self.fp = open(self.path, 'wb') if self.debug: log.msg('Opened %r for download' % self.path) if self.mode is not None: From warner at users.sourceforge.net Tue Apr 17 06:38:52 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 Apr 2007 06:38:52 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes p4poller.py, 1.10, 1.11 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7812/buildbot/changes Modified Files: p4poller.py Log Message: [project @ update CREDITS] Original author: warner at lothar.com Date: 2007-04-17 06:38:12+00:00 Index: p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/p4poller.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- p4poller.py 15 Apr 2007 01:28:46 -0000 1.10 +++ p4poller.py 17 Apr 2007 06:38:50 -0000 1.11 @@ -28,7 +28,7 @@ them to the change master.""" compare_attrs = ["p4port", "p4user", "p4passwd", "p4base", - "p4bin", "pollinterval", "histmax"] + "p4bin", "pollinterval"] changes_line_re = re.compile( r"Change (?P\d+) on \S+ by \S+@\S+ '.+'$") @@ -45,7 +45,7 @@ def __init__(self, p4port=None, p4user=None, p4passwd=None, p4base='//', p4bin='p4', split_file=lambda branchfile: (None, branchfile), - pollinterval=60 * 10, histmax=100): + pollinterval=60 * 10, histmax=None): """ @type p4port: string @param p4port: p4 port definition (host:portno) @@ -63,7 +63,8 @@ @type pollinterval: int @param pollinterval: interval in seconds between polls @type histmax: int - @param histmax: maximum number of changes to look back through + @param histmax: (obsolete) maximum number of changes to look back through. + ignored; accepted for backwards compatibility. """ self.p4port = p4port @@ -73,7 +74,6 @@ self.p4bin = p4bin self.split_file = split_file self.pollinterval = pollinterval - self.histmax = histmax self.loop = LoopingCall(self.checkp4) def startService(self): @@ -121,7 +121,11 @@ args.extend(['-u', self.p4user]) if self.p4passwd: args.extend(['-P', self.p4passwd]) - args.extend(['changes', '-m', str(self.histmax), self.p4base + '...']) + args.extend(['changes']) + if self.last_change is not None: + args.extend(['%s...@%d,now' % (self.p4base, self.last_change+1)]) + else: + args.extend(['-m', '1', '%s...' % (self.p4base,)]) env = {} return getProcessOutput(self.p4bin, args, env) @@ -133,13 +137,11 @@ if not line: continue m = self.changes_line_re.match(line) assert m, "Unexpected 'p4 changes' output: %r" % result - num = m.group('num') + num = int(m.group('num')) if last_change is None: - log.msg('P4Poller: starting at change %s' % num) + log.msg('P4Poller: starting at change %d' % num) self.last_change = num return [] - if last_change == num: - break changelists.append(num) changelists.reverse() # oldest first @@ -158,7 +160,7 @@ args.extend(['-u', self.p4user]) if self.p4passwd: args.extend(['-P', self.p4passwd]) - args.extend(['describe', '-s', num]) + args.extend(['describe', '-s', str(num)]) env = {} d = getProcessOutput(self.p4bin, args, env) return d From warner at users.sourceforge.net Tue Apr 17 06:38:53 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 Apr 2007 06:38:53 +0000 Subject: [Buildbot-commits] buildbot/buildbot/steps transfer.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/steps In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7812/buildbot/steps Modified Files: transfer.py Log Message: [project @ update CREDITS] Original author: warner at lothar.com Date: 2007-04-17 06:38:12+00:00 Index: transfer.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/transfer.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- transfer.py 15 Apr 2007 01:28:47 -0000 1.9 +++ transfer.py 17 Apr 2007 06:38:51 -0000 1.10 @@ -16,7 +16,7 @@ def __init__(self, destfile, maxsize, mode): self.destfile = destfile - self.fp = open(destfile, "w") + self.fp = open(destfile, "wb") if mode is not None: os.chmod(destfile, mode) self.remaining = maxsize @@ -240,7 +240,7 @@ # setup structures for reading the file try: - fp = open(source, 'r') + fp = open(source, 'rb') except IOError: # if file does not exist, bail out with an error self.addCompleteLog('stderr', From warner at users.sourceforge.net Tue Apr 17 06:38:53 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 Apr 2007 06:38:53 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py, 1.99, 1.100 mail.py, 1.34, 1.35 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7812/buildbot/status Modified Files: html.py mail.py Log Message: [project @ update CREDITS] Original author: warner at lothar.com Date: 2007-04-17 06:38:12+00:00 Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- html.py 15 Apr 2007 01:28:47 -0000 1.99 +++ html.py 17 Apr 2007 06:38:51 -0000 1.100 @@ -1,1731 +1,7 @@ -# -*- test-case-name: buildbot.test.test_web -*- - -from __future__ import generators - -from twisted.python import log, components -import urllib, re - -from twisted.internet import defer, reactor -from twisted.web.resource import Resource -from twisted.web import static, html, server, distrib -from twisted.web.error import NoResource [...1705 lines suppressed...] - else: - control = None - change_svc = self.parent.change_svc - sr = StatusResource(status, control, change_svc, self.categories, - self.css) - sr.favicon = self.favicon - sr.robots_txt = self.robots_txt - self.site = server.Site(sr) +# compatibility wrapper. This is currently the preferred place for master.cfg +# to import from. - if self.http_port is not None: - s = strports.service(self.http_port, self.site) - s.setServiceParent(self) - if self.distrib_port is not None: - f = pb.PBServerFactory(distrib.ResourcePublisher(self.site)) - s = strports.service(self.distrib_port, f) - s.setServiceParent(self) +from buildbot.status.web.waterfall import Waterfall +_hush_pyflakes = [Waterfall] Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- mail.py 15 Apr 2007 01:28:47 -0000 1.34 +++ mail.py 17 Apr 2007 06:38:51 -0000 1.35 @@ -61,7 +61,7 @@ def __init__(self, fromaddr, mode="all", categories=None, builders=None, addLogs=False, relayhost="localhost", - subject="buildbot %(result)s in %(builder)s", + subject="buildbot %(result)s in %(projectName)s on %(builder)s", lookup=None, extraRecipients=[], sendToInterestedUsers=True): """ @@ -214,13 +214,15 @@ return self.buildMessage(name, build, results) def buildMessage(self, name, build, results): + projectName = self.status.getProjectName() text = "" if self.mode == "all": - text += "The Buildbot has finished a build of %s.\n" % name + text += "The Buildbot has finished a build" elif self.mode == "failing": - text += "The Buildbot has detected a failed build of %s.\n" % name + text += "The Buildbot has detected a failed build" else: - text += "The Buildbot has detected a new failure of %s.\n" % name + text += "The Buildbot has detected a new failure" + text += " of %s on %s.\n" % (name, projectName) buildurl = self.status.getURLForThing(build) if buildurl: text += "Full details are available at:\n %s\n" % buildurl @@ -304,6 +306,7 @@ m['Date'] = formatdate(localtime=True) m['Subject'] = self.subject % { 'result': res, + 'projectName': projectName, 'builder': name, } m['From'] = self.fromaddr From warner at users.sourceforge.net Tue Apr 17 06:38:53 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 Apr 2007 06:38:53 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_p4poller.py, 1.6, 1.7 test_status.py, 1.40, 1.41 test_web.py, 1.42, 1.43 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7812/buildbot/test Modified Files: test_p4poller.py test_status.py test_web.py Log Message: [project @ update CREDITS] Original author: warner at lothar.com Date: 2007-04-17 06:38:12+00:00 Index: test_p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_p4poller.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- test_p4poller.py 15 Apr 2007 01:28:47 -0000 1.6 +++ test_p4poller.py 17 Apr 2007 06:38:51 -0000 1.7 @@ -38,20 +38,20 @@ """ p4change = { - '3': change_3_log + + 3: change_3_log + """Affected files ... ... //depot/myproject/branch_b/branch_b_file#1 add ... //depot/myproject/branch_b/whatbranch#1 branch ... //depot/myproject/branch_c/whatbranch#1 branch """, - '2': change_2_log + + 2: change_2_log + """Affected files ... ... //depot/myproject/trunk/whatbranch#1 add ... //depot/otherproject/trunk/something#1 add """, - '5': change_4_log + + 5: change_4_log + """Affected files ... ... //depot/myproject/branch_b/branch_b_file#1 add @@ -108,14 +108,14 @@ def _testCheck2(self, res): self.assertEquals(self.changes, []) - self.assertEquals(self.t.last_change, '1') + self.assertEquals(self.t.last_change, 1) # Subsequent times, it returns Change objects for new changes. return self.t.checkp4().addCallback(self._testCheck3) def _testCheck3(self, res): self.assertEquals(len(self.changes), 3) - self.assertEquals(self.t.last_change, '3') + self.assertEquals(self.t.last_change, 3) self.assert_(not self.t.working) # They're supposed to go oldest to newest, so this one must be first. @@ -170,7 +170,7 @@ def testFailedDescribe(self): """'p4 describe' failure is properly reported""" c = dict(p4change) - c['3'] = 'Perforce client error:\n...' + c[3] = 'Perforce client error:\n...' self.t = MockP4Source(p4changes=[first_p4changes, second_p4changes], p4change=c, p4port=None, p4user=None) self.t.parent = self @@ -186,7 +186,7 @@ self.assert_(isinstance(f, failure.Failure)) self.failUnlessIn('Perforce client error', str(f)) self.assert_(not self.t.working) - self.assertEquals(self.t.last_change, '2') + self.assertEquals(self.t.last_change, 2) def testAlreadyWorking(self): """don't launch a new poll while old is still going""" @@ -213,4 +213,4 @@ def _testSplitFile(self, res): self.assertEquals(len(self.changes), 2) - self.assertEquals(self.t.last_change, '5') + self.assertEquals(self.t.last_change, 5) Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- test_status.py 15 Apr 2007 01:28:47 -0000 1.40 +++ test_status.py 17 Apr 2007 06:38:51 -0000 1.41 @@ -135,7 +135,11 @@ return MyBuild(self.builder, number, results) def failUnlessIn(self, substring, string): - self.failUnless(string.find(substring) != -1) + self.failUnless(string.find(substring) != -1, + "didn't see '%s' in '%s'" % (substring, string)) + + def getProjectName(self): + return "PROJECT" def getBuildbotURL(self): return "BUILDBOT_URL" @@ -162,7 +166,7 @@ self.failUnlessIn("To: bob at dev.com, recip2 at example.com, " "recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot success in builder1\n", t) + self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t) self.failUnlessIn("Date: ", t) self.failUnlessIn("Build succeeded!\n", t) self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t) @@ -187,7 +191,7 @@ self.failUnlessIn("To: recip2 at example.com, " "recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot success in builder1\n", t) + self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t) self.failUnlessIn("Build succeeded!\n", t) self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t) @@ -288,7 +292,7 @@ self.failUnlessIn("To: dev3 at dev.com, dev4 at dev.com, " "recip2 at example.com, recip at example.com\n", t) self.failUnlessIn("From: buildbot at example.com\n", t) - self.failUnlessIn("Subject: buildbot failure in builder1\n", t) + self.failUnlessIn("Subject: buildbot failure in PROJECT on builder1\n", t) self.failUnlessIn("The Buildbot has detected a new failure", t) self.failUnlessIn("BUILD FAILED: snarkleack polarization failed\n", t) self.failUnlessEqual(r, ["dev3 at dev.com", "dev4 at dev.com", @@ -314,7 +318,7 @@ self.failUnless(len(self.messages) == 1) m,r = self.messages.pop() t = m.as_string() - self.failUnlessIn("Subject: buildbot warnings in builder1\n", t) + self.failUnlessIn("Subject: buildbot warnings in PROJECT on builder1\n", t) m2 = email.message_from_string(t) p = m2.get_payload() self.failUnlessEqual(len(p), 3) Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- test_web.py 15 Apr 2007 01:28:47 -0000 1.42 +++ test_web.py 17 Apr 2007 06:38:51 -0000 1.43 @@ -12,6 +12,7 @@ from buildbot import master, interfaces, sourcestamp from buildbot.status import html, builder +from buildbot.status.web import waterfall from buildbot.changes.changes import Change from buildbot.process import base from buildbot.process.buildstep import BuildStep @@ -230,7 +231,7 @@ d.addCallback(self._test_waterfall_3) return d def _test_waterfall_3(self, icon): - expected = open(html.buildbot_icon,"rb").read() + expected = open(waterfall.buildbot_icon,"rb").read() self.failUnless(icon == expected) d = client.getPage("http://localhost:%d/changes" % self.port) @@ -264,7 +265,7 @@ s = setupBuildStepStatus("test_web.test_urls") s.addURL("coverage", "http://coverage.example.org/target") s.addURL("icon", "http://coverage.example.org/icon.png") - box = html.IBox(s).getBox() + box = waterfall.IBox(s).getBox() td = box.td() e1 = '[coverage]' self.failUnlessSubstring(e1, td)