mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
pytest: Allow a specific lightningd for DEBUG_SUBD
e.g. "lightningd-1:xpay" or even "1:xpay" means it will only apply to l1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
611e430754
commit
99cc81b90a
@ -792,8 +792,16 @@ class LightningNode(object):
|
||||
# Don't run --version on every subdaemon if we're valgrinding and slow.
|
||||
if SLOW_MACHINE and VALGRIND:
|
||||
self.daemon.opts["dev-no-version-checks"] = None
|
||||
if os.getenv("DEBUG_SUBD"):
|
||||
self.daemon.opts["dev-debugger"] = os.getenv("DEBUG_SUBD")
|
||||
dbgvar = os.getenv("DEBUG_SUBD")
|
||||
if dbgvar and ':' in dbgvar:
|
||||
path = dbgvar.split(':')[0]
|
||||
if lightning_dir.endswith(path + '/'):
|
||||
dbgvar = dbgvar.split(':')[-1]
|
||||
else:
|
||||
dbgvar = None
|
||||
|
||||
if dbgvar:
|
||||
self.daemon.opts["dev-debugger"] = dbgvar
|
||||
if os.getenv("DEBUG_LIGHTNINGD"):
|
||||
self.daemon.opts["dev-debug-self"] = None
|
||||
if valgrind:
|
||||
|
@ -41,7 +41,7 @@ There are four kinds of tests:
|
||||
|
||||
`PYTHONPATH=contrib/pyln-client:contrib/pyln-testing:contrib/pyln-proto:contrib/pyln-grpc-proto py.test -v tests/`
|
||||
|
||||
You can also append `-k TESTNAME` to run a single test. Environment variables `DEBUG_SUBD=<subdaemon>` and `TIMEOUT=<seconds>` can be useful for debugging subdaemons on individual tests, and `DEBUG_LIGHTNINGD` for attaching a debugger to each `lightningd` instance created.
|
||||
You can also append `-k TESTNAME` to run a single test. Environment variables `DEBUG_SUBD=[<path>:]<subdaemon>` (where path must match the end of the lightning daemon path, for matching only one of several lightningd instances) and `TIMEOUT=<seconds>` can be useful for debugging subdaemons on individual tests, and `DEBUG_LIGHTNINGD` for attaching a debugger to each `lightningd` instance created.
|
||||
|
||||
Alternatively, to run a specific test via the `Makefile`, you can specify the test by setting the environment variable `PYTEST_TESTS`:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user