Skip to content
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

Merged
merged 10 commits into from
May 12, 2021
Merged

chore: bring examples back into repository and add tests #1092

merged 10 commits into from
May 12, 2021

Conversation

iand
Copy link
Contributor

@iand iand commented May 7, 2021

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

@iand
Copy link
Contributor Author

iand commented May 7, 2021

To ease review, this diff shows just changes made to add tests to examples: iand/go-libp2p@iand:integrate-examples...iand:test-examples

.gitignore Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/.circleci/config.yml Outdated Show resolved Hide resolved
examples/.travis.yml Outdated Show resolved Hide resolved
examples/LICENSE Outdated Show resolved Hide resolved
examples/multipro/echo.go Outdated Show resolved Hide resolved
examples/go.mod Outdated Show resolved Hide resolved
examples/multipro/ping.go Outdated Show resolved Hide resolved
examples/multipro/node.go Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@Stebalien
Copy link
Member

I'm going to take a pass at getting CI coverage of these.

@Stebalien
Copy link
Member

Ok, tested with protocol/.github#89.

@BigLep BigLep requested a review from marten-seemann May 12, 2021 00:40
Copy link
Contributor

@marten-seemann marten-seemann left a 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.

@marten-seemann marten-seemann merged commit 52d3e89 into libp2p:master May 12, 2021
@BigLep BigLep mentioned this pull request May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automated testing
3 participants