Add an easy way to got back to the error list
authorMatthieu Patou <mat@matws.net>
Thu, 15 Mar 2012 08:01:41 +0000 (01:01 -0700)
committerMatthieu Patou <mat@matws.net>
Thu, 15 Mar 2012 08:01:41 +0000 (01:01 -0700)
buildfarm/web/__init__.py

index dd954c4f331d108d24e59566e683913b8384ddc9..b7f019421dc5ada3274ca30b1d24b4a3446e4ea4 100755 (executable)
@@ -216,9 +216,11 @@ class LogPrettyPrinter(object):
         else:
             errorReason = ""
         self.indice += 1
+        backlink = ""
         if m.group(3) in ("error", "failure"):
             self.test_links.append([testName, 'lnk-test-%d' %self.indice])
-        return "".join(make_collapsible_html('test', testName, content+errorReason, self.indice, status))
+            backlink = "<p><a href='#shortcut2errors'>back to error list</a>"
+        return "".join(make_collapsible_html('test', testName, content+errorReason+backlink, self.indice, status))
 
     def _format_test(self, m):
         self.indice += 1
@@ -259,7 +261,7 @@ class LogPrettyPrinter(object):
             buf = "%s\n<A href='#%s'>%s</A>" % (buf, tst[1], tst[0])
 
         if not buf == "":
-            divhtml = "".join(make_collapsible_html('testlinks', 'Shortcut to failed tests', buf, self.indice, ""))+"\n"
+            divhtml = "".join(make_collapsible_html('testlinks', 'Shortcut to failed tests', "<a name='shortcut2errors'></a>%s" % buf, self.indice, ""))+"\n"
             log = re.sub("Running action\s+test", divhtml, log)
         return "<pre>%s</pre>" % log