D5557: testrunner: make `-j100 --runs-per-test=100 test-foo.t` use 100 jobs

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jan 10 17:42:49 EST 2019


martinvonz updated this revision to Diff 13152.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5557?vs=13151&id=13152

REVISION DETAIL
  https://phab.mercurial-scm.org/D5557

AFFECTED FILES
  tests/run-tests.py
  tests/test-run-tests.t

CHANGE DETAILS

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -716,6 +716,12 @@
 (delete the duplicated test file)
   $ rm test-failure-copy.t
 
+multiple runs per test should be parallelized
+
+  $ rt --jobs 2 --runs-per-test 2 test-success.t
+  running 2 tests using 2 parallel processes 
+  ..
+  # Ran 2 tests, 0 skipped, 0 failed.
 
 Interactive run
 ===============
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2859,8 +2859,9 @@
                     testdescs = orig
 
             tests = [self._gettest(d, i) for i, d in enumerate(testdescs)]
-
-            jobs = min(len(tests), self.options.jobs)
+            num_tests = len(tests) * self.options.runs_per_test
+
+            jobs = min(num_tests, self.options.jobs)
 
             failed = False
             kws = self.options.keywords
@@ -2897,7 +2898,7 @@
                     self._installchg()
 
                 log('running %d tests using %d parallel processes' % (
-                    len(tests), jobs))
+                    num_tests, jobs))
 
                 result = runner.run(suite)
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list