You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer, I want to modify the message handling code in peers/ with the safety of unit tests and that have their dependencies minimized so that I have confidence in the changes and the features are easy to write.
Definition of Done:
Unit tests are refactored from peers/handler.rs to a new module responsible for the message handling
Unit tests do not require a full PeerManager/Transport (even test double versions)
Tech Discussion:
The current tests of this code include the full PeerManager which adds other dependent objects that aren’t really necessary for true unit tests. Instead, this behavior can be factored out into a message_handler module that just takes in a message and the required dependencies and verifies the correct state change.
The existing tests don't need a PeerIterator/InitializedNodeProvider, but it will be required to implement the broadcast message features that are still TODO.
End result might look something like this:
#[test]
Fn example_test() {
// create dependencies:
// channel handler spy, route handler stub, Peer
handle_message(XYZ);
// validate spys, stubs, and outbound queues of peers match the expected behavior
}
The text was updated successfully, but these errors were encountered:
As a developer, I want to modify the message handling code in peers/ with the safety of unit tests and that have their dependencies minimized so that I have confidence in the changes and the features are easy to write.
Definition of Done:
Tech Discussion:
The current tests of this code include the full PeerManager which adds other dependent objects that aren’t really necessary for true unit tests. Instead, this behavior can be factored out into a message_handler module that just takes in a message and the required dependencies and verifies the correct state change.
The existing tests don't need a PeerIterator/InitializedNodeProvider, but it will be required to implement the broadcast message features that are still TODO.
End result might look something like this:
The text was updated successfully, but these errors were encountered: