[SCM] build.samba.org - branch master updated

Matthieu Patou mat at samba.org
Thu Mar 15 01:34:43 MDT 2012


The branch, master has been updated
       via  802e02a remove extra margin between unit test box results
       via  d8fc484 Add a list of shortcut to failed tests
      from  725eebc Really fix the display of pretests infos

http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 802e02a5ab2470629c84034500c85eb080a2dca0
Author: Matthieu Patou <mat at matws.net>
Date:   Thu Mar 15 00:34:26 2012 -0700

    remove extra margin between unit test box results

commit d8fc4842302ebaefd6fe5f508c32c734e3c1486d
Author: Matthieu Patou <mat at matws.net>
Date:   Thu Mar 15 00:33:44 2012 -0700

    Add a list of shortcut to failed tests

-----------------------------------------------------------------------

Summary of changes:
 buildfarm/web/__init__.py |   19 ++++++++++++++++++-
 web/build_farm.css        |    5 +++--
 2 files changed, 21 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py
index 1e88020..95671e7 100755
--- a/buildfarm/web/__init__.py
+++ b/buildfarm/web/__init__.py
@@ -203,6 +203,10 @@ class LogPrettyPrinter(object):
         self.indice += 1
         return "".join(make_collapsible_html('test', m.group(1), '', self.indice, 'skipped'))
 
+    def _format_pretestsuite(self, m):
+        self.indice += 1
+        return m.group(1)+"".join(make_collapsible_html('pretest', 'Pretest infos', m.group(2), self.indice, 'ok'))+"\n"+m.group(3)
+
     def _format_testsuite(self, m):
         testName = m.group(1)
         content = m.group(2)
@@ -212,6 +216,8 @@ class LogPrettyPrinter(object):
         else:
             errorReason = ""
         self.indice += 1
+        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))
 
     def _format_test(self, m):
@@ -222,6 +228,7 @@ class LogPrettyPrinter(object):
         # do some pretty printing for the actions
         pattern = re.compile("(Running action\s+([\w\-]+)$(?:\s^.*$)*?\sACTION\ (PASSED|FAILED):\ ([\w\-]+)$)", re.M)
         log = pattern.sub(self._pretty_print, log)
+        buf = ""
 
         log = re.sub("""
               --==--==--==--==--==--==--==--==--==--==--.*?
@@ -233,9 +240,13 @@ class LogPrettyPrinter(object):
               ==========================================\s+
             """, self._format_stage, log)
 
+        pattern = re.compile("(Running action test).*$\s((?:^.*$\s)*?)^((?:skip-)?testsuite: )", re.M)
+        log = pattern.sub(self._format_pretestsuite, log)
+
         log = re.sub("skip-testsuite: ([\w\-=,_:\ /.&; \(\)]+).*?",
                 self._format_skip_testsuite, log)
 
+        self.test_links = []
         pattern = re.compile("^testsuite: (.+)$\s((?:^.*$\s)*?)testsuite-(\w+): .*?(?:(\[$\s(?:^.*$\s)*?^\]$)|$)", re.M)
         log = pattern.sub(self._format_testsuite, log)
         log = re.sub("""
@@ -244,6 +255,12 @@ class LogPrettyPrinter(object):
               (success|xfail|failure|skip|uxsuccess): [\w\-=,_:\ /.&; \(\)]+( \[.*?\])?.*?
            """, self._format_test, log)
 
+        for tst in self.test_links:
+            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, ""))
+            log = re.sub("Running action\s+test", divhtml, log)
         return "<pre>%s</pre>" % log
 
 
@@ -325,7 +342,7 @@ def make_collapsible_html(type, title, output, id, status=""):
     # note that we may be inside a <pre>, so we don't put any extra whitespace
     # in this html
     yield "<div class='%s unit %s' id='%s-%s'>" % (type, status, type, id)
-    yield "<a href=\"javascript:handle('%s');\">" % id
+    yield "<a name='lnk-%s-%s' href=\"javascript:handle('%s');\">" % (type, id, id)
     yield "<img id='img-%s' name='img-%s' alt='%s' src='%s' />" % (id, id, status, icon)
     yield "<div class='%s title'>%s</div></a>" % (type, title)
     yield "<div class='%s status %s'>%s</div>" % (type, status, status)
diff --git a/web/build_farm.css b/web/build_farm.css
index b6321b8..6b8fb01 100644
--- a/web/build_farm.css
+++ b/web/build_farm.css
@@ -18,9 +18,10 @@
 	color: rgb(0, 0, 0);
 	font-family: monospace;
 }
-#log .output .pretest { display: none;}
 #log div.unit {
-	margin: 5px;
+	/* We have already a margin that is implied by the \n in the HTML
+	 * no need to remargin
+	 * margin: 5px;*/
 	padding: 10px;
 	border: 2px solid black;
 }


-- 
build.samba.org


More information about the samba-cvs mailing list