Skip to content

gh-109566: regrtest doesn't enable --rerun if --python is used #109969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/test/libregrtest/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ def _parse_args(args, **kwargs):
ns.randomize = True
ns.fail_env_changed = True
ns.fail_rerun = True
ns.rerun = True
if ns.python is None:
ns.rerun = True
ns.print_slow = True
ns.verbose3 = True
if MS_WINDOWS:
Expand Down
12 changes: 10 additions & 2 deletions Lib/test/test_regrtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def test_unknown_option(self):
self.checkError(['--unknown-option'],
'unrecognized arguments: --unknown-option')

def check_ci_mode(self, args, use_resources):
def check_ci_mode(self, args, use_resources, rerun=True):
ns = cmdline._parse_args(args)
if utils.MS_WINDOWS:
self.assertTrue(ns.nowindows)
Expand All @@ -383,7 +383,7 @@ def check_ci_mode(self, args, use_resources):
# which has an unclear API
regrtest = main.Regrtest(ns)
self.assertEqual(regrtest.num_workers, -1)
self.assertTrue(regrtest.want_rerun)
self.assertEqual(regrtest.want_rerun, rerun)
self.assertTrue(regrtest.randomize)
self.assertIsNone(regrtest.random_seed)
self.assertTrue(regrtest.fail_env_changed)
Expand All @@ -400,6 +400,14 @@ def test_fast_ci(self):
regrtest = self.check_ci_mode(args, use_resources)
self.assertEqual(regrtest.timeout, 10 * 60)

def test_fast_ci_python_cmd(self):
args = ['--fast-ci', '--python', 'python -X dev']
use_resources = sorted(cmdline.ALL_RESOURCES)
use_resources.remove('cpu')
regrtest = self.check_ci_mode(args, use_resources, rerun=False)
self.assertEqual(regrtest.timeout, 10 * 60)
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']
Expand Down