seatunnel icon indicating copy to clipboard operation
seatunnel copied to clipboard

[Feature][connector-jdbc][PostgreSQL] Optimize unit testing for PostgreSQL in JDBC connector

Open chl-wxp opened this issue 11 months ago • 3 comments

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.

  1. 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.
  2. 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.
  3. 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

chl-wxp avatar Dec 18 '25 14:12 chl-wxp

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.

BrandaoFelipe avatar Dec 19 '25 12:12 BrandaoFelipe

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:

  1. For the introduction of docker, please refer to the content of connector-jdbc-e2e module;
  2. 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;
  3. There are unit tests in the JdbcPostgresIT class that need to be transferred, such as testCreateIndex(), testCatalog(), and testCatalogForSaveMode().

chl-wxp avatar Dec 19 '25 14:12 chl-wxp

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

BrandaoFelipe avatar Dec 27 '25 01:12 BrandaoFelipe