libp2p / go-libp2p-examples

Example libp2p applications
MIT License
339 stars 145 forks source link

Added tests #193

Closed NickEckardt closed 3 years ago

NickEckardt commented 3 years ago

Wrote some rudimentary tests to ensure examples work. The primary goal here is to provide a way to compile and run all examples and check for compile or runtime errors. Tests for correctness of the examples will still need to be done. For example, the chat-with-rendezvous test passes, however chat-with-rendezvous does not work in its current state.

Also, the libp2p-host test fails since libp2p-host currently suffers from a runtime error. Removing references to quic fixes the problem and the test passes. A better solution would be to get quic working instead of just removing it.

Note: This is my first time writing code with go, please let me know if my code isn't idiomatic or if I'm using the testing framework wrong.

jacobheun commented 3 years ago

@aarshkshah1992 can you take a look at this when you have a chance and help shepherd getting the tests in so we can more reliably update the examples?

aarshkshah1992 commented 3 years ago

@jacobheun Sure.

airswing commented 3 years ago

@NickEckardt The binary file libp2p-host/libp2p-host shouldn't be committed.

NickEckardt commented 3 years ago

@eliasmarkc Good catch, fixed.

aarshkshah1992 commented 3 years ago

@NickEckardt Thank you for your PR. The work will be incorporated in a follow-up PR for https://github.com/libp2p/go-libp2p-examples/pull/195 once we have fixed the examples.