simperby
simperby copied to clipboard
Define unit tests for peer discovery without internet
It seems we have two options when running the tests on the same machine:
- to create multiple r/w streams in the same (OS) process and let them communicate with each other
- to create a single r/w stream in the binary but spawn multiple processes to have separated nodes
The first choice is easier to code, however, the second one is more desirable since we can have logically separated nodes, which resemble the nodes in a local private network.
I think we will have bunch of e2e tests that covers the second options. Let's stick to the first one so that we can focus on the 'logic', not the lower level network issues.
Basic tests for bootstrapping are included in #41. I plan to add more tests for continuous peer discovery.
The interface for the network module has been changed. Thus, the network developers(including me) should make new unit tests for the new interface.