Revived CopyDbTest#3926
Conversation
Summary of ChangesHello, 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 modernizes the integration testing suite for Spanner export and import pipelines. By replacing the monolithic CopyDbTest with a modular CopyDbIT class and introducing a dedicated utility for schema generation, the changes improve test readability, dialect support, and overall maintainability of the integration test suite. Highlights
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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request migrates the Spanner export/import integration tests from CopyDbTest to a new CopyDbIT class, utilizing the TemplateTestBase framework. It also introduces SchemaGenerationUtils to help construct test schemas for both Google Standard SQL and PostgreSQL dialects, and updates RandomDdlGenerator to handle dialect-specific quoting in filters. The reviewer noted that several helper methods in SchemaGenerationUtils (such as those for empty tables and foreign keys) are currently unused in CopyDbIT, which represents a regression in test coverage compared to the original test suite. It is recommended to add corresponding test cases to cover these scenarios.
| public void testEmptyDbGsql() throws Exception { | ||
| Ddl ddl = Ddl.builder(Dialect.GOOGLE_STANDARD_SQL).build(); | ||
| createAndPopulate(ddl, 0); | ||
| runTest(Dialect.GOOGLE_STANDARD_SQL); | ||
| } | ||
|
|
||
| @Test | ||
| public void testEmptyDbPg() throws Exception { | ||
| Ddl ddl = Ddl.builder(Dialect.POSTGRESQL).build(); | ||
| createAndPopulate(ddl, 0); | ||
| runTest(Dialect.POSTGRESQL); | ||
| } |
There was a problem hiding this comment.
The helper methods addEmptyTables, addPgEmptyTables, addForeignKeys, and addPgForeignKeys in SchemaGenerationUtils are defined but never used in CopyDbIT. The original CopyDbTest had dedicated test cases for empty tables and foreign keys (e.g., emptyTables, emptyPgTables, foreignKeys, pgForeignKeys). To prevent a regression in integration test coverage for the Spanner import/export templates, please add corresponding test cases in CopyDbIT that utilize these helper methods.
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3926 +/- ##
============================================
- Coverage 55.59% 55.57% -0.02%
+ Complexity 7052 7049 -3
============================================
Files 1103 1103
Lines 67681 67684 +3
Branches 7603 7603
============================================
- Hits 37625 37616 -9
- Misses 27636 27646 +10
- Partials 2420 2422 +2
🚀 New features to boost your workflow:
|
| columns.endIndexColumn(); | ||
| if (rnd.nextBoolean()) { | ||
| filters.add("\"" + columnName + "\" IS NOT NULL"); | ||
| String q = getDialect() == Dialect.POSTGRESQL ? "\"" : "`"; |
There was a problem hiding this comment.
Please add parentheses for readability.
No description provided.