Neilk1021 opened a new issue, #6421: URL: https://github.com/apache/texera/issues/6421
### Task Summary ### Task Summary Part of #6238, refactor MockTexeraDB into a JVM singleton. This sub-issue covers deduplicating the test database provisioning logic specifically. Currently, the "create database + run DDL" sequence is implemented in two places: `TestUtils.initiateTexeraDBForTestCases` for test cases and `MockTexeraDB.initializeDBAndReplaceDSLContext`. The two copies have already drifted from each other. This task consolidates them into a single shared helper. ### Scope Extract a shared provisioning helper that: - Creates an isolated per-suite/test database on the embedded Postgres instance via CREATE DATABASE Runs the cached DDL script against the newly created database - Is exposed as a single reusable method on object MockTexeraDB so both TestUtils and the trait call the same code path ### Constraints: - Existing functionality must be preserved exactly this is an internal refactor/cleanup, not a behavior change. - Both call sites (`TestUtils.initiateTexeraDBForTestCases` and `MockTexeraDB.initializeDBAndReplaceDSLContext`) - should route through the shared helper, eliminating the drift. - No change to the connection lifecycle guarantees introduced in #6238 (e.g. DDL connections still closed via Using.resource, no leaks on failure). See #6238 (review thread on TestUtils.scala) for the original discussion where this cleanup was agreed to be split out as a follow-up. ### Task Type - [x] Refactor / Cleanup - [ ] DevOps / Deployment / CI - [ ] Testing / QA - [ ] Documentation - [ ] Performance - [ ] Other -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
