[PATCH 2 of 2] run-tests: fix --blacklist with jobs > 1

Idan Kamara idankk86 at gmail.com
Fri May 27 09:47:55 CDT 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1306507608 -10800
# Node ID dcf668e4895dab229e53d91adb4e169c8edb5c64
# Parent  8352979822dba8a7b2eb022d3ab3a13c4568fe86
run-tests: fix --blacklist with jobs > 1

filter blacklisted tests before partitioning them
to the children.

maintains the 'Skipped...' output but not the 's'.

diff -r 8352979822db -r dcf668e4895d tests/run-tests.py
--- a/tests/run-tests.py	Fri May 27 17:46:47 2011 +0300
+++ b/tests/run-tests.py	Fri May 27 17:46:48 2011 +0300
@@ -919,7 +919,11 @@
 
     optcopy = dict(options.__dict__)
     optcopy['jobs'] = 1
+
+    blacklist = optcopy['blacklist'] or []
     del optcopy['blacklist']
+    blacklisted = []
+
     if optcopy['with_hg'] is None:
         optcopy['with_hg'] = os.path.join(BINDIR, "hg")
     optcopy.pop('anycoverage', None)
@@ -941,7 +945,11 @@
         for job in jobs:
             if not tests:
                 break
-            job.append(tests.pop())
+            test = tests.pop()
+            if test in blacklist:
+                blacklisted.append(test)
+            else:
+                job.append(test)
     fps = {}
 
     for j, job in enumerate(jobs):
@@ -979,9 +987,12 @@
         vlog('pid %d exited, status %d' % (pid, status))
         failures |= status
     print
+    skipped += len(blacklisted)
     if not options.noskips:
         for s in skips:
             print "Skipped %s: %s" % (s[0], s[1])
+        for s in blacklisted:
+            print "Skipped %s: blacklisted" % s
     for s in fails:
         print "Failed %s: %s" % (s[0], s[1])
 


More information about the Mercurial-devel mailing list