-
Notifications
You must be signed in to change notification settings - Fork 17
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
Adds new conformance/client module #182
Conversation
9bd518f
to
9d4849f
Compare
- This contains the new conformance client, for the new conformance tests - The base module has all of the logic and uses the Java Lite runtime (since it is lowest common denominator) - There are google-java and google-javalite modules which have the main functions for running the clients. The google-java module swaps out the javalite runtime for the java runtime. The client module (with shared logic) can convert from javalite generated messages to java generated messages by serializing and deserializing - The adapt package in the client module provides a glimpse of what I think better stream APIs would look like. I'd like to update the actual stream interfaces to more closely match this in the future. For now, the code just adapts exising interfaces to these. - To test the different unary invocation styles, there is an enum for each style and a method in UnaryClient that is an adapter: a single interface for the actual conformance client to use (that looks like the Callback style), but under the hood it will call the suspend, callback, or blocking methods based on the desired invocation style. - The actual client logic is TODO, in various handle* methods of the Client class. This felt like a big enough chunk already, so I figured it would be good to get this reviewed before plowing through the rest.
6201610
to
e430ea9
Compare
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.
Looks really nice - the new interfaces look good to me and it will be nice to not have duplicated code.
conformance/client/google-java/src/main/kotlin/com/connectrpc/conformance/client/java/Main.kt
Show resolved
Hide resolved
conformance/client/src/main/kotlin/com/connectrpc/conformance/client/Client.kt
Outdated
Show resolved
Hide resolved
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.
Looks good - just a conflict to resolve in versions toml file after some dependabot updates from yesterday.
ede63e1
to
527df44
Compare
This PR is purely additive. It does not make any changes to the existing container/crosstest-based conformance test targets. It's just starting to add code to eventually replace all of that.
So the old conformance tests are in these modules:
conformance/common
conformance/google-java
conformance/google-javalite
The new ones are in these:
conformance/client
conformance/client/google-java
conformance/client/google-javalite
This doesn't include any actual logic yet. This was a rather substantial PR already, so I figured it would be good to get this approach reviewed before fleshing out the conformance client handler logic (which are all stubbed out in
Client.kt
with TODOs).To avoid the redundant implementations of the current conformance tests, I'm doing the following:
conformance/client
module. So the shared logic deals with the lite generated message types, since that's the lowest common denominator. (The full runtime should be able to correctly support lite generate code.)conformance/client/google-javalite
module doesn't need any add'l generated code.conformance/client/google-java
module, on the other hand, does. So the shared code will convert from generated lite messages to normal/non-lite messages. This uses abuf.gen.lite.yaml
which has a different package prefix, so both sets of generated messages can co-exist. The dependencies of the non-lite module exclude the javalite protobuf runtime, swapping in the full runtime instead.This also provides a glimpse of what I'm thinking about for an overhaul of the stream interfaces. In particular, see
BidiStreamClient.BidiStream
,ServerStreamClient.ServerStream
, andClientStreamClient.ClientStream
. Currently, these contain adapters from the existing actual stream interfaces to these newer ones. But I'd like to overhaul the main stream interfaces to look more-or-less like these in the future, so let me know what you think.