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

doc: document Start and Await methods and mocks #14375

Merged
merged 7 commits into from
Jun 27, 2024

Conversation

scotthart
Copy link
Member

@scotthart scotthart commented Jun 26, 2024

part of the work for #7658


This change is Reviewable

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 93.06%. Comparing base (42336db) to head (86437a0).
Report is 8 commits behind head on main.

Files Patch % Lines
generator/internal/format_method_comments.cc 0.00% 4 Missing ⚠️
generator/internal/client_generator.cc 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14375      +/-   ##
==========================================
- Coverage   93.06%   93.06%   -0.01%     
==========================================
  Files        2191     2191              
  Lines      193203   193210       +7     
==========================================
+ Hits       179812   179814       +2     
- Misses      13391    13396       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -6,6 +6,17 @@ breaking changes in the upcoming 3.x release. This release is scheduled for

## v2.26.0 - TBD

### BREAKING TESTING CHANGES
Copy link
Member

Choose a reason for hiding this comment

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

nit: doesn't matter, but line break?

CHANGELOG.md Outdated
@@ -6,6 +6,17 @@ breaking changes in the upcoming 3.x release. This release is scheduled for

## v2.26.0 - TBD

### BREAKING TESTING CHANGES
If you don't have tests that `EXPECT_CALL` on methods in `MockConnection` that
Copy link
Member

Choose a reason for hiding this comment

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

FTR, ON_CALL would be ambiguous too. Maybe:

If you don't mock Long Running Operations (LRO) in your tests, these changes will not affect you.

CHANGELOG.md Outdated
for the preexisting LRO methods have been expanded. Uses of `EXPECT_CALL` that
do not have matchers for the arguments will be ambiguous. To quickly remedy this
change instances of `EXPECT_CALL(*mock, Method)` to
`EXPECT_CALL(*mock, Method(_))`.
Copy link
Member

Choose a reason for hiding this comment

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

optional: we wouldn't write this, but maybe s/Method(_)/Method(::testing::_)/ for those who are not familiar with the placeholder.

@@ -37,6 +37,16 @@ std::string FormatMethodComments(
*/
bool CheckMethodCommentSubstitutions();

/**
* Comments for LRO Start overload.
Copy link
Member

Choose a reason for hiding this comment

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

nit: extra space

Comment on lines 107 to 109
"\n // Due to additional overloads for this method\n"
" // EXPECT_CALL(*mock, $method_name$) is now ambiguous. Use\n"
" // EXPECT_CALL(*mock, $method_name$(_)) instead.\n"},
Copy link
Member

Choose a reason for hiding this comment

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

We should use doxygen style comments /// and put the code in code quotes.

And optionally, spell out ::testing::_.

Copy link
Member Author

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 527 files reviewed, 3 unresolved discussions (waiting on @dbolduc)

a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

nit: doesn't matter, but line break?

Done


a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

FTR, ON_CALL would be ambiguous too. Maybe:

If you don't mock Long Running Operations (LRO) in your tests, these changes will not affect you.

Done


a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

optional: we wouldn't write this, but maybe s/Method(_)/Method(::testing::_)/ for those who are not familiar with the placeholder.

Done.


a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

nit: extra space

Done


Copy link
Member Author

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 527 files reviewed, 3 unresolved discussions (waiting on @dbolduc)


generator/internal/mock_connection_generator.cc line 109 at r1 (raw file):

Previously, dbolduc (Darren Bolduc) wrote…

We should use doxygen style comments /// and put the code in code quotes.

And optionally, spell out ::testing::_.

Done.

@scotthart scotthart merged commit e2d4965 into googleapis:main Jun 27, 2024
66 of 67 checks passed
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.

2 participants