This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-8825-a68906d9bc28b26acdda6b32e55801fbda045f76 in repository https://gitbox.apache.org/repos/asf/texera.git
commit fe13a83a848e62bc6fb9e4de24f6353cca37dacd Author: Xinyuan Lin <[email protected]> AuthorDate: Wed Oct 21 06:50:50 2026 +0000 refactor(config): remove the unused test-database JDBC URL (#8825) ### What changes were proposed in this PR? Removes the unused test-database JDBC URL setting. **+5/−20 lines.** There is no behaviour change. - `StorageConfig.jdbcUrlForTestCases` and the `storage.jdbc.url-for-test-cases` key in `storage.conf` (with its `STORAGE_JDBC_URL_FOR_TEST_CASES` override and comment). They go together, because the val's eager `getString` would throw once the key is gone. - The "Not the test-cases database: ..." sentence in four RunSpecs (amber, access-control, config, notebook-migration). It explained their `pooledJdbcUrl shouldBe StorageConfig.jdbcUrl` assertion by contrast with this setting. The assertions and the remaining credential note are unchanged. > Reviewer note: the two `Create texera_db_for_test_cases` CI steps in `build.yml` deliberately **stay**. `backport-checks.yml` runs `main`'s `build.yml` against `release/*` trees, and on `release/v1.1` and `release/v1.2` the e2e `TestUtils` still connects to that database. For the same reason this change must not be backported to v1.1 or v1.2, where it would not compile. ### History | | | | --- | --- | | **Introduced by** | #3782 (2025-10-07), "feat(amber): enable user system by default", for the e2e `TestUtils.initiateTexeraDBForTestCases` | | **Usage removed by** | #6238 (2026-07-27), "refactor: Refactor MockTexeraDB into a JVM singleton". That helper now creates its own per-run database on the embedded Postgres instead of reading this URL | It has been unused on `main` for two months. ### Any related issues, documentation, discussions? Closes #8824 ### How was this PR tested? No new tests. `StorageConfigSpec` has no assertion on the removed setting. Locally, from the repo root with Java 17: - `sbt "Config/Test/compile" "DAO/Test/compile" "WorkflowExecutionService/Test/compile" "ConfigService/Test/compile" "AccessControlService/Test/compile" "NotebookMigrationService/Test/compile"`: success. - `sbt "Config/testOnly *StorageConfigSpec"`: 7 tests, all pass. - `sbt "Config/scalafmtCheckAll" "Config/scalafixAll --check"`, plus `scalafmtCheckAll` on the four modules whose specs changed: clean. To re-check: ``` git grep -n "jdbcUrlForTestCases\|url-for-test-cases\|URL_FOR_TEST_CASES" # no hits ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- .../org/apache/texera/service/AccessControlServiceRunSpec.scala | 6 ++---- .../test/scala/org/apache/texera/web/TexeraWebApplicationSpec.scala | 2 -- common/config/src/main/resources/storage.conf | 6 ------ .../main/scala/org/apache/texera/common/config/StorageConfig.scala | 1 - .../test/scala/org/apache/texera/service/ConfigServiceRunSpec.scala | 4 +--- .../org/apache/texera/service/NotebookMigrationServiceRunSpec.scala | 6 ++---- 6 files changed, 5 insertions(+), 20 deletions(-) diff --git a/access-control-service/src/test/scala/org/apache/texera/service/AccessControlServiceRunSpec.scala b/access-control-service/src/test/scala/org/apache/texera/service/AccessControlServiceRunSpec.scala index 7f647ab0fc..c738233445 100644 --- a/access-control-service/src/test/scala/org/apache/texera/service/AccessControlServiceRunSpec.scala +++ b/access-control-service/src/test/scala/org/apache/texera/service/AccessControlServiceRunSpec.scala @@ -236,10 +236,8 @@ class AccessControlServiceRunSpec extends AnyFlatSpec with Matchers { // below also passes for an initialize() that opens nothing at all, off a pool some earlier // test in this JVM installed. initialized.sqlServerAfter.map(_ ne initialized.sqlServerBefore.orNull) shouldBe Some(true) - // Not the test-cases database: pointing the running service at it would have every access - // check read a schema that the CI e2e specs truncate underneath it. Only the URL is pinned — - // storage.conf ships username and password as the same string ("postgres"), so nothing here - // can tell the two credential arguments apart. + // Only the URL is pinned — storage.conf ships username and password as the same string + // ("postgres"), so nothing here can tell the two credential arguments apart. initialized.pooledJdbcUrl.get shouldBe StorageConfig.jdbcUrl } } diff --git a/amber/src/test/scala/org/apache/texera/web/TexeraWebApplicationSpec.scala b/amber/src/test/scala/org/apache/texera/web/TexeraWebApplicationSpec.scala index 3b62e3218f..a7dfcd43a5 100644 --- a/amber/src/test/scala/org/apache/texera/web/TexeraWebApplicationSpec.scala +++ b/amber/src/test/scala/org/apache/texera/web/TexeraWebApplicationSpec.scala @@ -254,8 +254,6 @@ class TexeraWebApplicationSpec extends AnyFlatSpec with Matchers { databaseReachable, "run() requires a reachable Postgres at the configured JDBC URL (provided in CI)" ) - // Not the test-cases database: pointing the running server at it would have every dashboard - // read and write a schema that the CI e2e specs truncate underneath it. ranEnvironment pooledJdbcUrl shouldBe Some(StorageConfig.jdbcUrl) } diff --git a/common/config/src/main/resources/storage.conf b/common/config/src/main/resources/storage.conf index d8e7e19921..45659b776f 100644 --- a/common/config/src/main/resources/storage.conf +++ b/common/config/src/main/resources/storage.conf @@ -165,12 +165,6 @@ storage { url = "jdbc:postgresql://localhost:5432/texera_db?currentSchema=texera_db,public" url = ${?STORAGE_JDBC_URL} - # Some e2e test cases require the user system. To make sure running those test cases can pass the CI, and that - # running them locally do not contaminate developers' own texera_db, we use another database with a different - # name for running these test cases. - url-for-test-cases = "jdbc:postgresql://localhost:5432/texera_db_for_test_cases?currentSchema=texera_db,public" - url-for-test-cases = ${?STORAGE_JDBC_URL_FOR_TEST_CASES} - username = "postgres" username = ${?STORAGE_JDBC_USERNAME} diff --git a/common/config/src/main/scala/org/apache/texera/common/config/StorageConfig.scala b/common/config/src/main/scala/org/apache/texera/common/config/StorageConfig.scala index 2627b12f5d..446905b53a 100644 --- a/common/config/src/main/scala/org/apache/texera/common/config/StorageConfig.scala +++ b/common/config/src/main/scala/org/apache/texera/common/config/StorageConfig.scala @@ -30,7 +30,6 @@ object StorageConfig { // JDBC specifics val jdbcUrl: String = conf.getString("storage.jdbc.url") - val jdbcUrlForTestCases: String = conf.getString("storage.jdbc.url-for-test-cases") val jdbcUsername: String = conf.getString("storage.jdbc.username") val jdbcPassword: String = conf.getString("storage.jdbc.password") diff --git a/config-service/src/test/scala/org/apache/texera/service/ConfigServiceRunSpec.scala b/config-service/src/test/scala/org/apache/texera/service/ConfigServiceRunSpec.scala index 5f6cd1238b..e1aa049fe2 100644 --- a/config-service/src/test/scala/org/apache/texera/service/ConfigServiceRunSpec.scala +++ b/config-service/src/test/scala/org/apache/texera/service/ConfigServiceRunSpec.scala @@ -324,9 +324,7 @@ class ConfigServiceRunSpec // below also passes for an initialize() that opens nothing at all, off a pool some earlier // test in this JVM installed. initialized.sqlServerAfter.map(_ ne initialized.sqlServerBefore.orNull) shouldBe Some(true) - // Not the test-cases database: preloading the defaults into it would leave the deployment's - // own site_settings empty while the CI e2e specs truncate the rows that were written. Only - // the URL is pinned — storage.conf ships username and password as the same string + // Only the URL is pinned — storage.conf ships username and password as the same string // ("postgres"), so nothing here can tell the two credential arguments apart. initialized.pooledJdbcUrl.get shouldBe StorageConfig.jdbcUrl } diff --git a/notebook-migration-service/src/test/scala/org/apache/texera/service/NotebookMigrationServiceRunSpec.scala b/notebook-migration-service/src/test/scala/org/apache/texera/service/NotebookMigrationServiceRunSpec.scala index 64a99c07e2..826f6d9468 100644 --- a/notebook-migration-service/src/test/scala/org/apache/texera/service/NotebookMigrationServiceRunSpec.scala +++ b/notebook-migration-service/src/test/scala/org/apache/texera/service/NotebookMigrationServiceRunSpec.scala @@ -222,10 +222,8 @@ class NotebookMigrationServiceRunSpec extends AnyFlatSpec with Matchers { // below also passes for an initialize() that opens nothing at all, off a pool some earlier // test in this JVM installed. initialized.sqlServerAfter.map(_ ne initialized.sqlServerBefore.orNull) shouldBe Some(true) - // Not the test-cases database: pointing the running service at it would have every migration - // record land in a schema that the CI e2e specs truncate underneath it. Only the URL is - // pinned — storage.conf ships username and password as the same string ("postgres"), so - // nothing here can tell the two credential arguments apart. + // Only the URL is pinned — storage.conf ships username and password as the same string + // ("postgres"), so nothing here can tell the two credential arguments apart. initialized.pooledJdbcUrl.get shouldBe StorageConfig.jdbcUrl } }
