comparison tests/run-tests.py @ 44619:78a8f65eacc8

run-tests: add --chg-debug flag to show chg debug output This has helped me a lot in debugging chg failures in tests.
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 25 Mar 2020 13:20:08 +0530
parents f8427841c8fc
children 82543879b48e
comparison
equal deleted inserted replaced
44618:7f9538a3b29e 44619:78a8f65eacc8
529 hgconf.add_argument( 529 hgconf.add_argument(
530 "--chg", 530 "--chg",
531 action="store_true", 531 action="store_true",
532 help="install and use chg wrapper in place of hg", 532 help="install and use chg wrapper in place of hg",
533 ) 533 )
534 hgconf.add_argument(
535 "--chg-debug", action="store_true", help="show chg debug logs",
536 )
534 hgconf.add_argument("--compiler", help="compiler to build with") 537 hgconf.add_argument("--compiler", help="compiler to build with")
535 hgconf.add_argument( 538 hgconf.add_argument(
536 '--extra-config-opt', 539 '--extra-config-opt',
537 action="append", 540 action="append",
538 default=[], 541 default=[],
922 extraconfigopts=None, 925 extraconfigopts=None,
923 shell=None, 926 shell=None,
924 hgcommand=None, 927 hgcommand=None,
925 slowtimeout=None, 928 slowtimeout=None,
926 usechg=False, 929 usechg=False,
930 chgdebug=False,
927 useipv6=False, 931 useipv6=False,
928 ): 932 ):
929 """Create a test from parameters. 933 """Create a test from parameters.
930 934
931 path is the full path to the file defining the test. 935 path is the full path to the file defining the test.
977 self._startport = startport 981 self._startport = startport
978 self._extraconfigopts = extraconfigopts or [] 982 self._extraconfigopts = extraconfigopts or []
979 self._shell = _sys2bytes(shell) 983 self._shell = _sys2bytes(shell)
980 self._hgcommand = hgcommand or b'hg' 984 self._hgcommand = hgcommand or b'hg'
981 self._usechg = usechg 985 self._usechg = usechg
986 self._chgdebug = chgdebug
982 self._useipv6 = useipv6 987 self._useipv6 = useipv6
983 988
984 self._aborted = False 989 self._aborted = False
985 self._daemonpids = [] 990 self._daemonpids = []
986 self._finished = None 991 self._finished = None
1415 if k.startswith('HG_'): 1420 if k.startswith('HG_'):
1416 del env[k] 1421 del env[k]
1417 1422
1418 if self._usechg: 1423 if self._usechg:
1419 env['CHGSOCKNAME'] = os.path.join(self._chgsockdir, b'server') 1424 env['CHGSOCKNAME'] = os.path.join(self._chgsockdir, b'server')
1425 if self._chgdebug:
1426 env['CHGDEBUG'] = 'true'
1420 1427
1421 return env 1428 return env
1422 1429
1423 def _createhgrc(self, path): 1430 def _createhgrc(self, path):
1424 """Create an hgrc file for this test.""" 1431 """Create an hgrc file for this test."""
3384 startport=self._getport(count), 3391 startport=self._getport(count),
3385 extraconfigopts=self.options.extra_config_opt, 3392 extraconfigopts=self.options.extra_config_opt,
3386 shell=self.options.shell, 3393 shell=self.options.shell,
3387 hgcommand=self._hgcommand, 3394 hgcommand=self._hgcommand,
3388 usechg=bool(self.options.with_chg or self.options.chg), 3395 usechg=bool(self.options.with_chg or self.options.chg),
3396 chgdebug=self.options.chg_debug,
3389 useipv6=useipv6, 3397 useipv6=useipv6,
3390 **kwds 3398 **kwds
3391 ) 3399 )
3392 t.should_reload = True 3400 t.should_reload = True
3393 return t 3401 return t