Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Description
This PR adds
lndtest
, a process controller wrappinglnd
, providing typed configuration and optional arguments (similar tolntest
but greatly simplified). This is similar to my PR onbtcd
adding abtcdtest
package (btcsuite/btcd#2360). Having a standard testing format across Lightning (lndtest
,tapdtest
,btcdtest
) is incredibly valuable, greatly easing complexity when writing unit tests and lowering the large amount of boilerplate needed.We've been using this at @JoltzRewards for the past year, frequently tweaking the interface to fit our needs - it has helped us expand our test coverage and testing time by using a process controller instead of a docker-based option like Polar.
^here's an example showing how simple it is to use, only one line of code to create a
lnd
node, create the underlying wallet, wait for it to be ready & connect to it via RPC.This interface is very similar to Go's
net/http/httptest
, whichpanic
s instead of throwingerror
s to simplify.Steps to Test
Test the example in
lndtest/example_test.go
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.