[Feature][connector-jdbc][PostgreSQL] Optimize unit testing for PostgreSQL in JDBC connector
Search before asking
- [x] I had searched in the feature and found no similar feature requirement.
Description
This issue focuses on improving and expanding unit test coverage for the PostgreSQL case in the connector-jdbc module, consistent with the scope defined in #10210.
- At present, the unit tests of connector-jdbc code basically rely on the local environment and will be turned off during the actual running of ci, which will lead to functional risks. We hope to introduce docker containers and run unit tests in the actual ci process.
- The unit test coverage of connector-jdbc code is relatively low, such as the jdbcCatalog test and jdbcDialect test. Additionally, there is a lack of boundary condition test cases. We hope to add relevant test cases.
- After completing points 1 and 2, you can transfer the unit tests in the jdbc-e2e module to connector-jdbc.
Usage Scenario
No response
Related issues
No response
Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Hi, I’d like to work on this issue. I plan to start by adding unit tests for the PostgreSQL JDBC dialect and catalog using Testcontainers. Please let me know if this approach works.
Hi, I’d like to work on this issue. I plan to start by adding unit tests for the PostgreSQL JDBC dialect and catalog using Testcontainers. Please let me know if this approach works.
Hello, thank you very much, using testcontainers is allowed. There are a few things you need to pay attention to:
- For the introduction of docker, please refer to the content of connector-jdbc-e2e module;
- Unit tests should try to cover the core functional methods of PostgresDialect and PostgresCatalog. Each test case is executed using the Postgres database, and then the results are asserted;
- There are unit tests in the JdbcPostgresIT class that need to be transferred, such as testCreateIndex(), testCatalog(), and testCatalogForSaveMode().
Hi, I sent a PR and just wanna say how challenging and enjoyable it was for me. I look foward for your review! @chl-wxp @davidzollo