2016-03-15 22:04:36 +00:00
|
|
|
from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, EXCEPTION
|
|
|
|
from buildbot.steps.shell import ShellCommand
|
|
|
|
from sumfiles import DejaResults
|
|
|
|
import smtplib
|
|
|
|
import socket
|
|
|
|
from email.mime.text import MIMEText
|
|
|
|
|
|
|
|
class GDBAnalyzeRacyTests (ShellCommand):
|
|
|
|
"""Analyze the racy tests"""
|
|
|
|
command = ['cat', 'racy.sum']
|
|
|
|
|
|
|
|
def __init__ (self, **kwargs):
|
|
|
|
ShellCommand.__init__ (self, **kwargs)
|
|
|
|
|
|
|
|
def evaluateCommand (self, cmd):
|
|
|
|
builder = self.getProperty('buildername')
|
|
|
|
branch = self.getProperty('branch')
|
|
|
|
|
|
|
|
p = DejaResults ()
|
|
|
|
|
2016-03-21 22:35:47 +00:00
|
|
|
racy_tests = p.read_racy_sum_text (self.getLog ('stdio').getText ())
|
2016-03-15 22:04:36 +00:00
|
|
|
|
2016-03-20 19:38:28 +00:00
|
|
|
if not racy_tests or not racy_tests[1]:
|
2016-03-20 18:21:10 +00:00
|
|
|
return SUCCESS
|
2016-03-15 22:04:36 +00:00
|
|
|
|
2016-03-20 22:58:49 +00:00
|
|
|
msg = "*** Regressions found ***\n"
|
2016-03-20 19:42:56 +00:00
|
|
|
msg += "============================\n"
|
2016-05-22 23:50:17 +00:00
|
|
|
for t in racy_tests:
|
2016-03-15 22:04:36 +00:00
|
|
|
msg += "FAIL: %s\n" % t
|
|
|
|
msg += "============================\n"
|
|
|
|
|
|
|
|
mail = MIMEText (msg)
|
|
|
|
mail['Subject'] = 'Failures on %s, branch %s' % (builder, branch)
|
|
|
|
mail['From'] = 'GDB BuildBot Racy Detector <gdb-buildbot@sergiodj.net>'
|
|
|
|
mail['To'] = 'gdb-buildbot@sergiodj.net'
|
|
|
|
|
|
|
|
s = smtplib.SMTP ('localhost')
|
|
|
|
s.sendmail ('gdb-buildbot@sergiodj.net',
|
2016-03-20 18:21:10 +00:00
|
|
|
[ 'gdb-buildbot@sergiodj.net' ],
|
2016-03-15 22:04:36 +00:00
|
|
|
mail.as_string ())
|
|
|
|
s.quit ()
|
|
|
|
|
|
|
|
return SUCCESS
|