-
Notifications
You must be signed in to change notification settings - Fork 40
Add mixed-case object name tests #2908
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
Conversation
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.
Pull Request Overview
This PR adds case sensitivity testing for ScalarDB storage adapters by introducing mixed-case object names in integration tests. The changes ensure that case-sensitivity handling is properly tested across different database backends, particularly for databases like Cassandra that have specific case sensitivity rules.
- Adds
DistributedStorageCaseSensitivityIntegrationTestandDistributedStorageAdminCaseSensitivityIntegrationTestbase classes with mixed-case object names - Refactors
DistributedStorageWithReservedKeywordIntegrationTestBaseto extendDistributedStorageIntegrationTestBasefor better code reuse
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| DistributedStorageWithReservedKeywordIntegrationTestBase.java | Refactored to extend base class, removing duplicated code |
| DistributedStorageCaseSensitivityIntegrationTest.java | New base test class with mixed-case object names |
| DistributedStorageAdminCaseSensitivityIntegrationTest.java | New admin test class with mixed-case object names |
| DistributedStorageAdminIntegrationTestBase.java | Refactored to use methods for object names, enabling inheritance |
| Jdbc*.java | Concrete implementations of case sensitivity tests for JDBC |
| Dynamo*.java | Concrete implementations of case sensitivity tests for DynamoDB |
| Cosmos*.java | Concrete implementations of case sensitivity tests for Cosmos DB |
| Cassandra*.java | Concrete implementations of case sensitivity tests for Cassandra |
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.
Summary of Changes
Hello @KodaiD, 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 significantly enhances our integration test coverage by introducing dedicated test suites for mixed-case object names across various distributed storage backends. The primary goal is to rigorously validate the system's behavior concerning case sensitivity, especially for databases like Cassandra that have distinct rules. This involves adding new abstract test classes, implementing them for specific database connectors, and refactoring existing test infrastructure to support this more flexible naming approach.
Highlights
- New Case-Sensitivity Test Suites: I've introduced new abstract base integration test classes,
DistributedStorageCaseSensitivityIntegrationTestandDistributedStorageAdminCaseSensitivityIntegrationTest. These classes are designed to specifically test operations using mixed-case object names (namespaces, tables, and columns) to ensure proper handling of case sensitivity across different storage backends. - Expanded Database Coverage: Concrete implementations of these new case-sensitivity test suites have been added for Cassandra, Cosmos DB, DynamoDB, and JDBC. This provides dedicated and comprehensive testing for how each specific database backend handles mixed-case identifiers in its operations.
- Refactored Base Test Classes: The
DistributedStorageAdminIntegrationTestBasehas been refactored to abstract out namespace, table, and column names into protected methods. This change allows subclasses, such as the new case-sensitivity tests, to define their own naming conventions (e.g., mixed-case) without modifying the core test logic, making the test framework more flexible and extensible. - Integration Test Framework Alignment: The
DistributedStorageWithReservedKeywordIntegrationTestBasenow extendsDistributedStorageIntegrationTestBase, streamlining the overall test hierarchy. Additionally, existing JDBC integration tests (JdbcDatabaseIntegrationTestandJdbcDatabaseWithReservedKeywordIntegrationTest) were updated to align with the new flexible naming methods, ensuring consistency across the test suite. - Database-Specific Test Adjustments: I've made specific adjustments for certain database backends. For Cassandra and DynamoDB, some tests were explicitly disabled where their native behavior regarding
IS NULLconditions or null values in secondary indexes differs from the general expectation, with clear explanations provided in the 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 or fill out our survey to provide feedback.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds integration tests for mixed-case object names, which is a valuable addition for ensuring case-sensitivity is handled correctly across different database systems. The refactoring of the base integration test classes to support this is a good approach.
My review has identified several areas where code duplication has been introduced in the new and modified test classes. I've provided suggestions to create common base classes for specific database tests (Cassandra, DynamoDB, and JDBC) to centralize duplicated logic, which will improve the overall maintainability of the test suite. I've also pointed out a minor redundant method call in the JDBC test classes.
...n-test/java/com/scalar/db/storage/cassandra/CassandraWithReservedKeywordIntegrationTest.java
Show resolved
Hide resolved
...gration-test/java/com/scalar/db/storage/dynamo/DynamoWithReservedKeywordIntegrationTest.java
Outdated
Show resolved
Hide resolved
...gration-test/java/com/scalar/db/storage/jdbc/JdbcDatabaseCaseSensitivityIntegrationTest.java
Show resolved
Hide resolved
...ion-test/java/com/scalar/db/storage/jdbc/JdbcDatabaseWithReservedKeywordIntegrationTest.java
Show resolved
Hide resolved
brfrn169
left a comment
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.
Overall LGTM. Left several minor comments. PTAL!
...t/src/main/java/com/scalar/db/api/DistributedStorageAdminCaseSensitivityIntegrationTest.java
Outdated
Show resolved
Hide resolved
...n-test/src/main/java/com/scalar/db/api/DistributedStorageCaseSensitivityIntegrationTest.java
Outdated
Show resolved
Hide resolved
...integration-test/java/com/scalar/db/storage/dynamo/DynamoCaseSensitivityIntegrationTest.java
Outdated
Show resolved
Hide resolved
...gration-test/java/com/scalar/db/storage/dynamo/DynamoWithReservedKeywordIntegrationTest.java
Outdated
Show resolved
Hide resolved
|
@brfrn169 Thank you for your review! I applied your suggestions. PTAL! |
komamitsu
left a comment
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.
LGTM! 👍
brfrn169
left a comment
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.
LGTM! Thank you!
feeblefakie
left a comment
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.
LGTM! Thank you!
...gration-test/java/com/scalar/db/storage/jdbc/JdbcDatabaseCaseSensitivityIntegrationTest.java
Show resolved
Hide resolved
Torch3333
left a comment
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.
LGTM, thank you!
Description
This PR adds integration tests with object names that include both upper and lower case letters. This is to ensure that the case-sensitivity issue is properly tested, especially for databases like Cassandra that have specific rules regarding case sensitivity.
Related issues and/or PRs
Changes made
DistributedStorageCaseSensitivityIntegrationTestandDistributedStorageAdminCaseSensitivityIntegrationTestthat use object names with both upper and lower case letters.DistributedStorageCaseSensitivityIntegrationTestextendsDistributedStorageIntegrationTestBase.DistributedStorageAdminCaseSensitivityIntegrationTestextendsDistributedStorageAdminIntegrationTestBase.DistributedStorageWithReservedKeywordIntegrationTestBaseto extendDistributedStorageIntegrationTestBaseto reduce code duplication.Checklist
Additional notes (optional)
N/A
Release notes
N/A