land: Add --fail-slowly option.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 1 Oct 2010 20:10:13 +0000 (22:10 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 2 Oct 2010 11:14:53 +0000 (13:14 +0200)
script/land-remote.py
script/land.py

index 14f32357f9a48d88a613d20ca31f631fb511a956..cb0d7da85395aba8e6a354674337a33295e30b73 100755 (executable)
@@ -19,8 +19,10 @@ parser.add_option("--passcmd", help="command to run on success", default=None)
 parser.add_option("--tail", help="show output while running", default=False, action="store_true")
 parser.add_option("--keeplogs", help="keep logs", default=False, action="store_true")
 parser.add_option("--nocleanup", help="don't remove test tree", default=False, action="store_true")
-parser.add_option("", "--fix-whitespace", help="fix whitespace on rebase",
+parser.add_option("--fix-whitespace", help="fix whitespace on rebase",
                   default=False, action="store_true")
+parser.add_option("--fail-slowly", help="continue running tests even after one has already failed",
+                  action="store_true")
 
 (opts, args) = parser.parse_args()
 
index 67564a18b7a829f4294d14f06978f383e1f0bdb6..99bb8df3ecbd042229e515b3f9e847c72c971095 100755 (executable)
@@ -23,12 +23,12 @@ tasks = {
                   ("make basics", "make basics", "text/plain"),
                   ("make", "make -j 4 everything", "text/plain"), # don't use too many processes
                   ("install", "make install", "text/plain"),
-                  ("test", "TDB_NO_FSYNC=1 make subunit-test FAIL_IMMEDIATELY=1", "text/x-subunit") ],
+                  ("test", "TDB_NO_FSYNC=1 make subunit-test", "text/x-subunit") ],
 
     "source4" : [ ("configure", "./configure.developer ${PREFIX}", "text/plain"),
                   ("make", "make -j", "text/plain"),
                   ("install", "make install", "text/plain"),
-                  ("test", "TDB_NO_FSYNC=1 make subunit-test FAIL_IMMEDIATELY=1", "text/x-subunit") ],
+                  ("test", "TDB_NO_FSYNC=1 make subunit-test", "text/x-subunit") ],
 
     "source4/lib/ldb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
                           ("make", "make -j", "text/plain"),
@@ -89,8 +89,9 @@ def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True):
 class Builder(object):
     '''handle build of one directory'''
 
-    def __init__(self, name, sequence):
+    def __init__(self, name, sequence, fail_quickly=False):
         self.name = name
+        self.fail_quickly = fail_quickly
 
         if name in ['pass', 'fail', 'retry']:
             self.dir = "."
@@ -127,6 +128,8 @@ class Builder(object):
         (self.stage, self.cmd, self.output_mime_type) = self.sequence[self.next]
         self.cmd = self.cmd.replace("${PREFIX}", "--prefix=%s" % self.prefix)
         if self.output_mime_type == "text/x-subunit":
+            if self.fail_quickly:
+                self.cmd += " | %s --fail-immediately" % (os.path.join(os.path.dirname(__file__), "selftest/filter-subunit"))
             self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit"))
         print '%s: [%s] Running %s' % (self.name, self.stage, self.cmd)
         self.proc = Popen(self.cmd, shell=True, cwd="%s/%s" % (self.sdir, self.dir),
@@ -172,10 +175,10 @@ class BuildList(object):
         if tasknames == []:
             tasknames = tasklist
         for n in tasknames:
-            b = Builder(n, tasks[n])
+            b = Builder(n, tasks[n], not options.fail_slowly)
             self.tlist.append(b)
         if options.retry:
-            self.retry = Builder('retry', retry_task)
+            self.retry = Builder('retry', retry_task, not options.fail_slowly)
             self.need_retry = False
 
     def kill_kids(self):
@@ -339,6 +342,8 @@ parser.add_option("", "--always-email", help="always send email, even on success
                   action="store_true")
 parser.add_option("", "--daemon", help="daemonize after initial setup",
                   action="store_true")
+parser.add_option("", "--fail-slowly", help="continue running tests even after one has already failed",
+                  action="store_true")
 
 
 def email_failure(status, failed_task, failed_stage, failed_tag, errstr):