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

cmd: alpha test peers - add direct connection test #3073

Merged
merged 4 commits into from
May 14, 2024

Conversation

KaloyanTanev
Copy link
Contributor

@KaloyanTanev KaloyanTanev commented May 7, 2024

Adding test for direct connection between peers. This should also implicitly test if our NAT is open.

There is a separate ticket for unit testing for all peers tests, as there are more things to be improved on that side - there need to be couple of nodes spin up, with local relay, to be able to properly test the testpeers.go code. As soon as that is done, there will be better testing suite for that test case as well.

To try locally, a local relay needs to be spin up first (or expose your IP and port, however, the former is easier):
./charon relay --p2p-tcp-address="0.0.0.0:9000" --p2p-advertise-private-addresses
./charon alpha test peers --enrs="enr:-Iu4QJyserRukhG0Vgi2csu7GjpHYUGufNEbZ8Q7ZBrcZUb0KqpL5QzHonkh1xxHlxatTxrIcX_IS5J3SEWR_sa0ptGAgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQMAUgEqczOjevyculnUIofhCj0DkgJudErM7qCYIvIkzIN0Y3CCDhqDdWRwgg4u" --p2p-relays="http://127.0.0.1:3640" --p2p-tcp-address="127.0.0.1:9001" --load-test-duration=30s

I have also included small refactor of the return statements, making it a bit more readable.

category: feature
ticket: #3065

@KaloyanTanev KaloyanTanev marked this pull request as draft May 7, 2024 20:37
@KaloyanTanev KaloyanTanev self-assigned this May 7, 2024
Copy link

codecov bot commented May 7, 2024

Codecov Report

Attention: Patch coverage is 8.57143% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 56.43%. Comparing base (3e41eba) to head (5d4641e).
Report is 4 commits behind head on main.

Files Patch % Lines
cmd/testpeers.go 8.57% 32 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3073      +/-   ##
==========================================
- Coverage   56.49%   56.43%   -0.06%     
==========================================
  Files         208      208              
  Lines       29020    29026       +6     
==========================================
- Hits        16395    16381      -14     
- Misses      10805    10826      +21     
+ Partials     1820     1819       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@boulder225 boulder225 added the protocol Protocol Team tickets label May 8, 2024
@KaloyanTanev KaloyanTanev force-pushed the kalo/peers-test-direct-connection branch from d513538 to 9f4f6db Compare May 8, 2024 11:46
@KaloyanTanev KaloyanTanev marked this pull request as ready for review May 8, 2024 11:58
@KaloyanTanev KaloyanTanev requested a review from gsora May 8, 2024 11:59
@KaloyanTanev KaloyanTanev force-pushed the kalo/peers-test-direct-connection branch from c0cac3e to 65afd04 Compare May 10, 2024 16:00
Copy link

sonarcloud bot commented May 13, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@KaloyanTanev KaloyanTanev added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 14, 2024
@obol-bulldozer obol-bulldozer bot merged commit 9c65c8d into main May 14, 2024
12 checks passed
@obol-bulldozer obol-bulldozer bot deleted the kalo/peers-test-direct-connection branch May 14, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass protocol Protocol Team tickets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants