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

Matthieu Patou mat at samba.org
Sun Nov 7 13:21:18 MST 2010


The branch, master has been updated
       via  e4357c0 Fix status sort so that sorting is the same as in the perl version
       via  2f96994 Construct a host => plateform dictionary, make html output more debuggable
       via  615325f Report checker stage as - if result is unknown and compiler is not checker
      from  7f12adc Fix buildsamba02 build

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


- Log -----------------------------------------------------------------
commit e4357c01db7c9139998d37e45875ae7b887e933d
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Nov 7 23:14:02 2010 +0300

    Fix status sort so that sorting is the same as in the perl version

commit 2f96994b0560407d1d9a82cb63b4ca80644ab796
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Nov 7 23:10:13 2010 +0300

    Construct a host => plateform dictionary, make html output more debuggable

commit 615325fb6484b3d7f8f2edcde351ba67a375763c
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Nov 7 23:09:08 2010 +0300

    Report checker stage as - if result is unknown and compiler is not checker

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

Summary of changes:
 buildfarm/data.py |    7 +++++-
 web/build.py      |   54 +++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 44 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/data.py b/buildfarm/data.py
index ca1fe28..acddf84 100644
--- a/buildfarm/data.py
+++ b/buildfarm/data.py
@@ -38,6 +38,11 @@ class BuildStatus(object):
     def __str__(self):
         return repr((self.stages, self.other_failures))
 
+    def setcheckerstage(self, val):
+        self.stages[4] = val
+
+    def getcheckerstage(self):
+        return self.stages[4]
 
 def check_dir_exists(kind, path):
     if not os.path.isdir(path):
@@ -98,7 +103,7 @@ def build_status_from_logs(log, err):
     else:
         sstatus = None
 
-    return BuildStatus((cstatus, bstatus, istatus, tstatus, sstatus), other_failures)
+    return BuildStatus([cstatus, bstatus, istatus, tstatus, sstatus], other_failures)
 
 
 def lcov_extract_percentage(text):
diff --git a/web/build.py b/web/build.py
index 07db80c..83b58c7 100755
--- a/web/build.py
+++ b/web/build.py
@@ -50,7 +50,7 @@ history = history.History(db)
 hostsdb = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), "..", "hostdb.sqlite"))
 
 compilers = db.compilers
-hosts = hostsdb.hosts()
+hostsiter = hostsdb.hosts()
 trees = db.trees
 OLDAGE = db.OLDAGE
 
@@ -62,6 +62,14 @@ GITWEB_BASE = "http://gitweb.samba.org"
 # this is automatically filled in
 deadhosts = []
 
+def get_hosts(hostiterator):
+    d = {}
+    for h in hostiterator:
+        d[str(h.name)] = str(h.platform)
+    return d
+
+hosts = get_hosts(hostsiter)
+
 def get_param(form, param):
     """get a param from the request, after sanitizing it"""
     if param not in form:
@@ -92,6 +100,8 @@ def html_build_status(status):
     def span_status(st):
         if st is None:
             return span("status unknown", "?")
+        elif st == "-":
+            return span("status notapplicable", "-")
         elif st == 0:
             return span("status passed", "ok")
         else:
@@ -109,7 +119,10 @@ def html_build_status(status):
 
 def build_status(myself, tree, host, compiler, rev=None):
     build = db.get_build(tree, host, compiler, rev)
-    status = html_build_status(build.status())
+    rawstatus = build.status()
+    if not rawstatus.getcheckerstage() and compiler != "checker":
+        rawstatus.setcheckerstage("-")
+    status = html_build_status(rawstatus)
     return build_link(myself, tree, host, compiler, rev, status)
 
 
@@ -125,7 +138,8 @@ def build_status_vals(status):
     status = util.strip_html(status)
 
     status = status.replace("ok", "0")
-    status = status.replace("?", "0")
+    status = status.replace("-", "0")
+    status = status.replace("?", "0.1")
     status = status.replace("PANIC", "1")
 
     return status.split("/")
@@ -156,7 +170,7 @@ def view_summary(myself, output_type):
         t = time.gmtime()
         yield "Build status as of %s\n\n" % t
 
-    for host in hosts:
+    for host in hosts.keys():
         for compiler in compilers:
             for tree in trees:
                 try:
@@ -250,15 +264,23 @@ def view_recent_builds(myself, tree, sort_by):
         astat = build_status_vals(a)
 
         # handle panic
-        if len(bstat) > 4 and bstat[4]:
+        if len(bstat) > 5 and bstat[5]:
             return 1
-        elif len(astat) > 4 and astat[4]:
+        elif len(astat) > 5 and astat[5]:
             return -1
 
-        return (cmp(astat[0], bstat[0]) or # configure
-                cmp(astat[1], bstat[1]) or # compile
-                cmp(astat[2], bstat[2]) or # install
-                cmp(astat[3], bstat[3])) # test
+        # If we have ok/ok/ok/ok/- or ok/ok/ok/ok/ok then we want the line to be at the end
+        if len(bstat) == 5:
+            if bstat[0] == bstat[1] == bstat[2] == bstat[3] == "0":
+                return -1
+        if len(astat) == 5:
+            if astat[0] == astat[1] == astat[2] == astat[3] == "0":
+                return 1
+
+        # Give more weight to higher stage (ie. install error before test errors)
+        return (cmp((10000 * astat[3] + 1000*astat[2] + 100 * astat[1] + astat[0]),
+                    (10000 * bstat[3] + 1000*bstat[2] + 100 * bstat[1] + bstat[0])))
+
 
     cmp_funcs = {
         "revision": lambda a, b: cmp(a[7], b[7]),
@@ -274,7 +296,7 @@ def view_recent_builds(myself, tree, sort_by):
 
     t = trees[tree]
 
-    for host in hosts:
+    for host in hosts.keys():
         for compiler in compilers:
             try:
                 status = build_status(myself, tree, host, compiler)
@@ -376,7 +398,7 @@ def show_oldrevs(myself, tree, host, compiler):
 def view_build(myself, tree, host, compiler, rev, plain_logs=False):
     """view one build in detail"""
     # ensure the params are valid before using them
-    assert host in hosts, "unknown host %s" % host
+    assert host in hosts.keys(), "unknown host %s" % host
     assert compiler in compilers, "unknown compiler %s" % compiler
     assert tree in trees, "not a build tree %s" % tree
 
@@ -487,7 +509,7 @@ def view_host(myself, output_type, *requested_hosts):
         yield '<h2>Host summary:</h2>'
 
     for host in requested_hosts:
-        assert host in hosts, "unknown host"
+        assert host in hosts.keys(), "unknown host"
 
     for host in requested_hosts:
         # make sure we have some data from it
@@ -733,15 +755,15 @@ def main_menu():
     yield "<div id='build-menu'>"
     yield "<select name='host'>"
     for host in hosts:
-        yield "<option value='%s'>%s -- %s</option>" % (host, hosts[host], host)
+        yield "<option value='%s'>%s -- %s</option>\n" % (host, hosts[host], host)
     yield "</select>"
     yield "<select name='tree'>"
     for tree, t in trees.iteritems():
-        yield "<option value='%s'>%s:%s</option>" % (tree, tree, t.branch)
+        yield "<option value='%s'>%s:%s</option>\n" % (tree, tree, t.branch)
     yield "</select>"
     yield "<select name='compiler'>"
     for compiler in compilers:
-        yield "<option>%s</option>" % compiler
+        yield "<option>%s</option>\n" % compiler
     yield "</select>"
     yield "<br/>"
     yield "<input type='submit' name='function' value='View Build'/>"


-- 
build.samba.org


More information about the samba-cvs mailing list