-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: bring examples back into repository and add tests #1092
Conversation
To ease review, this diff shows just changes made to add tests to examples: iand/go-libp2p@iand:integrate-examples...iand:test-examples |
I'm going to take a pass at getting CI coverage of these. |
This example doesn't actually work.
Ok, tested with protocol/.github#89. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this, even though the Unified CI Setup is not done yet. Will fix that soon.
Implements the approach discussed in #1052. Examples are now in a submodule with a replace directive that ensures they will be built using the version of go-libp2p in this repo.
Adds a test harness that enables some of the examples to be run as tests. The test harness reads log output and verifies expected log messages are present. Adding a test to an example is done by extracting the core of the example into a new function that can be called from main and from the harness. I have refactored a couple of examples to use helper functions to make them more amenable to external testing.
Fixes the relay example which was using relay discovery which was deprecated in 2020
Fixes libp2p/go-libp2p-examples#191