[pypy-svn] r64930 - in pypy/build/bot2: codespeak-html pypybuildbot pypybuildbot/test

pedronis at codespeak.net pedronis at codespeak.net
Fri May 1 11:53:36 CEST 2009


Author: pedronis
Date: Fri May  1 11:53:32 2009
New Revision: 64930

Added:
   pypy/build/bot2/codespeak-html/sucess.png   (contents, props changed)
Modified:
   pypy/build/bot2/pypybuildbot/summary.py
   pypy/build/bot2/pypybuildbot/test/test_summary.py
Log:
display when the last run was fine

Added: pypy/build/bot2/codespeak-html/sucess.png
==============================================================================
Binary file. No diff available.

Modified: pypy/build/bot2/pypybuildbot/summary.py
==============================================================================
--- pypy/build/bot2/pypybuildbot/summary.py	(original)
+++ pypy/build/bot2/pypybuildbot/summary.py	Fri May  1 11:53:32 2009
@@ -306,7 +306,7 @@
                 anchors.append(' (%s..%s)' % (mintxt, maxtxt))
         return anchors
 
-    def start_cat_branch(self, cat_branch):
+    def _start_cat_branch(self, cat_branch, fine=False):
         category, branch = cat_branch
         branch = trunk_name(branch)
         category = category_name(category)
@@ -321,8 +321,11 @@
                                href="/summary?category=%s&branch=%s" %
                                cat_branch,
                                class_="failSummary branch")
-        
-        self.sections.append(html.h2(cat_anchor," ",branch_anchor))
+        if fine:
+            extra = html.img(alt=":-)", src="sucess.png")
+        else:
+            extra = ""
+        self.sections.append(html.h2(cat_anchor," ",branch_anchor, " ", extra))
 
     def _builder_anchor(self, builder):
         if self.fixed_builder:
@@ -359,7 +362,7 @@
         rightalign = ' '*(revsize-len(revtxt))
         return [rev_anchor, rightalign]
                             
-    def add_section(self, outcome_sets):
+    def add_section(self, cat_branch, outcome_sets):
         if not outcome_sets:
             return
         labels = sorted(self._label(outcome_set)
@@ -368,10 +371,11 @@
                           for outcome_set in outcome_sets)
         revs = [outcome_set.revision for outcome_set in outcome_sets]
 
+        _, last = by_label[-1]
+        self._start_cat_branch(cat_branch, fine = not last.failed)
+        
         lines = []
-
         revsize = len(str(max(revs)))
-
         align = 2*len(labels)-1+revsize
         def bars():
             return ' |'*len(lines)
@@ -704,8 +708,7 @@
             outcome_sets = []
             for label, by_build in runs.items():
                 outcome_sets.append(GatherOutcomeSet(by_build))
-            page.start_cat_branch(cat_branch)
-            page.add_section(outcome_sets)
+            page.add_section(cat_branch, outcome_sets)
             page.add_no_revision_builds(status, no_revision_builds)
 
         t1 = time.time()

Modified: pypy/build/bot2/pypybuildbot/test/test_summary.py
==============================================================================
--- pypy/build/bot2/pypybuildbot/test/test_summary.py	(original)
+++ pypy/build/bot2/pypybuildbot/test/test_summary.py	Fri May  1 11:53:32 2009
@@ -449,7 +449,7 @@
     def test_two_builds(self):
         builder = status_builder.BuilderStatus('builder0')
         add_builds(builder, [(60000, "F TEST1\n. b"),
-                             (60001, "F TEST1\n. b")])
+                             (60001, ". TEST1\n. b")])
 
         s = summary.Summary()
         res = witness_cat_branch(s)        
@@ -472,7 +472,8 @@
 
         assert revs == [60000, 60001]
 
-        assert 'TEST1' in out        
+        assert 'TEST1' in out
+        assert ':-)' in out
 
     def test_two_builds_samerev(self):
         builder = status_builder.BuilderStatus('builder0')



More information about the Pypy-commit mailing list