Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: third_party/buildbot_7_12/buildbot/status/web/tests.py

Issue 12207158: Bye bye buildbot 0.7.12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
2 from twisted.web.error import NoResource
3 from twisted.web import html
4
5 from buildbot.status.web.base import HtmlResource
6
7 # /builders/$builder/builds/$buildnum/tests/$testname
8 class TestResult(HtmlResource):
9 title = "Test Logs"
10
11 def __init__(self, name, test_result):
12 HtmlResource.__init__(self)
13 self.name = name
14 self.test_result = test_result
15
16 def body(self, request):
17 dotname = ".".join(self.name)
18 logs = self.test_result.getLogs()
19 lognames = logs.keys()
20 lognames.sort()
21 data = "<h1>%s</h1>\n" % html.escape(dotname)
22 for name in lognames:
23 data += "<h2>%s</h2>\n" % html.escape(name)
24 data += "<pre>" + logs[name] + "</pre>\n\n"
25
26 return data
27
28
29 # /builders/$builder/builds/$buildnum/tests
30 class TestsResource(HtmlResource):
31 title = "Test Results"
32
33 def __init__(self, build_status):
34 HtmlResource.__init__(self)
35 self.build_status = build_status
36 self.test_results = build_status.getTestResults()
37
38 def body(self, request):
39 r = self.test_results
40 data = "<h1>Test Results</h1>\n"
41 data += "<ul>\n"
42 testnames = r.keys()
43 testnames.sort()
44 for name in testnames:
45 res = r[name]
46 dotname = ".".join(name)
47 data += " <li>%s: " % dotname
48 # TODO: this could break on weird test names. At the moment,
49 # test names only come from Trial tests, where the name
50 # components must be legal python names, but that won't always
51 # be a restriction.
52 url = request.childLink(dotname)
53 data += "<a href=\"%s\">%s</a>" % (url, " ".join(res.getText()))
54 data += "</li>\n"
55 data += "</ul>\n"
56 return data
57
58 def getChild(self, path, request):
59 try:
60 name = tuple(path.split("."))
61 result = self.test_results[name]
62 return TestResult(name, result)
63 except KeyError:
64 return NoResource("No such test name '%s'" % html.escape(path))
OLDNEW
« no previous file with comments | « third_party/buildbot_7_12/buildbot/status/web/step.py ('k') | third_party/buildbot_7_12/buildbot/status/web/waterfall.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698