Merge "Add a test printHistory function" into feature/zuulv3

This commit is contained in:
Jenkins 2017-01-18 17:13:00 +00:00 committed by Gerrit Code Review
commit d733484924
1 changed files with 12 additions and 0 deletions

View File

@ -1369,6 +1369,7 @@ class ZuulTestCase(BaseTestCase):
threads = threading.enumerate()
if len(threads) > 1:
self.log.error("More than one thread is running: %s" % threads)
self.printHistory()
def init_repo(self, project):
parts = project.split('/')
@ -1670,6 +1671,17 @@ class ZuulTestCase(BaseTestCase):
self.log.error("No completed builds")
raise
def printHistory(self):
"""Log the build history.
This can be useful during tests to summarize what jobs have
completed.
"""
self.log.debug("Build history:")
for build in self.history:
self.log.debug(build)
def getPipeline(self, name):
return self.sched.abide.tenants.values()[0].layout.pipelines.get(name)