From d8c564537f644e7409df300fd6113fd8070d7521 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 10 Oct 2021 20:18:13 +0000 Subject: [PATCH] minor cleanups and changes --- mmgen/daemon.py | 2 +- test/test.py | 51 ++++++++++------------------------ test/test_py_d/ts_xmrwallet.py | 2 +- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/mmgen/daemon.py b/mmgen/daemon.py index 272e42a2..7792294a 100755 --- a/mmgen/daemon.py +++ b/mmgen/daemon.py @@ -696,7 +696,7 @@ class parity_daemon(openethereum_daemon): exec_fn = 'parity' class geth_daemon(ethereum_daemon): - daemon_data = _dd('Geth', 1010007, '1.10.7') + daemon_data = _dd('Geth', 1010009, '1.10.9') version_pat = r'Geth/v(\d+)\.(\d+)\.(\d+)' exec_fn = 'geth' use_pidfile = False diff --git a/test/test.py b/test/test.py index eb7aa843..0fefd22f 100755 --- a/test/test.py +++ b/test/test.py @@ -148,26 +148,6 @@ if not ('resume' in _uopts or 'skip_deps' in _uopts): try: os.unlink(data_dir) except: pass -def add_cmdline_opts(): - """ - These are set automatically now when g.test_suite == True: - --data-dir in opts.init() - --daemon-data-dir and --rpc-port by CoinDaemon() - """ - def get_coin(): - return (_uopts.get('coin') or 'btc').lower() - - network_id = get_coin().lower() + ('_tn' if _uopts.get('testnet') else '') - - sys.argv.insert(1,'--data-dir=' + data_dir) - sys.argv.insert(1,'--daemon-data-dir=test/daemons/' + get_coin()) - from mmgen.daemon import CoinDaemon - sys.argv.insert(1,'--rpc-port={}'.format( - CoinDaemon(network_id,test_suite=True).rpc_port - )) - -# add_cmdline_opts() - opts.UserOpts._reset_ok += ('skip_deps','no_daemon_autostart','names','no_timings') # step 2: opts.init will create new data_dir in ./test (if not 'resume' or 'skip_deps'): @@ -656,8 +636,11 @@ class TestSuiteRunner(object): self.log_fd = None if opt.coverage: - self.coverdir,self.accfile = init_coverage() - omsg(f'INFO → Writing coverage files to {self.coverdir!r}') + coverdir,accfile = init_coverage() + omsg(f'INFO → Writing coverage files to {coverdir!r}') + self.pre_args = ['python3','-m','trace','--count','--coverdir='+coverdir,'--file='+accfile] + else: + self.pre_args = ['python3'] if g.platform == 'win' else [] if opt.pexpect_spawn: omsg(f'INFO → Using pexpect.spawn() for real terminal emulation') @@ -675,18 +658,17 @@ class TestSuiteRunner(object): if extra_desc: desc += ' ' + extra_desc - if not opt.system: - cmd = os.path.relpath(os.path.join(repo_root,cmd_dir,cmd)) - elif g.platform == 'win': - cmd = os.path.join('/mingw64','opt','bin',cmd) + cmd_path = ( + cmd if opt.system # opt.system is broken for main test group with overlay tree + else os.path.relpath(os.path.join(repo_root,cmd_dir,cmd)) ) - args = [cmd] + self.passthru_opts + self.ts.extra_spawn_args + args - - if not no_exec_wrapper: - args = ['scripts/exec_wrapper.py'] + args - - if g.platform == 'win': - args = ['python3'] + args + args = ( + self.pre_args + + ([] if no_exec_wrapper else ['scripts/exec_wrapper.py']) + + [cmd_path] + + self.passthru_opts + + self.ts.extra_spawn_args + + args ) for i in args: if not isinstance(i,str): @@ -694,9 +676,6 @@ class TestSuiteRunner(object): self.ts.test_name, args )) - if opt.coverage: - args = ['python3','-m','trace','--count','--coverdir='+self.coverdir,'--file='+self.accfile] + args - qargs = ['{q}{}{q}'.format( a, q = "'" if ' ' in a else '' ) for a in args] cmd_disp = ' '.join(qargs).replace('\\','/') # for mingw diff --git a/test/test_py_d/ts_xmrwallet.py b/test/test_py_d/ts_xmrwallet.py index caa68523..16732906 100755 --- a/test/test_py_d/ts_xmrwallet.py +++ b/test/test_py_d/ts_xmrwallet.py @@ -158,7 +158,7 @@ class TestSuiteXMRWallet(TestSuiteBase): 3. Exit the test here, start the SSH SOCKS proxy manually by entering the following command, and restart the test: - {' '.join(a+b2)} + {' '.join(a+b2)} """,indent=' ',strip_char='\t')) if keypress_confirm('Continue?'):