dataconnect(test): ConnectRPCIntegrationTest.kt: add more tests#8102
Conversation
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
|
/gemini review |
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
There was a problem hiding this comment.
Code Review
This pull request significantly expands the integration testing suite for Data Connect RPC, adding coverage for various success and failure scenarios, including stream cancellation and lifecycle management. It also introduces utility methods and Kotest printers to facilitate the conversion of gRPC stream messages to human-readable formats for debugging. Feedback includes addressing a potential compilation error in ProtoUtil.kt regarding subscribe request handling, simplifying the conversion logic for StreamResponse data, and improving the robustness of test helper methods to prevent potential hangs.
…ass data between the "test" block and its caller. [skip actions]
This PR significantly expands the integration tests for the Data Connect Connect RPC service and introduces several utility methods for proto manipulation and debugging.
Highlights
ConnectRPCIntegrationTest.kt, covering successful operations, error conditions (e.g., non-existent operations, missing init), and various coroutine/channel lifecycle scenarios (cancellation, closure, etc.).StreamRequestusing a newvalidStreamRequestArbgenerator.ProtoUtil.ktfor convertingStreamRequestandStreamResponseobjects to compact strings andStructprotos, facilitating better logging and testing.putHeadersinDataConnectGrpcMetadataandStructProtoBuilderto allow for consistent, structured representation of gRPC metadata.KotestPrinters.ktto include custom printers for various Data Connect proto types, improving the readability of test failure messages.Changelog
5 files changed
putHeadersutility for structured metadata representation.Structproto conversion helpers forStreamRequestandStreamResponse.GraphqlError,StreamRequest,StreamResponse, andSourceLocationprotos.