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

login
register
mail settings
Submitter phabricator
Date Jan. 11, 2019, 12:07 a.m.
Message ID <ab4f8b5e58e63906c9d69bc6f41700ac@localhost.localdomain>
Download mbox | patch
Permalink /patch/37641/
State Not Applicable
Headers show

Comments

phabricator - Jan. 11, 2019, 12:07 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG53327bfbf35d: testrunner: make `-j100 --runs-per-test=100 test-foo.t` use 100 jobs (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

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

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

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

CHANGE DETAILS




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

Patch

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)