Skip to content

Commit 6502a13

Browse files
[3.11] regrtest: Prepend 'use' options in --{fast,slow}-ci (pythonGH-110363) (python#110924)
regrtest: Prepend 'use' options in --{fast,slow}-ci (pythonGH-110363) This allows individual resources to be disabled without having to explicitly re-enable all others. (cherry picked from commit b75186f) Co-authored-by: Zachary Ware <[email protected]>
1 parent 616862d commit 6502a13

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
@@ -418,14 +418,16 @@ def _parse_args(args, **kwargs):
418418
# --slow-ci has the priority
419419
if ns.slow_ci:
420420
# Similar to: -u "all" --timeout=1200
421-
if not ns.use:
422-
ns.use = [['all']]
421+
if ns.use is None:
422+
ns.use = []
423+
ns.use.insert(0, ['all'])
423424
if ns.timeout is None:
424425
ns.timeout = 1200 # 20 minutes
425426
elif ns.fast_ci:
426427
# Similar to: -u "all,-cpu" --timeout=600
427-
if not ns.use:
428-
ns.use = [['all', '-cpu']]
428+
if ns.use is None:
429+
ns.use = []
430+
ns.use.insert(0, ['all', '-cpu'])
429431
if ns.timeout is None:
430432
ns.timeout = 600 # 10 minutes
431433

Lib/test/test_regrtest.py

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

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

424426
def test_slow_ci(self):

0 commit comments

Comments
 (0)