cfg: restore exec_wrapper and devtools config vars

This commit is contained in:
The MMGen Project 2026-10-05 14:30:05 +00:00
commit 3d435165a7
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
9 changed files with 14 additions and 14 deletions

View file

@ -211,6 +211,8 @@ class Config(Lockable):
debug_subseed = False
debug_tw = False
traceback = False
exec_wrapper = False
devtools = False
# rpc:
rpc_host = ''
@ -335,8 +337,10 @@ class Config(Lockable):
'MMGEN_DEBUG_RPC',
'MMGEN_DEBUG_SUBSEED',
'MMGEN_DEBUG_TW',
'MMGEN_DEVTOOLS',
'MMGEN_DISABLE_COLOR',
'MMGEN_ENABLE_ERIGON',
'MMGEN_EXEC_WRAPPER',
'MMGEN_FORCE_256_COLOR',
'MMGEN_HTTP_TIMEOUT',
'MMGEN_IGNORE_DAEMON_VERSION',

View file

@ -66,7 +66,7 @@ def launch(*, mod=None, func=None, fqmod=None, package='mmgen'):
e = e))
+ '\n')
if os.getenv('MMGEN_TEST_SUITE_EXEC_WRAPPER') or os.getenv('MMGEN_TRACEBACK'):
if os.getenv('MMGEN_EXEC_WRAPPER') or os.getenv('MMGEN_TRACEBACK'):
raise
sys.exit(d.exit_val)

View file

@ -35,7 +35,7 @@ def exec_wrapper_init():
else:
exec_wrapper_sys.path.pop(0)
exec_wrapper_os.environ['MMGEN_TEST_SUITE_EXEC_WRAPPER'] = '1'
exec_wrapper_os.environ['MMGEN_EXEC_WRAPPER'] = '1'
def exec_wrapper_write_traceback(e, exit_val):
@ -142,7 +142,7 @@ if exec_wrapper_os.getenv('MMGEN_TRACEMALLOC'):
exec_wrapper_tracemalloc_setup()
# import mmgen mods only after sys.path[0] is set to overlay root!
if exec_wrapper_os.getenv('MMGEN_TEST_SUITE_DEVTOOLS'):
if exec_wrapper_os.getenv('MMGEN_DEVTOOLS'):
from mmgen.devinit import init_dev as exec_wrapper_init_dev
exec_wrapper_init_dev()

View file

@ -318,7 +318,7 @@ if __name__ == '__main__':
die(1, yellow('\ntest.py exiting at user request'))
except TestSuiteSpawnedScriptException as e:
# if spawned script is not running under exec_wrapper, output brief error msg:
if os.getenv('MMGEN_TEST_SUITE_EXEC_WRAPPER'):
if os.getenv('MMGEN_EXEC_WRAPPER'):
Msg(red(str(e)))
Msg(blue('cmdtest.py: spawned script exited with error'))
if hasattr(tr, 'tg'):
@ -332,6 +332,6 @@ if __name__ == '__main__':
del tr.tg
del tr
# if cmdtest.py itself is running under exec_wrapper, re-raise so wrapper can handle exception:
if os.getenv('MMGEN_TEST_SUITE_EXEC_WRAPPER') or not os.getenv('MMGEN_TEST_SUITE_IGNORE_TEST_PY_EXCEPTION'):
if os.getenv('MMGEN_EXEC_WRAPPER') or not os.getenv('MMGEN_TEST_SUITE_IGNORE_TEST_PY_EXCEPTION'):
raise
die(1, red('Test script exited with error'))

View file

@ -64,7 +64,7 @@ class CmdTestRunner:
self.skipped_warnings = []
self.resume_cmd = None
self.deps_only = None
self.logging = self.cfg.log or os.getenv('MMGEN_TEST_SUITE_EXEC_WRAPPER')
self.logging = self.cfg.log or os.getenv('MMGEN_EXEC_WRAPPER')
self.testing_segwit = cfg.segwit or cfg.segwit_random or cfg.bech32
self.network_id = self.proto.coin.lower() + ('_tn' if self.proto.testnet else '')
self.daemon_started = False
@ -114,7 +114,7 @@ class CmdTestRunner:
'MMGEN_TEST_SUITE_PEXPECT': '1',
'EXEC_WRAPPER_DO_RUNTIME_MSG':'1',
# if cmdtest.py itself is running under exec_wrapper, disable writing of traceback file for spawned script
'EXEC_WRAPPER_TRACEBACK': '' if os.getenv('MMGEN_TEST_SUITE_EXEC_WRAPPER') else '1'})
'EXEC_WRAPPER_TRACEBACK': '' if os.getenv('MMGEN_EXEC_WRAPPER') else '1'})
if self.cfg.dev_mode:
self.spawn_env.update({

View file

@ -25,6 +25,6 @@ os.environ['PYTHONPATH'] = overlay_root
if 'TMUX' in os.environ:
del os.environ['TMUX']
if os.getenv('MMGEN_TEST_SUITE_DEVTOOLS'):
if os.getenv('MMGEN_DEVTOOLS'):
from mmgen.devinit import init_dev
init_dev()

View file

@ -26,7 +26,7 @@ os.environ['MMGEN_TEST_SUITE_LEGACY_TX'] = '1'
from .test_init import repo_root
if not os.getenv('MMGEN_TEST_SUITE_DEVTOOLS'):
if not os.getenv('MMGEN_DEVTOOLS'):
from mmgen.devinit import init_dev
init_dev()

View file

@ -30,7 +30,7 @@ except ImportError:
# for objtest, violate MMGen Project best practices and allow use of the dev tools
# in production code:
from mmgen.devtools import pmsg
if not os.getenv('MMGEN_TEST_SUITE_DEVTOOLS'):
if not os.getenv('MMGEN_DEVTOOLS'):
from mmgen.devinit import init_dev
init_dev()

View file

@ -40,12 +40,10 @@ for k, v in {
# these are referenced in test suite only:
'test_suite_autosign_led_simulate': False,
'test_suite_exec_wrapper': False,
'test_suite_bogus_unspent_data': '',
'test_suite_debug_utf8': False,
'test_suite_deterministic': False,
'test_suite_devnet_block_period': 0,
'test_suite_devtools': False,
'test_suite_enable_color': False,
'test_suite_enable_user_port_shift': False,
'test_suite_ignore_test_py_exception': False,
@ -66,10 +64,8 @@ Config._env_opts += (
'MMGEN_TEST_SUITE_DEBUG_UTF8',
'MMGEN_TEST_SUITE_DETERMINISTIC',
'MMGEN_TEST_SUITE_DEVNET_BLOCK_PERIOD',
'MMGEN_TEST_SUITE_DEVTOOLS',
'MMGEN_TEST_SUITE_ENABLE_COLOR',
'MMGEN_TEST_SUITE_ENABLE_USER_PORT_SHIFT',
'MMGEN_TEST_SUITE_EXEC_WRAPPER', # main - using os.getenv() - OK
'MMGEN_TEST_SUITE_HOLD_PROTECT_DISABLE',
'MMGEN_TEST_SUITE_IGNORE_TEST_PY_EXCEPTION',
'MMGEN_TEST_SUITE_LEGACY_TX',