-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactoring of gRPC internals & tests and introducing the reflectMetadata
#3343
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3343 +/- ##
=======================================
Coverage 73.17% 73.17%
=======================================
Files 258 258
Lines 19886 19903 +17
=======================================
+ Hits 14551 14564 +13
- Misses 4414 4416 +2
- Partials 921 923 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
f100921
to
b685a2f
Compare
I rebased, since there was a minor conflict with |
@@ -1,16 +1,11 @@ | |||
package grpc | |||
package grpc_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why are we moving them to a specific package? Do we have cycle dependencies or other issues? I'm not against it, but I've seen some ongoing discussions around gRPC and extensions and I have the feeling I lost something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say it's just a better way of structuring the tests (best practice), basically test package becomes a user of the main package, which blocks access to the main package's internals, and as a result, we should write more robust tests, since even something internally in the package changed the tests continue to works since they rely on the public API
@@ -1325,74 +1131,44 @@ func TestDebugStat(t *testing.T) { | |||
func TestClientInvokeHeadersDeprecated(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like it could be the time to drop it completly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is still relevant for the existing functionality. However, I like the idea of dropping the headers
property, but how about opening a separate PR where we start erroring (right now, we just fallthrough
to the metadata
) and keep this for a cycle/too till we altogether remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with it 👍
What?
This PR contains several parts:
reflectMetadata
Why?
The refactoring was done to make the following changes tinier and pay some technical dept of removing copy-pasting.
The
reflectMetadata
was requested in #3241Checklist
make ci-like-lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)
grafana/xk6-grpc#51
Closes: #3241
Changelog
epic-feature: a new gRPC connection's parameter
reflectMetadata
In some workflows, the reflection call should also include some metadata. This PR adds a new connection parameter
reflectMetadata
that allows to specify the metadata to be sent with the reflection call.