Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRe-introduce integration tests for the node #2957
Comments
|
My understanding is that this situation is a typical reference situation for mocking. As long as the tests are kept up-to-date with current functionality on the other end I can't really see an issue with that. It makes sense that they are separated as a wallet requires connecting to a node, but a node doesn't have to connect to a wallet necessarily. From my perspective, the suggestion of moving tests around is a signal that the tests could be better isolated. If I'm understanding correctly, the expected behavior for those aspects in question are defined so mocking should be suitable. Is this accurate? |
|
Mocking is fine in unit tests, the point of integration tests is to check how different components work together, not in isolation. You would end up testing your perfectly behaving mocks. Node does need to connect to wallet to test mining scenarios. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

In the past the node and the wallet were in the same repo. When the wallet was extracted into a separate repo, integration tests were moved to - https://github.com/mimblewimble/grin-wallet/tree/master/integration
It would be beneficial to provide a simple way to run integration suits as part of node tests too.
There are several possible options (there are some other for sure):
grinrepo. Many tests requires wallet functionality too, we could move only tests which don't require wallet, but it doesn't sound great. We could create some mock wallet, not sure if this effort is justified.grinandgrin-walletas submodule. The issue is how to make cargo happy in this case and how to specifygrin-walletdependency ingrinand vice versa.