Skip to content

Commit

Permalink
Include log contents in failed integration tests
Browse files Browse the repository at this point in the history
This may help deciphering some flaky integration tests.
  • Loading branch information
djmitche committed Jul 24, 2015
1 parent ff9c541 commit 1cea6bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions master/buildbot/test/util/integration.py
Expand Up @@ -167,7 +167,7 @@ def tearDown(self):
print("FAILED! dumping build db for debug", file=dump)
builds = yield self.master.data.get(("builds",))
for build in builds:
yield self.printBuild(build, dump)
yield self.printBuild(build, dump, withLogs=True)
m = self.master
# stop the service
yield m.stopService()
Expand Down Expand Up @@ -239,7 +239,7 @@ def enrichBuild(self, build, wantSteps=False, wantProperties=False, wantLogs=Fal
build["properties"] = yield self.master.data.get(("builds", build['buildid'], "properties"))

@defer.inlineCallbacks
def printBuild(self, build, out=sys.stdout):
def printBuild(self, build, out=sys.stdout, withLogs=False):
# helper for debugging: print a build
yield self.enrichBuild(build, wantSteps=True, wantProperties=True, wantLogs=True)
print("*** BUILD %d *** ==> %s (%s)" % (build['buildid'], build['state_string'],
Expand All @@ -251,7 +251,7 @@ def printBuild(self, build, out=sys.stdout):
print(" url:%s (%s)" % (url['name'], url['url']), file=out)
for log in step['logs']:
print(" log:%s (%d)" % (log['name'], log['num_lines']), file=out)
if step['results'] != SUCCESS:
if step['results'] != SUCCESS or withLogs:
self.printLog(log, out)

def printLog(self, log, out):
Expand Down

0 comments on commit 1cea6bc

Please sign in to comment.