def testBuild1(self): mailer = MyMailer( fromaddr="*****@*****.**", extraRecipients=["*****@*****.**", "*****@*****.**"], lookup=mail.Domain("dev.com")) mailer.parent = self mailer.status = self self.messages = [] b1 = self.makeBuild(3, builder.SUCCESS) b1.blamelist = ["bob"] mailer.buildFinished("builder1", b1, b1.results) self.failUnless(len(self.messages) == 1) m, r = self.messages.pop() t = m.as_string() self.failUnlessIn( "To: [email protected], [email protected], " "[email protected]\n", t) self.failUnlessIn("From: [email protected]\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)
def __init__(self, fromaddr, categories=None, branches=None, subject="Notifcation of change %(revision)s on branch %(branch)s", relayhost="localhost", lookup=None, extraRecipients=None, sendToInterestedUsers=True, messageFormatter=defaultChangeMessage, extraHeaders=None, smtpUser=None, smtpPassword=None, smtpPort=25, changeIsImportant=None): base.StatusReceiverMultiService.__init__(self) self.fromaddr = fromaddr self.categories = categories self.branches = branches self.relayhost = relayhost if lookup is not None: if type(lookup) is str: lookup = mail.Domain(lookup) assert interfaces.IEmailLookup.providedBy(lookup) self.lookup = lookup self.smtpUser = smtpUser self.smtpPassword = smtpPassword self.smtpPort = smtpPort self.master_status = None self.subject = subject if extraHeaders: assert isinstance(extraHeaders, dict) self.extraHeaders = extraHeaders self.messageFormatter = messageFormatter self.sendToInterestedUsers = sendToInterestedUsers if changeIsImportant: assert callable(changeIsImportant) self.changeIsImportant = changeIsImportant if extraRecipients: assert isinstance(extraRecipients, (list, tuple)) for r in extraRecipients: assert isinstance(r, str) assert mail.VALID_EMAIL.search( r) # require full email addresses, not User names self.extraRecipients = extraRecipients else: self.extraRecipients = [] # you should either limit on branches or categories, not both assert not (self.branches is not None and self.categories is not None)
# Nokia Corporation - initial contribution. # # Contributors: # # Description: # # from buildbot.status import html, mail, words web = html.WebStatus(http_port=8010) allBuildsEmail = mail.MailNotifier( fromaddr="*****@*****.**", extraRecipients=["*****@*****.**"], sendToInterestedUsers=False) breakageEmail = mail.MailNotifier(fromaddr="*****@*****.**", lookup=mail.Domain("webkit.org"), mode="failing") IRC = words.IRC( host="irc.freenode.net", nick="webkit-build", channels=["#webkit-build"], # announceAllBuilds=True ) def getStatusListeners(): return [web, allBuildsEmail, breakageEmail, IRC]
request.postpath) self.site.resource = RewriterResource(rootResource, rewriteXSL) waterfall = MyWaterfall(http_port=8010, css="buildbot.css", results_directory="/home/buildresults/results/", allowForce=False) allBuildsEmail = mail.MailNotifier( fromaddr="*****@*****.**", extraRecipients=["*****@*****.**"], sendToInterestedUsers=False) breakageEmail = mail.MailNotifier( fromaddr="*****@*****.**", extraRecipients=["*****@*****.**"], lookup=mail.Domain("opensource.apple.com"), mode="breakage") IRC = words.IRC(host="irc.freenode.net", nick="webkit-build", channels=["#webkit-build"], announceAllBuilds=True) PBClient = client.PBListener("tcp:9988", "statusClient", "clientpw") def getStatusListeners(): return [waterfall, allBuildsEmail, breakageEmail, IRC, PBClient]