Skip to content

Commit

Permalink
regrtest: Prepend 'use' options in --{fast,slow}-ci (pythonGH-110363)
Browse files Browse the repository at this point in the history
This allows individual resources to be disabled without having to explicitly re-enable all others.
  • Loading branch information
zware committed Oct 15, 2023
1 parent 42a5d21 commit b75186f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions Lib/test/libregrtest/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,16 @@ def _parse_args(args, **kwargs):
# --slow-ci has the priority
if ns.slow_ci:
# Similar to: -u "all" --timeout=1200
if not ns.use:
ns.use = [['all']]
if ns.use is None:
ns.use = []
ns.use.insert(0, ['all'])
if ns.timeout is None:
ns.timeout = 1200 # 20 minutes
elif ns.fast_ci:
# Similar to: -u "all,-cpu" --timeout=600
if not ns.use:
ns.use = [['all', '-cpu']]
if ns.use is None:
ns.use = []
ns.use.insert(0, ['all', '-cpu'])
if ns.timeout is None:
ns.timeout = 600 # 10 minutes

Expand Down
8 changes: 5 additions & 3 deletions Lib/test/test_regrtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,11 @@ def test_fast_ci_python_cmd(self):
self.assertEqual(regrtest.python_cmd, ('python', '-X', 'dev'))

def test_fast_ci_resource(self):
# it should be possible to override resources
args = ['--fast-ci', '-u', 'network']
use_resources = ['network']
# it should be possible to override resources individually
args = ['--fast-ci', '-u-network']
use_resources = sorted(cmdline.ALL_RESOURCES)
use_resources.remove('cpu')
use_resources.remove('network')
self.check_ci_mode(args, use_resources)

def test_slow_ci(self):
Expand Down

0 comments on commit b75186f

Please sign in to comment.