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

Jelmer Vernooij jelmer at samba.org
Sun Dec 12 15:23:25 MST 2010


The branch, master has been updated
       via  9d3f47c Cope with negative failure numbers.
      from  d088c44 give more time to gollum to run

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


- Log -----------------------------------------------------------------
commit 9d3f47c3a50abe44a990e40a0d56a5ee656491a8
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Dec 12 23:22:28 2010 +0100

    Cope with negative failure numbers.

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

Summary of changes:
 buildfarm/build.py            |    9 ++++++++-
 buildfarm/tests/test_build.py |   14 ++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/build.py b/buildfarm/build.py
index b6602ab..7c371b1 100644
--- a/buildfarm/build.py
+++ b/buildfarm/build.py
@@ -125,6 +125,7 @@ class BuildStatus(object):
             return False
         if ("panic" in self.other_failures and
             not "panic" in older.other_failures):
+            # If this build introduced panics, then that's always worse.
             return True
         if len(self.stages) < len(older.stages):
             # Less stages completed
@@ -132,8 +133,14 @@ class BuildStatus(object):
         for ((old_name, old_result), (new_name, new_result)) in zip(
             older.stages, self.stages):
             assert old_name == new_name
-            if new_result > old_result:
+            if new_result == old_result:
+                continue
+            if new_result < 0 and old_result >= 0:
                 return True
+            elif new_result >= 0 and old_result < 0:
+                return False
+            else:
+                return (abs(new_result) > abs(old_result))
         return False
 
     def __cmp__(self, other):
diff --git a/buildfarm/tests/test_build.py b/buildfarm/tests/test_build.py
index 6facb79..2fa31c1 100755
--- a/buildfarm/tests/test_build.py
+++ b/buildfarm/tests/test_build.py
@@ -341,6 +341,20 @@ class BuildStatusRegressedSinceTests(testtools.TestCase):
         b = BuildStatus(stages2, set(other_failures2))
         self.assertEquals(expected, b.regressed_since(a))
 
+    def test_negative(self):
+        self.assertRegressedSince(
+            False,
+            ([("CONFIGURE", -1)], []),
+            ([("CONFIGURE", 2)], []))
+        self.assertRegressedSince(
+            False,
+            ([("CONFIGURE", -1)], []),
+            ([("CONFIGURE", 0)], []))
+        self.assertRegressedSince(
+            True,
+            ([("CONFIGURE", -1)], []),
+            ([("CONFIGURE", -3)], []))
+
     def test_same(self):
         self.assertRegressedSince(
             False,


-- 
build.samba.org


More information about the samba-cvs mailing list