gh-119727: Add --single-process option to regrtest (#119728)

This commit is contained in:
Victor Stinner 2024-06-03 18:34:36 +02:00 committed by GitHub
parent 1d4c2e4a87
commit 4e8aa32245
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 46 additions and 12 deletions

View file

@ -174,6 +174,7 @@ class Namespace(argparse.Namespace):
self.tempdir = None
self._add_python_opts = True
self.xmlpath = None
self.single_process = False
super().__init__(**kwargs)
@ -307,6 +308,12 @@ def _create_parser():
group.add_argument('-j', '--multiprocess', metavar='PROCESSES',
dest='use_mp', type=int,
help='run PROCESSES processes at once')
group.add_argument('--single-process', action='store_true',
dest='single_process',
help='always run all tests sequentially in '
'a single process, ignore -jN option, '
'and failed tests are also rerun sequentially '
'in the same process')
group.add_argument('-T', '--coverage', action='store_true',
dest='trace',
help='turn on code coverage tracing using the trace '
@ -435,6 +442,10 @@ def _parse_args(args, **kwargs):
else:
ns._add_python_opts = False
# --singleprocess overrides -jN option
if ns.single_process:
ns.use_mp = None
# When both --slow-ci and --fast-ci options are present,
# --slow-ci has the priority
if ns.slow_ci: