• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gatewayd-io / gatewayd / 13485346862
60%

Build:
DEFAULT BRANCH: main
Ran 23 Feb 2025 05:48PM UTC
Jobs 1
Files 64
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Feb 2025 05:33PM UTC coverage: 63.036% (+0.2%) from 62.872%
13485346862

push

github

web-flow
Add Raft cluster peer management (GetPeers, AddPeer, RemovePeer) (#663)

* feat(raft): add peer discovery and cluster join functionality

Adds support for automatic peer discovery and cluster joining for non-bootstrap nodes.
Key changes:

- Add AddPeer RPC endpoint to allow nodes to join an existing cluster
- Implement TryConnectToCluster() to handle automatic cluster joining
- Forward AddPeer requests to leader if received by follower
- Add protobuf definitions for AddPeer request/response
- Update .gitignore to exclude raft node data files

This change allows new nodes to automatically discover and join an existing cluster
by attempting to connect to configured peers until successful. Non-leader nodes
will forward join requests to the current leader.

* test: add test cases for Raft AddPeer functionality

Add unit tests to verify the AddPeer behavior in both leader and follower nodes:
- Test successful peer addition when node is leader

* test: enhance TestAddPeer to verify peer addition for leader and follower nodes

- Updated TestAddPeer to include checks for adding peers when the node is a leader and a follower.
- Introduced temporary directories for each node to ensure isolated testing environments.
- Added assertions to confirm that both new peers are successfully integrated into the cluster.
- Improved test reliability by implementing a loop to wait for both nodes to join the cluster before completing the test.

* feat(raft): implement RemovePeer functionality and associated tests

- Added RemovePeer RPC endpoint to the Raft service, allowing nodes to remove peers from the cluster.
- Introduced RemovePeerRequest and RemovePeerResponse message types in the protobuf definitions.
- Updated RaftNode to handle peer removal, including forwarding requests to the leader if the node is not the leader.
- Enhanced the README documentation to include details about the new RemovePeerRequest and RemovePeerResponse.
- Implemented unit tests for the RemovePee... (continued)

692 of 1121 new or added lines in 13 files covered. (61.73%)

7 existing lines in 4 files now uncovered.

5875 of 9320 relevant lines covered (63.04%)

19.16 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
10
80.72
21.75% raft/rpc.go
20
72.39
1.09% api/api.go
41
54.92
-6.06% raft/proto/raft_grpc.pb.go
53
69.96
4.03% raft/proto/raft.pb.go
140
75.03
6.47% raft/raft.go
165
0.0
0.0% raft/proto/raft.pb.gw.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
54.92
-6.06% raft/proto/raft_grpc.pb.go
1
0.0
0.0% raft/proto/raft.pb.gw.go
2
73.33
-4.44% network/stack.go
3
75.03
6.47% raft/raft.go
Jobs
ID Job ID Ran Files Coverage
1 13485346862.1 23 Feb 2025 05:48PM UTC 64
63.04
GitHub Action Run
Source Files on build 13485346862
  • Tree
  • List 64
  • Changed 21
  • Source Changed 0
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • a0d19e54 on github
  • Prev Build on main (#12968731119)
  • Next Build on main (#13485459070)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc