Improving email message; little formatting issues

This commit is contained in:
Sergio Durigan Junior 2014-12-23 20:02:31 -05:00
parent 0174f62cba
commit 633aad43c6

View file

@ -108,19 +108,42 @@ c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
def MessageGDBTesters (mode, name, build, results, master_status): def MessageGDBTesters (mode, name, build, results, master_status):
"""This function is responsible for composing the message that will be """This function is responsible for composing the message that will be
send to the gdb-testers mailing list.""" send to the gdb-testers mailing list."""
ss_list = build.getSourceStamps () # Subject
subj = "Failures on %s" % name subj = "Failures on %s" % name
# Body
text = "" text = ""
# Buildslave name, useful for knowing the exact configuration.
text += "Builder:\n" text += "Builder:\n"
text += "\t%s\n" % build.getSlavename () text += "\t%s\n" % build.getSlavename ()
# Commits that were tested. Usually we should be dealing with
# only one commit
text += "Commit(s) tested:\n" text += "Commit(s) tested:\n"
ss_list = build.getSourceStamps ()
for ss in ss_list: for ss in ss_list:
text += "\t%s\n" % ss.revision text += "\t%s\n" % ss.revision
# URL to find more info about what went wrong.
text += "Log URL(s):\n"
for ss in ss_list:
text += "\t<http://sdj-gdbbuild.usersys.redhat.com/%s/%s>\n" % (name, ss.revision)
# Who's to blame?
text += "Author(s):\n"
text += "\t%s\n" % build.getResponsibleUsers()
# Including the 'regressions' log. This is the 'diff' of what
# went wrong.
text += "\n" text += "\n"
for log in build.getLogs (): for log in build.getLogs ():
if log.getName () == 'regressions' and log.hasContents (): if log.getName () == 'regressions' and log.hasContents ():
text += log.getText () text += log.getText ()
break break
# Including the 'xfail' log. It is important to say which tests
# we are ignoring.
xfail = os.path.join (gdb_web_base, name, 'xfail') xfail = os.path.join (gdb_web_base, name, 'xfail')
if os.path.exists (xfail): if os.path.exists (xfail):
text += "\n" text += "\n"
@ -135,7 +158,7 @@ send to the gdb-testers mailing list."""
from buildbot.status import mail from buildbot.status import mail
mn = mail.MailNotifier(fromaddr = "sergiodj@redhat.com", mn = mail.MailNotifier(fromaddr = "sergiodj@redhat.com",
sendToInterestedUsers = False, sendToInterestedUsers = False,
extraRecipients = ['sergiodj@redhat.com'], extraRecipients = ['sergiodj@redhat.com', 'jan.kratochvil@redhat.com'],
# extraRecipients = ['gdb-testers@sourceware.org'], # extraRecipients = ['gdb-testers@sourceware.org'],
relayhost = "smtp.corp.redhat.com", relayhost = "smtp.corp.redhat.com",
mode = ('failing'), mode = ('failing'),
@ -294,7 +317,9 @@ BuildBot halt on failure."""
## most builds. ## most builds.
class BuildAndTestGDBFactory (factory.BuildFactory): class BuildAndTestGDBFactory (factory.BuildFactory):
"""This is the main build factory for the GDB project. It was made to be very configurable, and should be enough to describe most builds. The parameters of the class are: """This is the main build factory for the GDB project. It was made to
be very configurable, and should be enough to describe most builds.
The parameters of the class are:
- ConfigureClass: set this to be the class (i.e., build step) that - ConfigureClass: set this to be the class (i.e., build step) that
will be called to configure GDB. It needs to accept the same will be called to configure GDB. It needs to accept the same
@ -389,8 +414,7 @@ class BuildAndTestGDBFactory (factory.BuildFactory):
'builddir'), 'builddir'),
description = 'analyze test results')) description = 'analyze test results'))
self.addStep (FileUpload (slavesrc = WithProperties ("%s/build/gdb/testsuite/gdb.log", 'builddir'), self.addStep (FileUpload (slavesrc = WithProperties ("%s/build/gdb/testsuite/gdb.log", 'builddir'),
masterdest = WithProperties ("public_html/results/%s/gdb.log", 'buildername'), masterdest = WithProperties ("public_html/results/%s/gdb.log", 'buildername')))
hideStepIf = False))
self.addStep (SaveGDBResults ()) self.addStep (SaveGDBResults ())