Skip to content

Conversation

@chardan
Copy link
Contributor

@chardan chardan commented Sep 1, 2021

Add serviceId to CommandFailedEvent, CommandSucceededEvent, and CommandStartedEvent

https://jira.mongodb.org/browse/CXX-2342

Part of CXX-2173 LoadBalancer epic.

Signed-off-by: Jesse Williamson jesse.williamson@mongodb.com

Jesse Williamson added 3 commits August 31, 2021 16:23
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2021

Codecov Report

Merging #823 (6256165) into master (401ad6b) will decrease coverage by 0.02%.
The diff coverage is 97.01%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #823      +/-   ##
==========================================
- Coverage   91.31%   91.28%   -0.03%     
==========================================
  Files         381      381              
  Lines       22028    22095      +67     
==========================================
+ Hits        20114    20170      +56     
- Misses       1914     1925      +11     
Impacted Files Coverage Δ
src/bsoncxx/test_util/catch.hh 0.00% <0.00%> (ø)
src/mongocxx/events/command_failed_event.hpp 100.00% <ø> (ø)
src/mongocxx/events/command_started_event.hpp 100.00% <ø> (ø)
src/mongocxx/events/command_succeeded_event.hpp 100.00% <ø> (ø)
src/bsoncxx/private/helpers.hh 100.00% <100.00%> (ø)
src/mongocxx/events/command_failed_event.cpp 30.00% <100.00%> (+17.50%) ⬆️
src/mongocxx/events/command_started_event.cpp 62.06% <100.00%> (+9.89%) ⬆️
src/mongocxx/events/command_succeeded_event.cpp 43.33% <100.00%> (+14.16%) ⬆️
src/mongocxx/private/libmongoc_symbols.hh 100.00% <100.00%> (ø)
src/mongocxx/test/database.cpp 99.08% <100.00%> (+0.13%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 401ad6b...6256165. Read the comment docs.

@chardan chardan self-assigned this Sep 1, 2021
@chardan chardan requested a review from kevinAlbs September 1, 2021 17:16
@chardan chardan force-pushed the CXX2342-jfw-add_serviceid branch from 6084aed to cf76bfc Compare September 2, 2021 22:17
@chardan chardan changed the title CXX2342 add serviceid to events CXX-2342 add serviceid to events Sep 3, 2021
@chardan chardan force-pushed the CXX2342-jfw-add_serviceid branch from cf76bfc to 869a39c Compare September 4, 2021 19:57
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
@chardan chardan force-pushed the CXX2342-jfw-add_serviceid branch from 869a39c to 54abd15 Compare September 4, 2021 21:16
@chardan chardan force-pushed the CXX2342-jfw-add_serviceid branch 2 times, most recently from 52a76ab to 4f27798 Compare September 13, 2021 23:26
Jesse Williamson added 2 commits September 13, 2021 17:55
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
@chardan chardan force-pushed the CXX2342-jfw-add_serviceid branch from 4f27798 to 0bc1ae5 Compare September 14, 2021 00:55
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
@chardan chardan requested a review from kevinAlbs September 14, 2021 00:57
@chardan chardan marked this pull request as ready for review September 14, 2021 17:52
apm_opts.on_command_failed(
check_service_id<mongocxx::events::command_failed_event>{expect_service_id});

// Set up mocking for mongoc_apm_command_started_get_service_id:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This applies to all three events. I suggest removing this comment since the comments on L544 and L560 note that mocks are being set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given the high level of confusion that's possible for new-to-the-test-framework folks, I would prefer to leave these here. I agree it's somewhat redundant once it's clear what's going on, but like many other things in this test I think a bit of clarification might very well help the next reader, or one less familiar with the test harnesses. (Although if other reviewers are of the same opinion, I don't have super strong feelings about it.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Leaving the comment SGTM. It currently only notes mongoc_apm_command_started_get_service_id being mocked. Since mongoc_apm_command_succeeded_get_service_id and mongoc_apm_command_failed_get_service_id are also mocked, should this be edited to note all three?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah! I see what you're saying! I've gone ahead and revised the comment. Derp!

Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM with some comment tweaks! Since this is a non-trivial change, can you request review from another team member?

Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Jesse Williamson added 2 commits September 15, 2021 13:14
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Copy link
Contributor

@vector-of-bool vector-of-bool left a comment

Choose a reason for hiding this comment

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

LGTM

@chardan chardan merged commit fd84da8 into mongodb:master Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants