gh-139208: Fix regrtest --fast-ci --verbose (#139240)

Don't ignore the --verbose option anymore.
This commit is contained in:
Victor Stinner 2025-09-23 16:09:01 +02:00 committed by GitHub
parent 16eae6d90d
commit dd683f8f34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 3 deletions

View file

@ -464,7 +464,11 @@ def _parse_args(args, **kwargs):
if ns.python is None:
ns.rerun = True
ns.print_slow = True
ns.verbose3 = True
if not ns.verbose:
ns.verbose3 = True
else:
# --verbose has the priority over --verbose3
pass
else:
ns._add_python_opts = False

View file

@ -448,7 +448,8 @@ class ParseArgsTestCase(unittest.TestCase):
return regrtest
def check_ci_mode(self, args, use_resources, *, rerun=True, randomize=True):
def check_ci_mode(self, args, use_resources,
*, rerun=True, randomize=True, output_on_failure=True):
regrtest = self.create_regrtest(args)
self.assertEqual(regrtest.num_workers, -1)
self.assertEqual(regrtest.want_rerun, rerun)
@ -457,7 +458,7 @@ class ParseArgsTestCase(unittest.TestCase):
self.assertIsInstance(regrtest.random_seed, int)
self.assertTrue(regrtest.fail_env_changed)
self.assertTrue(regrtest.print_slowest)
self.assertTrue(regrtest.output_on_failure)
self.assertEqual(regrtest.output_on_failure, output_on_failure)
self.assertEqual(sorted(regrtest.use_resources), sorted(use_resources))
return regrtest
@ -484,6 +485,14 @@ class ParseArgsTestCase(unittest.TestCase):
use_resources.remove('network')
self.check_ci_mode(args, use_resources)
def test_fast_ci_verbose(self):
args = ['--fast-ci', '--verbose']
use_resources = sorted(cmdline.ALL_RESOURCES)
use_resources.remove('cpu')
regrtest = self.check_ci_mode(args, use_resources,
output_on_failure=False)
self.assertEqual(regrtest.verbose, True)
def test_slow_ci(self):
args = ['--slow-ci']
use_resources = sorted(cmdline.ALL_RESOURCES)

View file

@ -0,0 +1,2 @@
Fix regrtest ``--fast-ci --verbose``: don't ignore the ``--verbose`` option
anymore. Patch by Victor Stinner.