feat(tests): enhance load tests to support gRPC protocol #2501
feat(tests): enhance load tests to support gRPC protocol #2501
Conversation
… database connection handling
There was a problem hiding this comment.
Summary of Changes
Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces comprehensive support for the gRPC protocol within the end-to-end performance testing framework. The changes involve a substantial refactoring of the test infrastructure to allow seamless switching between HTTP and gRPC, alongside improvements to the gRPC client for more efficient data streaming and overall code modernization.
Highlights
- gRPC Protocol Support in Load Tests: End-to-end performance tests now support the gRPC protocol, enabling comprehensive testing against both HTTP and gRPC interfaces for ArcadeDB.
- Test Infrastructure Refactoring: The test setup was significantly refactored, introducing a new
ServerWrapperabstraction for consistent server representation and updating test containers to expose the gRPC port and enable the gRPC plugin. - Dynamic Protocol Selection: The
DatabaseWrapperhas been enhanced to dynamically select between HTTP and gRPC protocols for database connections, improving test flexibility. - Batch-Aware Streaming Results: A new
BatchedStreamingResultSetclass was added to the gRPC client, providing advanced batch-aware streaming capabilities for more efficient result handling. - Code Modernization and Cleanup: Significant refactoring in
RemoteGrpcDatabaseincludes extracting inner classes into separate files, simplifying error handling, and utilizing modern Java features like records and switch expressions for cleaner, more maintainable code.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize 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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request is a great enhancement, adding gRPC protocol support to the end-to-end performance tests. The refactoring is well-executed, especially the introduction of the ServerWrapper abstraction and the parameterization of tests to run against both HTTP and gRPC. The code cleanup in the grpc-client module, such as converting classes to records, moving inner classes to their own files, and using modern Java features like switch expressions, significantly improves code quality and maintainability. I have one minor suggestion to remove some redundant code.
grpc-client/src/main/java/com/arcadedb/remote/grpc/BatchedStreamingResultSet.java
Outdated
Show resolved
Hide resolved
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
This pull request introduces support for GRPC protocol in the end-to-end performance tests, enabling tests to run against both HTTP and GRPC interfaces. The changes include refactoring test setup to use a new
ServerWrapperabstraction, updating the test containers to expose the GRPC port and enable the GRPC plugin, and enhancing theDatabaseWrapperto select protocol dynamically. Additionally, a new batch-aware streaming result set is added to the GRPC client.Test infrastructure and protocol support:
SingleServerLoadTestIT.java,SingleServerSimpleLoadTestIT.java, andSingleLocalhostServerSimpleLoadTestIT.javato useServerWrapperinstead of raw host/port, and to allow parameterized testing with both HTTP and GRPC protocols. ([[1]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-eba3c81d56ffb7789ec81f4aa902f479c51aa5b0f90cf5e51a65d23728e0dea4L20-R28),[[2]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-eba3c81d56ffb7789ec81f4aa902f479c51aa5b0f90cf5e51a65d23728e0dea4L53-R53),[[3]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-eba3c81d56ffb7789ec81f4aa902f479c51aa5b0f90cf5e51a65d23728e0dea4L62-R62),[[4]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-eba3c81d56ffb7789ec81f4aa902f479c51aa5b0f90cf5e51a65d23728e0dea4L71-R71),[[5]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-c7a022fc8884a652447afe83ff2c66b65af1e42b80bcf9e1b0ddbad04511ea47R5-R29),[[6]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-c7a022fc8884a652447afe83ff2c66b65af1e42b80bcf9e1b0ddbad04511ea47L41-R45),[[7]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-7029ee2fd3e6cbde4050166189f12b48763eb4bde8ea8f4e3fbbf59ebf51ad5aR4),[[8]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-7029ee2fd3e6cbde4050166189f12b48763eb4bde8ea8f4e3fbbf59ebf51ad5aL87-R89),[[9]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-7029ee2fd3e6cbde4050166189f12b48763eb4bde8ea8f4e3fbbf59ebf51ad5aL114-R114),[[10]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-7029ee2fd3e6cbde4050166189f12b48763eb4bde8ea8f4e3fbbf59ebf51ad5aL123-R123),[[11]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-7029ee2fd3e6cbde4050166189f12b48763eb4bde8ea8f4e3fbbf59ebf51ad5aL132-R132))DatabaseWrapperto support both HTTP and GRPC protocols, including protocol selection logic and GRPC connection handling. ([[1]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-d0a1e463fdc50ea6aebfc20e179ea0f3a2847c60802612539bf86a5300104138L23-R59),[[2]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-d0a1e463fdc50ea6aebfc20e179ea0f3a2847c60802612539bf86a5300104138R68-R92))ServerWrapperclass to encapsulate host, HTTP port, and GRPC port, with convenient construction from a test container. ([e2e-perf/src/test/java/com/arcadedb/test/support/ServerWrapper.javaR1-R14](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-4927ce796a110fd6e02c5ec871c5534a25251696de48aec992d1a4131d0623adR1-R14))Test container and dependency updates:
ContainersTestTemplateto expose GRPC port (50051), enable the GRPC plugin in ArcadeDB, and return a list ofServerWrapperinstances when starting containers. ([[1]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-6c291fb4d5b94afa7e48fa346dcbef370086a1e58a4e2e1d261092662432bcc9L130-R138),[[2]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-6c291fb4d5b94afa7e48fa346dcbef370086a1e58a4e2e1d261092662432bcc9L147-R152),[[3]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-6c291fb4d5b94afa7e48fa346dcbef370086a1e58a4e2e1d261092662432bcc9L177-R182),[[4]](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-6c291fb4d5b94afa7e48fa346dcbef370086a1e58a4e2e1d261092662432bcc9L187-R192))pom.xml. ([e2e-perf/pom.xmlR69-R86](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-a62ae2b366288f8379a9ae389cc1460b63827cdb74a980861929aca52d5449e9R69-R86))GRPC client enhancements:
BatchedStreamingResultSetclass to the GRPC client module, providing batch-aware streaming result set capabilities for advanced use cases. ([grpc-client/src/main/java/com/arcadedb/remote/grpc/BatchedStreamingResultSet.javaR1-R58](https://github.com/ArcadeData/arcadedb/pull/2501/files#diff-00aaccf18da4f692ae648124d2b3f92406b34cfa7041188ee2b19fe878e6a04bR1-R58))