Skip to content

Commit b75186f

Browse files
authored
regrtest: Prepend 'use' options in --{fast,slow}-ci (GH-110363)
This allows individual resources to be disabled without having to explicitly re-enable all others.
1 parent 42a5d21 commit b75186f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Lib/test/libregrtest/cmdline.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,16 @@ def _parse_args(args, **kwargs):
417417
# --slow-ci has the priority
418418
if ns.slow_ci:
419419
# Similar to: -u "all" --timeout=1200
420-
if not ns.use:
421-
ns.use = [['all']]
420+
if ns.use is None:
421+
ns.use = []
422+
ns.use.insert(0, ['all'])
422423
if ns.timeout is None:
423424
ns.timeout = 1200 # 20 minutes
424425
elif ns.fast_ci:
425426
# Similar to: -u "all,-cpu" --timeout=600
426-
if not ns.use:
427-
ns.use = [['all', '-cpu']]
427+
if ns.use is None:
428+
ns.use = []
429+
ns.use.insert(0, ['all', '-cpu'])
428430
if ns.timeout is None:
429431
ns.timeout = 600 # 10 minutes
430432

Lib/test/test_regrtest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,11 @@ def test_fast_ci_python_cmd(self):
415415
self.assertEqual(regrtest.python_cmd, ('python', '-X', 'dev'))
416416

417417
def test_fast_ci_resource(self):
418-
# it should be possible to override resources
419-
args = ['--fast-ci', '-u', 'network']
420-
use_resources = ['network']
418+
# it should be possible to override resources individually
419+
args = ['--fast-ci', '-u-network']
420+
use_resources = sorted(cmdline.ALL_RESOURCES)
421+
use_resources.remove('cpu')
422+
use_resources.remove('network')
421423
self.check_ci_mode(args, use_resources)
422424

423425
def test_slow_ci(self):

0 commit comments

Comments
 (0)