incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject git commit: Use all cpus for concurrent test suites if possible
Date Tue, 07 Jan 2014 22:22:06 GMT
Updated Branches:
  refs/heads/master 3d419ecc2 -> b17a9ff2b


Use all cpus for concurrent test suites if possible

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b17a9ff2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b17a9ff2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b17a9ff2

Branch: refs/heads/master
Commit: b17a9ff2b755b7cbba23623897b83aa5ce7381fe
Parents: 3d419ec
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Tue Jan 7 22:21:47 2014 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Tue Jan 7 22:21:47 2014 +0000

----------------------------------------------------------------------
 run_tests | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b17a9ff2/run_tests
----------------------------------------------------------------------
diff --git a/run_tests b/run_tests
index e105040..4180aa9 100755
--- a/run_tests
+++ b/run_tests
@@ -109,16 +109,22 @@ def check_packages(packages):
 
 
 def run_tests_in_parallel(options, nosetests_args):
+    # coverage and multiproc plugins not compatible
+    use_multiproc = '--with-coverage' not in nosetests_args
+
     def get_pkg_path(pkg):
         return ALT_PKG_PATHS.get(pkg, '')
     def get_multiproc_args(pkg):
-        if '--with-coverage' in nosetests_args:
-            # coverage and multiproc plugins not compatible
+        if not use_multiproc:
             return ''
         return ('--processes={procs_per_suite} --process-timeout={proc_timeout}'.format(
                     procs_per_suite=options.concurrent_tests,
                     proc_timeout=PROC_TIMEOUT)
                 if pkg not in NOT_MULTIPROC_SAFE else '')
+    def get_concurrent_suites():
+        if use_multiproc or '-n' in sys.argv:
+            return options.concurrent_suites
+        return CPUS
 
     cmds = []
     for package in check_packages(options.packages):
@@ -131,7 +137,7 @@ def run_tests_in_parallel(options, nosetests_args):
             multiproc_args=get_multiproc_args(package),
         )
         cmds.append((cmd, dict(cwd=package)))
-    return run_many(cmds, processes=options.concurrent_suites)
+    return run_many(cmds, processes=get_concurrent_suites())
 
 
 def parse_args():


Mime
View raw message