Improves test coverage of cwtch_peer.go [#53] #88

Merged
sarah merged 1 commits from gpestana/cwtch:peer-test-coverage into master 2018-07-05 16:50:42 +00:00
Contributor

WIP

This aims at improving test coverage of cwtch_peer.go

**WIP** This aims at improving test coverage of cwtch_peer.go
sarah closed this pull request 2018-07-04 20:52:28 +00:00
sarah reopened this pull request 2018-07-04 20:52:31 +00:00
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/108
Owner

This looks great. It's marked as WIP did you have any more you wanted to add to it?

This looks great. It's marked as WIP did you have any more you wanted to add to it?
Author
Contributor

Thanks! Yes, I'm planning to improve the test coverage a bit more by testing:

  • TrustPeer, BlockPeer, AcceptInvite and RejectInvite
  • JoinServer, SendMessageToGroup
  • Listen, Shutdown

I'm trying now to start/mock peer connections between alice and bob so that those methods can be tests. Do you think I should use the same approach as in ./peerpeerconnection_test.go or should I try to mock the p2p connections?

Thanks! Yes, I'm planning to improve the test coverage a bit more by testing: - `TrustPeer`, `BlockPeer`, `AcceptInvite` and `RejectInvite` - `JoinServer`, `SendMessageToGroup` - `Listen`, `Shutdown` I'm trying now to start/mock peer connections between alice and bob so that those methods can be tests. Do you think I should use the same approach as in `./peerpeerconnection_test.go` or should I try to mock the p2p connections?
Owner

Awesome! The approach used in peerpeerconnection_test.go is probably the way to go. Mocking connections gets a bit tricky right now because of the underlying interfaces (it would requite some refactoring in libricochet-go.

Are you OK with me merging this test? Or did you want to update it with more tests later?

Awesome! The approach used in `peerpeerconnection_test.go` is probably the way to go. Mocking connections gets a bit tricky right now because of the underlying interfaces (it would requite some refactoring in `libricochet-go`. Are you OK with me merging this test? Or did you want to update it with more tests later?
Author
Contributor

Sounds good, I'll do it that way.

And yes, please go ahead and merge the PR. I'll create a new one after.

Sounds good, I'll do it that way. And yes, please go ahead and merge the PR. I'll create a new one after.
sarah closed this pull request 2018-07-05 16:50:41 +00:00
Owner

ok cwtch.im/cwtch/peer 0.292s coverage: 57.6% of statements

awesome!

ok cwtch.im/cwtch/peer 0.292s coverage: 57.6% of statements awesome!
Sign in to join this conversation.
No description provided.