gh-137242: Add a --no-randomize option, and use it in Android CI (#13… · python/cpython@01895d2 · GitHub
Skip to content

Commit 01895d2

Browse files
vstinnermhsmith
andauthored
gh-137242: Add a --no-randomize option, and use it in Android CI (#138649)
Adds a --no-randomize option to the CI runner, so that randomisation can be easily disabled for --fast-ci and --slow-ci configurations on single-threaded testing platforms like Android, iOS, and Emscripten. --------- Co-authored-by: Malcolm Smith <smith@chaquo.com>
1 parent 22cb9ba commit 01895d2

3 files changed

Lines changed: 40 additions & 7 deletions

File tree

Android/android.py

Lines changed: 3 additions & 5 deletions

Lib/test/libregrtest/cmdline.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ def _create_parser():
271271
group = parser.add_argument_group('Selecting tests')
272272
group.add_argument('-r', '--randomize', action='store_true',
273273
help='randomize test execution order.' + more_details)
274+
group.add_argument('--no-randomize', dest='no_randomize', action='store_true',
275+
help='do not randomize test execution order, even if '
276+
'it would be implied by another option')
274277
group.add_argument('--prioritize', metavar='TEST1,TEST2,...',
275278
action='append', type=priority_list,
276279
help='select these tests first, even if the order is'
@@ -539,6 +542,8 @@ def _parse_args(args, **kwargs):
539542
ns.use_resources.append(r)
540543
if ns.random_seed is not None:
541544
ns.randomize = True
545+
if ns.no_randomize:
546+
ns.randomize = False
542547
if ns.verbose:
543548
ns.header = True
544549

Lib/test/test_regrtest.py

Lines changed: 32 additions & 2 deletions

0 commit comments

Comments
 (0)