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

peer: allow external testing of peer.Peer #1698

Merged
merged 1 commit into from
Mar 13, 2021
Merged

peer: allow external testing of peer.Peer #1698

merged 1 commit into from
Mar 13, 2021

Conversation

wpaulino
Copy link
Contributor

The previous use of allowSelfConns prevented this, as users aren't able to invoke peer.TstAllowSelfConns themselves due to being part of a test file, which aren't exported at the library level, leading to a "disconnecting peer connected to self" error upon establishing a mock connection between two peers. By including the option at the config level instead (false by default, prevents connections to self) we enable users of the peer library to properly test the behavior of the peer.Peer struct externally.

The previous use of allowSelfConns prevented this, as users aren't able
to invoke peer.TstAllowSelfConns themselves due to being part of a test
file, which aren't exported at the library level, leading to a
"disconnecting peer connected to self" error upon establishing a mock
connection between two peers. By including the option at the config
level instead (false by default, prevents connections to self) we enable
users of the peer library to properly test the behavior of the peer.Peer
struct externally.
@coveralls
Copy link

coveralls commented Mar 12, 2021

Pull Request Test Coverage Report for Build 644844459

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 52.863%

Files with Coverage Reduction New Missed Lines %
integration/rpctest/utils.go 2 77.65%
Totals Coverage Status
Change from base Build 636275635: 0.02%
Covered Lines: 20929
Relevant Lines: 39591

💛 - Coveralls

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚞

@Roasbeef Roasbeef merged commit 01c6a6f into btcsuite:master Mar 13, 2021
@wpaulino wpaulino deleted the external-peer-testing branch March 29, 2021 23:55
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.

3 participants