bug 433874: mozilla-central tinderbox logs don't show commands that are being executed. r=tmielczarek, patch=me

git-svn-id: svn://10.0.0.236/trunk@252189 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bhearsum%mozilla.com
2008-06-09 12:28:46 +00:00
parent 0ab69d4412
commit 52f2d00bc6

View File

@@ -10,7 +10,7 @@ from buildbot.status import mail
from buildbot.status.builder import SUCCESS, WARNINGS
from buildbot.steps.shell import WithProperties
import zlib, bz2, base64
import zlib, bz2, base64, re
# TODO: docs, maybe a test of some sort just to make sure it actually imports
# and can format email without raising an exception.
@@ -187,19 +187,30 @@ class TinderboxMailNotifier(mail.MailNotifier):
# logs will always be appended
logEncoding = ""
tinderboxLogs = ""
for log in build.getLogs():
l = ""
if self.logCompression == "bzip2":
compressedLog = bz2.compress(log.getText())
l = base64.encodestring(compressedLog)
logEncoding = "base64";
elif self.logCompression == "gzip":
compressedLog = zlib.compress(log.getText())
l = base64.encodestring(compressedLog)
logEncoding = "base64";
else:
l = log.getText()
tinderboxLogs += l
for bs in build.getSteps():
# ignore steps that haven't happened
shortText = ' '.join(bs.getText()) + '\n'
if not re.match(".*[^\s].*", shortText):
continue
logs = bs.getLogs()
tinderboxLogs += "======== BuildStep started ========\n"
tinderboxLogs += shortText
tinderboxLogs += "=== Output ===\n"
for log in logs:
tinderboxLogs += log.getTextWithHeaders()
tinderboxLogs += "=== Output ended ===\n"
tinderboxLogs += "======== BuildStep ended ========\n"
if self.logCompression == "bzip2":
cLog = bz2.compress(tinderboxLogs)
tinderboxLogs = base64.encodestring(cLog)
logEncoding = "base64";
elif self.logCompression == "gzip":
cLog = zlib.compress(tinderboxLogs)
tinderboxLogs = base64.encodestring(cLog)
logEncoding = "base64";
text += "%s logencoding: %s\n" % (t, logEncoding)
text += "%s END\n\n" % t