Skip to content

Replace H2 use for testing with PostgreSQL#719

Open
Akanksha-kedia wants to merge 1 commit into
trinodb:mainfrom
Akanksha-kedia:feature/new_pr
Open

Replace H2 use for testing with PostgreSQL#719
Akanksha-kedia wants to merge 1 commit into
trinodb:mainfrom
Akanksha-kedia:feature/new_pr

Conversation

@Akanksha-kedia
Copy link
Copy Markdown
Contributor

@Akanksha-kedia Akanksha-kedia commented Jul 8, 2025

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot Bot added the cla-signed label Jul 8, 2025
@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@ebyhr

Comment thread webapp/pnpm-lock.yaml
@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

Akanksha-kedia commented Jul 9, 2025 via email

@Akanksha-kedia Akanksha-kedia force-pushed the feature/new_pr branch 2 times, most recently from d8bbdb2 to c1469cc Compare July 9, 2025 02:23
@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Jul 9, 2025

I ll have to remove that

Why do we need to remove webapp/pnpm-lock.yaml?

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

Akanksha-kedia commented Jul 9, 2025 via email

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@ebyhr please review

Comment thread gateway-ha/src/test/java/io/trino/gateway/ha/TestingJdbcConnectionManager.java Outdated
Comment thread gateway-ha/src/test/java/io/trino/gateway/ha/TestingJdbcConnectionManager.java Outdated
@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@ebyhr have resolved please review.

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

  • Database Configuration Changes:

    • In gateway-ha/config.yaml: Changed database connection parameters to use environment variables with defaults, making the configuration more flexible for different environments.
  • Timestamp Handling Improvements:

    • In ExactMatchSourceSelectorsDao.java: Added a TimestampColumnMapper class to properly handle timestamp formatting.
    • In HaResourceGroupsManager.java: Added automatic timestamp generation for updateTime when it's null or empty.
  • Test Framework Modernization:

    • In TestingJdbcConnectionManager.java: Replaced H2 in-memory database with PostgreSQL using TestContainers.
    • In TestSpecificDbResourceGroupsManager.java: Removed file-based setup and switched to TestContainers.
    • In TestResourceGroupsManager.java: Updated test assertions to use newer Java methods (e.g., getFirst() instead of get(0)), and improved resource group ID lookup.

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@mosabua please review.

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@mosabua

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

Please review and help to merge
@ebyhr @mosabua

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

Screenshot 2025-08-08 at 11 18 58 AM https://nexus-iq.visa.com/assets/index.html#/vulnerabilities/CVE-2021-42392

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@mosabua @electrum @ebyhr please review

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@mosabua
Copy link
Copy Markdown
Member

mosabua commented Sep 18, 2025

We cut a new release now .. will hopefully be able to test soon .. can you rebase in the meantime

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

Akanksha-kedia commented Sep 20, 2025 via email

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@mosabua please review

@mosabua
Copy link
Copy Markdown
Member

mosabua commented Oct 11, 2025

With #780 merged now .. can you rebase and adjust and make sure CI passes?

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

Akanksha-kedia commented Oct 12, 2025 via email

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

please review @mosabua

@mosabua
Copy link
Copy Markdown
Member

mosabua commented Jan 10, 2026

Can you rebase and resolve conflicts here @Akanksha-kedia ? It would be good to get this in

@github-actions github-actions Bot added the stale label Feb 18, 2026
@mosabua
Copy link
Copy Markdown
Member

mosabua commented Feb 18, 2026

We definitely want to go ahead with this so I am adding the stale-ignore label to keep the PR from getting closed/lost.

@mosabua mosabua added stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. and removed stale labels Feb 18, 2026
@mosabua
Copy link
Copy Markdown
Member

mosabua commented Mar 4, 2026

Can you @Akanksha-kedia rebase and address the last few commits from @ebyhr so we can maybe get this merged and into a release soon

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

Akanksha-kedia commented Mar 4, 2026 via email

@Akanksha-kedia Akanksha-kedia force-pushed the feature/new_pr branch 4 times, most recently from dba0335 to 532efd6 Compare March 9, 2026 09:21
@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@mosabua please check

@Akanksha-kedia Akanksha-kedia force-pushed the feature/new_pr branch 7 times, most recently from 693062c to 19a680e Compare March 9, 2026 12:01
@mosabua
Copy link
Copy Markdown
Member

mosabua commented Mar 11, 2026

Could you fix the failing tests (or rebase if that is the source of the problem) @Akanksha-kedia .. or push again in case its a temporary failure and you verified it works locally for you

Also could you have a look @ebyhr so we can get this finally in ..

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

@mosabua please go ahead with pr merge.

Comment thread gateway-ha/src/main/java/io/trino/gateway/ha/config/HaGatewayConfiguration.java Outdated
@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Mar 12, 2026

I don't think this PR is ready for merge.

@ebyhr ebyhr removed the stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. label Mar 13, 2026
@mosabua
Copy link
Copy Markdown
Member

mosabua commented Apr 13, 2026

Can you remove the * START GENAI@CLINE */ and similar comments @Akanksha-kedia and address any other concerns from @ebyhr .. I would like to get this in soon

@Akanksha-kedia
Copy link
Copy Markdown
Contributor Author

Akanksha-kedia commented Apr 14, 2026 via email

@Akanksha-kedia Akanksha-kedia force-pushed the feature/new_pr branch 2 times, most recently from 5eb5102 to 1a7bd80 Compare April 15, 2026 14:22
Replace H2 in-memory database with PostgreSQL TestContainers for all
test infrastructure. This eliminates the H2 test dependency and ensures
tests run against the same database type used in production.

Changes:
- Remove H2 database dependency from pom.xml
- Replace TestingJdbcConnectionManager to use PostgreSQL containers
- Add TimestampColumnMapper to ExactMatchSourceSelectorsDao for
  proper timestamp handling with PostgreSQL
- Update TestResourceGroupsManager to use name-based lookups instead
  of assuming specific auto-increment IDs
- Update TestSpecificDbResourceGroupsManager to use
  TestcontainersUtils and withInitScript for database setup
- Update TestHaGatewayManager cache expiration test to stop the
  PostgreSQL container to simulate database unavailability
- Update TestJdbcConnectionManager to use PostgreSQL JDBC URLs
- Remove unused seedRequiredData method from HaGatewayTestUtils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants