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

Matthieu Patou mat at samba.org
Sun Nov 7 02:08:02 MST 2010


The branch, master has been updated
       via  58f5041 Point to the good database
       via  119ba10 use BUILD REVISION if the BUILD COMMIT REVISION has not been found
       via  9fc3944 Show make "test" as -1 if no test failed but make return non zero
       via  967e16b Fix the view "recent build", handle case when revision is null
       via  aded617 Fix more bugs
       via  3afc2d2 use css to do the spacing not html ...
       via  e32aa23 Make errorlog divs not visible
      from  5b7936c Add python version of mail-dead-hosts script.

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


- Log -----------------------------------------------------------------
commit 58f5041abdf525384627957a7e3740e03e9e59bd
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Nov 7 12:07:40 2010 +0300

    Point to the good database

commit 119ba103f37b1c3edf68c1e4659a9ad032e62e9c
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Nov 7 06:12:08 2010 +0300

    use BUILD REVISION if the BUILD COMMIT REVISION has not been found
    
    Quite often BUILD REVISION hold a timestamp not a git/svn revision

commit 9fc394416a611b346f048df16f619e9a79b4fc02
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Nov 7 06:10:53 2010 +0300

    Show make "test" as -1 if no test failed but make return non zero

commit 967e16b8636e65d67b0a71635be86dd31c637fde
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Nov 7 06:05:47 2010 +0300

    Fix the view "recent build", handle case when revision is null

commit aded61733b040c3e2918f7cb5990b12cebe2244e
Author: Matthieu Patou <mat at matws.net>
Date:   Sat Nov 6 23:51:42 2010 +0300

    Fix more bugs
    
    Mainly with multiline regexp, use re.M to be able to have ^$ to limit a
    line

commit 3afc2d2a878493b0bb236381af9717adacb3a906
Author: Matthieu Patou <mat at matws.net>
Date:   Sat Nov 6 23:51:26 2010 +0300

    use css to do the spacing not html ...

commit e32aa23f141baef17a47673846928f958098c438
Author: Matthieu Patou <mat at matws.net>
Date:   Sat Nov 6 16:47:15 2010 +0300

    Make errorlog divs not visible

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

Summary of changes:
 buildfarm/data.py  |    4 ++-
 web/build.py       |   84 ++++++++++++++++++++++++++++++---------------------
 web/build_farm.css |    4 ++
 3 files changed, 56 insertions(+), 36 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/data.py b/buildfarm/data.py
index 437cd76..ca1fe28 100644
--- a/buildfarm/data.py
+++ b/buildfarm/data.py
@@ -58,6 +58,8 @@ def build_status_from_logs(log, err):
                 tstatus = test_failures
             else:
                 tstatus = 255
+            if m.group(1) == "FAILED" and tstatus == 0:
+                tstatus = -1
         else:
             tstatus = None
 
@@ -189,7 +191,7 @@ class Build(object):
             for l in f.readlines():
                 if l.startswith("BUILD COMMIT REVISION: "):
                     revid = l.split(":", 1)[1].strip()
-                elif l.startswith("BUILD REVISION: "):
+                elif l.startswith("BUILD REVISION: ") and not revid:
                     revid = l.split(":", 1)[1].strip()
                 elif l.startswith("BUILD COMMIT TIME"):
                     timestamp = l.split(":", 1)[1].strip()
diff --git a/web/build.py b/web/build.py
index fc27aea..07db80c 100755
--- a/web/build.py
+++ b/web/build.py
@@ -47,7 +47,7 @@ basedir = os.path.abspath(os.path.join(webdir, ".."))
 
 db = data.BuildResultStore(basedir)
 history = history.History(db)
-hostsdb = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), "..", "hosts.sqlite"))
+hostsdb = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), "..", "hostdb.sqlite"))
 
 compilers = db.compilers
 hosts = hostsdb.hosts()
@@ -285,7 +285,8 @@ def view_recent_builds(myself, tree, sort_by):
                 age_mtime = build.age_mtime()
                 age_ctime = build.age_ctime()
                 (revision, revision_time) = build.revision_details()
-                all_builds.append([age_ctime, hosts[host], "<a href='%s?function=View+Host;host=%s;tree=%s;compiler=%s#%s'>%s</a>" % (myself, host, tree, compiler, host, host), compiler, tree, status, revision_link(myself, revision, tree), revision_time])
+                if revision:
+                    all_builds.append([age_ctime, hosts[host], "<a href='%s?function=View+Host;host=%s;tree=%s;compiler=%s#%s'>%s</a>" % (myself, host, tree, compiler, host, host), compiler, tree, status, revision_link(myself, revision, tree), revision_time])
 
     all_builds.sort(cmp_funcs[sort_by])
 
@@ -414,17 +415,18 @@ def view_build(myself, tree, host, compiler, rev, plain_logs=False):
     if os.path.exists(host_web_file):
         yield util.FileLoad(host_web_file)
 
-    yield "<table class='real'>"
+    yield "<table class='real'>\n"
     yield "<tr><td>Host:</td><td><a href='%s?function=View+Host;host=%s;tree=%s;"\
-          "compiler=%s#'>%s</a> - %s</td></tr>" % (myself, host, tree, compiler, host, hosts[host])
-    yield "<tr><td>Uname:</td><td>%s</td></tr>" % uname
-    yield "<tr><td>Tree:</td><td>%s</td></tr>" % tree_link(myself, tree)
-    yield "<tr><td>Build Revision:</td><td>%s</td></tr>" % revision_link(myself, revision, tree)
-    yield "<tr><td>Build age:</td><td><div class='age'>%s</div></td></tr>" % red_age(age_mtime)
-    yield "<tr><td>Status:</td><td>%s</td></tr>" % status
-    yield "<tr><td>Compiler:</td><td>%s</td></tr>" % compiler
-    yield "<tr><td>CFLAGS:</td><td>%s</td></tr>" % cflags
-    yield "<tr><td>configure options:</td><td>%s</td></tr>" % config
+          "compiler=%s#'>%s</a> - %s</td></tr>\n" % (myself, host, tree, compiler, host, hosts[host])
+    yield "<tr><td>Uname:</td><td>%s</td></tr>\n" % uname
+    yield "<tr><td>Tree:</td><td>%s</td></tr>\n" % tree_link(myself, tree)
+    yield "<tr><td>Build Revision:</td><td>%s</td></tr>\n" % revision_link(myself, revision, tree)
+    yield "<tr><td>Build age:</td><td><div class='age'>%s</div></td></tr>\n" % red_age(age_mtime)
+    yield "<tr><td>Status:</td><td>%s</td></tr>\n" % status
+    yield "<tr><td>Compiler:</td><td>%s</td></tr>\n" % compiler
+    yield "<tr><td>CFLAGS:</td><td>%s</td></tr>\n" % cflags
+    yield "<tr><td>configure options:</td><td>%s</td></tr>\n" % config
+    yield "</table>\n"
 
     yield "".join(show_oldrevs(myself, tree, host, compiler))
 
@@ -444,15 +446,15 @@ def view_build(myself, tree, host, compiler, rev, plain_logs=False):
         # These can be pretty wide -- perhaps we need to
         # allow them to wrap in some way?
         if err == "":
-            yield "<h2>No error log available</h2>"
+            yield "<h2>No error log available</h2>\n"
         else:
             yield "<h2>Error log:</h2>"
-            yield make_collapsible_html('action', "Error Output", "\n%s" % err, "stderr-0")
+            yield make_collapsible_html('action', "Error Output", "\n%s" % err, "stderr-0", "errorlog")
 
         if log == "":
             yield "<h2>No build log available</h2>"
         else:
-            yield "<h2>Build log:</h2>"
+            yield "<h2>Build log:</h2>\n"
             yield print_log_pretty(log)
 
         yield "<p><small>Some of the above icons derived from the <a href='http://www.gnome.org'>Gnome Project</a>'s stock icons.</small></p>"
@@ -464,12 +466,12 @@ def view_build(myself, tree, host, compiler, rev, plain_logs=False):
         if err == "":
             yield "<h2>No error log available</h2>"
         else:
-            yield '<h2>Error log:</h2>'
+            yield '<h2>Error log:</h2>\n'
             yield '<div id="errorLog"><pre>%s</pre></div>' % err
         if log == "":
             yield '<h2>No build log available</h2>'
         else:
-            yield '<h2>Build log:</h2>'
+            yield '<h2>Build log:</h2>\n'
             yield '<div id="buildLog"><pre>%s</pre></div>' % log
 
     yield '</div>'
@@ -574,6 +576,7 @@ def print_log_pretty(log):
 
     # do some pretty printing for the actions
     def pretty_print(m):
+        global indice
         output = m.group(1)
         actionName = m.group(2)
         status = m.group(3)
@@ -581,16 +584,17 @@ def print_log_pretty(log):
         if actionName == 'cc_checker':
              output = print_log_cc_checker(output)
 
-        indice +=1
-        make_collapsible_html('action', actionName, output, indice, status)
-        return output
-    log = re.sub("(Running\ action\s+([\w\-]+) .*? ACTION\ (PASSED|FAILED):\ ([\w\-]+))",
-                 pretty_print, log)
+        indice += 1
+        return make_collapsible_html('action', actionName, output, indice, status)
+
+    pattern = re.compile("(Running action\s+([\w\-]+)$(?:\s^.*$)*?\sACTION\ (PASSED|FAILED):\ ([\w\-]+)$)", re.M)
+    log = pattern.sub(pretty_print, log)
 
     # log is already CGI-escaped, so handle '>' in test name by handling &gt
     def format_stage(m):
         indice += 1
         return make_collapsible_html('test', m.group(1), m.group(2), indice, m.group(3))
+
     log = re.sub("""
           --==--==--==--==--==--==--==--==--==--==--.*?
           Running\ test\ ([\w\-=,_:\ /.&;]+).*?
@@ -610,13 +614,19 @@ def print_log_pretty(log):
             format_skip_testsuite, log)
 
     def format_testsuite(m):
-        id += 1
-        return make_collapsible_html('test', m.group(1), m.group(2)+format_subunit_reason(m.group(4)), id, subunit_to_buildfarm_result(m.group(3)))
+        global indice
+        testName = m.group(1)
+        content = m.group(2)
+        status = subunit_to_buildfarm_result(m.group(3))
+        if m.group(4):
+            errorReason = format_subunit_reason(m.group(4))
+        else:
+            errorReason = ""
+        indice += 1
+        return make_collapsible_html('test', testName, content+errorReason, indice, status)
 
-    log = re.sub("""testsuite: ([\w\-=,_:\ /.&; \(\)\$]+).*?
-          (.*?)
-          testsuite-(.*?): [\w\-=,_:\ /.&; \(\)]+( \[.*?\])?.*?""",
-          format_testsuite, log)
+    pattern = re.compile("^testsuite: (.+)$\s((?:^.*$\s)*?)testsuite-(\w+): .*?(?:(\[$\s(?:^.*$\s)*?^\]$)|$)", re.M)
+    log = pattern.sub(format_testsuite, log)
 
     def format_test(m):
         id += 1
@@ -694,8 +704,7 @@ def make_collapsible_html(type, title, output, id, status=""):
     :param type: the logical type of it. e.g. "test" or "action"
     :param title: the title to be displayed
     """
-
-    if ((status == "" or "failed" in status.lower())):
+    if ((status == "" or "failed" == status.lower())):
         icon = 'icon_hide_16.png'
     else:
         icon = 'icon_unhide_16.png'
@@ -707,11 +716,14 @@ def make_collapsible_html(type, title, output, id, status=""):
     # in this html
     ret = "<div class='%s unit %s' id='%s-%s'>" % (type, status, type, id)
     ret += "<a href=\"javascript:handle('%s');\">" % id
-    ret += "<img id='img-%s' name='img-%s' alt='%s' src='%s'>" %(id, id, status, icon)
-    ret += "<div class='%s title'>%s</div>" % (type, title)
-    ret += " "
+    ret += "<img id='img-%s' name='img-%s' alt='%s' src='%s' />" %(id, id, status, icon)
+    ret += "<div class='%s title'>%s</div></a>" % (type, title)
+    #ret += " "
     ret += "<div class='%s status %s'>%s</div>" % (type, status, status)
-    ret += "<div class='%s output' id='output-%s'><pre>%s</pre></div>" % (type, id, output)
+    ret += "<div class='%s output' id='output-%s'>" % (type, id)
+    if output and len(output):
+        ret += "<pre>%s</pre>>" % (output)
+    ret += "</div></div>"
     return ret
 
 def main_menu():
@@ -916,7 +928,8 @@ def buildApp(environ, start_response):
         yield "    <meta name='description' contents='Home of the Samba Build Farm, the automated testing facility.'/>"
         yield "    <meta name='robots' contents='noindex'/>"
         yield "    <link rel='stylesheet' href='/build_farm.css' type='text/css' media='all'/>"
-        yield "    <link rel='stylesheet' href='http://master.samba.org/samba/style/common.css' type='text/css' media='all'/>"
+        #yield "    <link rel='stylesheet' href='http://master.samba.org/samba/style/common.css' type='text/css' media='all'/>"
+        yield "    <link rel='stylesheet' href='common.css' type='text/css' media='all'/>"
         yield "    <link rel='shortcut icon' href='http://www.samba.org/samba/images/favicon.ico'/>"
         yield "  </head>"
         yield "<body>"
@@ -934,6 +947,7 @@ def buildApp(environ, start_response):
             yield "".join(view_recent_builds(myself, get_param(form, "tree"), get_param(form, "sortby") or "revision"))
         elif fn_name == "Recent_Checkins":
             # validate the tree
+            tree =  get_param(form, "tree")
             t = db.trees[tree]
             authors = set(["ALL"])
             authors.update(history.authors(tree))
diff --git a/web/build_farm.css b/web/build_farm.css
index 97cd366..5ceb440 100644
--- a/web/build_farm.css
+++ b/web/build_farm.css
@@ -36,6 +36,10 @@
 #log .unit.mistake .output {	display: none;}
 #log .unit.warning .output {	display: none;}
 #log .unit.xfailed .output {	display: none;}
+#log .unit.errorlog .output {	display: none;}
+#log div.status.errorlog {	display: none;}
+img + div.action.title {margin-left: 0.5em;}
+a + div.action.status {margin-left: 0.5em;}
 
 #log div.output-stderr-0 {
 	display: none;


-- 
build.samba.org


More information about the samba-cvs mailing list