1
2 import urllib
3 from buildbot.status.web.base import HtmlResource, path_to_builder, \
4 path_to_build, css_classes
5 from buildbot.status.web.logs import LogsResource
6 from buildbot.status.builder import Results
7 from buildbot import util
8 from time import ctime
9
10
12 title = "Test Result"
13 addSlash = True
14
15 - def __init__(self, build_status, test_result):
19
20 - def content(self, req, cxt):
21 tr = self.test_result
22 b = self.status
23
24 cxt['b'] = self.status
25 logs = cxt['logs'] = []
26 for lname, log in tr.getLogs().items():
27 if isinstance(log, str):
28 log = log.decode('utf-8')
29 logs.append({'name': lname,
30 'log': log,
31 'link': req.childLink("logs/%s" % urllib.quote(lname)) })
32
33 cxt['text'] = tr.text
34 cxt['result_word'] = Results[tr.getResults()]
35 cxt.update(dict(builder_link = path_to_builder(req, b.getBuilder()),
36 build_link = path_to_build(req, b),
37 result_css = css_classes[tr.getResults()],
38 b = b,
39 tr = tr))
40
41 template = req.site.buildbot_service.templates.get_template("testresult.html")
42 return template.render(**cxt)
43
48
49
50
51
53 addSlash = True
54 nameDelim = '.'
55
59
60 - def content(self, req, ctx):
61
62 return "subpages show data for each test"
63
73