lnd
lnd copied to clipboard
itest: start a scaffolding testing framework
This PR introduces an almost new testing framework. To avoid interfering with other PRs and rebasing hell, a new test flag temptest is added so we can run both the new and the old tests together. The migration is done in three phases,
- introduce the package
lntempas the scaffolding while transiting the old tests. - refactor all the old tests with the new framework.
- remove
lntestand rename the packagelntemptolntest.
Notable changes
HarnessRPC, which wraps all the rpc clients and adds a layer ofrequire.NoErrorover all the rpc calls. We want this because often the time the error from the gRPC layer is not something we want to test. By hiding the error check, the test can focus on the state change of a given node. Meanwhile, all the clients inHarnessRPCare exported in case we do want to check the error. This struct is the foundation of everything.HarnessNode, which is responsible for managing the lnd process, grpc connection and wallet auth. In addition, it has three structs,HarnessRPC, manages rpc calls.State, holds an internal state of the node, such as num of open channels, utxos, etc.nodeWatcher, watches the topology updates for the node.
HarnessMiner, stays unchanged except miner-related rpc calls are now managed by it.HarnessTest, which is the assertion machine that manages the interaction among nodes.
A new github action is also added. From now on, the new tests should NOT fail.
This PR replaces #5940(refactor of a refactor🤓), and its following PRs,
- #6776
- #6822
- #6823
- #6824
- #6825
@yyforyongyu, remember to re-request review from reviewers when ready
@yyforyongyu, remember to re-request review from reviewers when ready