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

269 update core proto #346

Merged
merged 4 commits into from
Apr 4, 2018
Merged

269 update core proto #346

merged 4 commits into from
Apr 4, 2018

Conversation

JonasVautherin
Copy link
Collaborator

@JonasVautherin JonasVautherin commented Apr 4, 2018

This PR implements SubscribeDiscover and SubscribeTimeout for the core module.

Fixes #269.

Copy link
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

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

Looks good. I'm amazed how much code and tests this requires 😲.

_core_service->stop();
uuids_stream_future.wait();

EXPECT_EQ(3, uuids.size());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick, this would have to be an ASSERT_EQ because the at() below will fail otherwise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point :)


std::future<void> CoreServiceImplTest::subscribeTimeoutAsync(int *stream_count)
{
return std::async(std::launch::async, [this, stream_count]() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, I didn't know `std::launch::async.

@JonasVautherin JonasVautherin force-pushed the 269-update-core-proto branch from 7e9d701 to 33d8aa8 Compare April 4, 2018 09:20
@JonasVautherin
Copy link
Collaborator Author

Well, 13 unit tests for 3 rpc functions, that doesn't sound excessive to me :-). For gRPC streams, it requires quite some code because I run an in-process server.

Also, only the public interface is unit tested, so that should be quite stable. If the tests ever need big changes, it will mean that the public interface changed, and in this case I find it reasonable to have to change the tests.

I know it may seem like a lot of tests, but I am quite confident now that the code is doing what I expect it to do (even though it doesn't mean it is completely bug-free). If somebody ever refactors the code without breaking the tests, I will be confident that the refactoring is correct. And finally, I believe the tests serve as documentation: one can learn how to interact with the code by reading the unit tests.

@JonasVautherin JonasVautherin force-pushed the 269-update-core-proto branch from 33d8aa8 to 21a449f Compare April 4, 2018 14:29
@JonasVautherin JonasVautherin force-pushed the 269-update-core-proto branch from 21a449f to 39535df Compare April 4, 2018 15:04
@JonasVautherin JonasVautherin merged commit 64c435f into develop Apr 4, 2018
@JonasVautherin JonasVautherin deleted the 269-update-core-proto branch April 4, 2018 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants