diff --git a/build-logic/src/main/kotlin/polaris-runtime.gradle.kts b/build-logic/src/main/kotlin/polaris-runtime.gradle.kts index 71c2c3cdc5..4aeccc5bc9 100644 --- a/build-logic/src/main/kotlin/polaris-runtime.gradle.kts +++ b/build-logic/src/main/kotlin/polaris-runtime.gradle.kts @@ -48,20 +48,32 @@ testing { tasks.named(sources.compileJavaTaskName).configure { dependsOn("compileQuarkusTestGeneratedSourcesJava") } - configurations.named(sources.runtimeOnlyConfigurationName).configure { - extendsFrom(configurations.getByName("testRuntimeOnly")) - } - configurations.named(sources.implementationConfigurationName).configure { - // Let the test's implementation config extend testImplementation, so it also inherits the - // project's "main" implementation dependencies (not just the "api" configuration) - extendsFrom(configurations.getByName("testImplementation")) - } sources { java.srcDirs(tasks.named("quarkusGenerateCodeTests")) } } listOf("intTest", "cloudTest").forEach { register(it).configure { intTestSuiteConfigure(this) } } + + named("intTest").configure { + configurations.named(sources.runtimeOnlyConfigurationName).configure { + extendsFrom(configurations.getByName("testRuntimeOnly")) + } + configurations.named(sources.implementationConfigurationName).configure { + // Let the test's implementation config extend testImplementation, so it also inherits the + // project's "main" implementation dependencies (not just the "api" configuration) + extendsFrom(configurations.getByName("testImplementation")) + } + } + + named("cloudTest").configure { + configurations.named(sources.runtimeOnlyConfigurationName).configure { + extendsFrom(configurations.getByName("intTestRuntimeOnly")) + } + configurations.named(sources.implementationConfigurationName).configure { + extendsFrom(configurations.getByName("intTestImplementation")) + } + } } } diff --git a/runtime/server/README.md b/runtime/server/README.md index 640d2e1667..a23b4605a4 100644 --- a/runtime/server/README.md +++ b/runtime/server/README.md @@ -64,3 +64,28 @@ following command: -Dquarkus.container-image.group=apache \ -Dquarkus.container-image.name=polaris-local ``` + +## Integration tests + +Integration tests from the `:polaris-tests` module can be run against a local Polaris Quarkus instance +for each supported cloud storage. Set the appropriate environment variables for your target cloud, +then run the tests as shown below. + +For S3: +```shell +export INTEGRATION_TEST_S3_PATH="s3://bucket/subpath" +export INTEGRATION_TEST_S3_ROLE_ARN="your-role-arn" +./gradlew :polaris-server:cloudTest +``` +For ADLS: +```shell +export INTEGRATION_TEST_AZURE_PATH="abfss://bucket/subpath" +export INTEGRATION_TEST_AZURE_TENANT_ID="your-tenant-id" +./gradlew :polaris-server:cloudTest +``` +For GCS: +```shell +export INTEGRATION_TEST_GCS_PATH="gs://bucket/subpath" +export INTEGRATION_TEST_GCS_SERVICE_ACCOUNT="your-service-account" +./gradlew :polaris-server:cloudTest +``` diff --git a/runtime/server/build.gradle.kts b/runtime/server/build.gradle.kts index 2665649dc6..8510fa92fc 100644 --- a/runtime/server/build.gradle.kts +++ b/runtime/server/build.gradle.kts @@ -53,6 +53,33 @@ dependencies { // enforce the Quarkus _platform_ here, to get a consistent and validated set of dependencies implementation(enforcedPlatform(libs.quarkus.bom)) implementation("io.quarkus:quarkus-container-image-docker") + + testImplementation(enforcedPlatform(libs.quarkus.bom)) + testImplementation("io.quarkus:quarkus-junit5") + + intTestImplementation(testFixtures(project(":polaris-runtime-service"))) + intTestImplementation(project(":polaris-runtime-test-common")) + intTestImplementation(project(":polaris-core")) + intTestImplementation(project(":polaris-api-management-model")) + intTestImplementation(project(":polaris-minio-testcontainer")) + + intTestImplementation(project(":polaris-tests")) { + // exclude all spark dependencies + exclude(group = "org.apache.iceberg", module = "iceberg-spark-3.5_2.12") + exclude(group = "org.apache.iceberg", module = "iceberg-spark-extensions-3.5_2.12") + exclude(group = "org.apache.spark", module = "spark-sql_2.12") + } + + intTestImplementation(platform(libs.iceberg.bom)) + intTestImplementation("org.apache.iceberg:iceberg-api") + intTestImplementation("org.apache.iceberg:iceberg-core") + intTestImplementation("org.apache.iceberg:iceberg-aws") + intTestImplementation("org.apache.iceberg:iceberg-api:${libs.versions.iceberg.get()}:tests") + intTestImplementation("org.apache.iceberg:iceberg-core:${libs.versions.iceberg.get()}:tests") + + // This dependency brings in RESTEasy Classic, which conflicts with Quarkus RESTEasy Reactive; + // it must not be present during Quarkus augmentation otherwise Quarkus tests won't start. + intTestRuntimeOnly(libs.keycloak.admin.client) } quarkus { @@ -100,3 +127,70 @@ artifacts { } add("distributionElements", layout.buildDirectory.dir("quarkus-app")) { builtBy("quarkusBuild") } } + +tasks.withType(Test::class.java).configureEach { + if (System.getenv("AWS_REGION") == null) { + environment("AWS_REGION", "us-west-2") + } + // Note: the test secrets are referenced in + // org.apache.polaris.service.it.ServerManager + environment("POLARIS_BOOTSTRAP_CREDENTIALS", "POLARIS,test-admin,test-secret") + jvmArgs("--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED") + // Need to allow a java security manager after Java 21, for Subject.getSubject to work + // "getSubject is supported only if a security manager is allowed". + systemProperty("java.security.manager", "allow") +} + +listOf("intTest", "cloudTest") + .map { tasks.named(it) } + .forEach { + it.configure { + maxParallelForks = 1 + + val logsDir = project.layout.buildDirectory.get().asFile.resolve("logs") + + // JVM arguments provider does not interfere with Gradle's cache keys + jvmArgumentProviders.add( + CommandLineArgumentProvider { + // Same issue as above: allow a java security manager after Java 21 + // (this setting is for the application under test, while the setting above is for test + // code). + val securityManagerAllow = "-Djava.security.manager=allow" + + val args = mutableListOf() + + // Example: to attach a debugger to the spawned JVM running Quarkus, add + // -Dquarkus.test.arg-line=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 + // to your test configuration. + val explicitQuarkusTestArgLine = System.getProperty("quarkus.test.arg-line") + var quarkusTestArgLine = + if (explicitQuarkusTestArgLine != null) + "$explicitQuarkusTestArgLine $securityManagerAllow" + else securityManagerAllow + + args.add("-Dquarkus.test.arg-line=$quarkusTestArgLine") + // This property is not honored in a per-profile application.properties file, + // so we need to set it here. + args.add("-Dquarkus.log.file.path=${logsDir.resolve("polaris.log").absolutePath}") + + // Add `quarkus.*` system properties, other than the ones explicitly set above + System.getProperties() + .filter { + it.key.toString().startsWith("quarkus.") && + !"quarkus.test.arg-line".equals(it.key) && + !"quarkus.log.file.path".equals(it.key) + } + .forEach { args.add("${it.key}=${it.value}") } + + args + } + ) + // delete files from previous runs + doFirst { + // delete log files written by Polaris + logsDir.deleteRecursively() + // delete quarkus.log file (captured Polaris stdout/stderr) + project.layout.buildDirectory.get().asFile.resolve("quarkus.log").delete() + } + } + } diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAdlsIT.java b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogAdlsIT.java similarity index 96% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAdlsIT.java rename to runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogAdlsIT.java index 6b8fd8dd18..c83f7a0c23 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAdlsIT.java +++ b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogAdlsIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisRestCatalogAdlsIntegrationTestBase; diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcsIT.java b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogGcsIT.java similarity index 96% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcsIT.java rename to runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogGcsIT.java index c098d0ba3b..580ee35cd7 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcsIT.java +++ b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogGcsIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisRestCatalogGcsIntegrationTestBase; diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogS3IT.java b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogS3IT.java similarity index 96% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogS3IT.java rename to runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogS3IT.java index 6e6f9d9669..ed77626d54 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogS3IT.java +++ b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogS3IT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisRestCatalogS3IntegrationTestBase; diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAdlsIT.java b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewAdlsIT.java similarity index 96% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAdlsIT.java rename to runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewAdlsIT.java index b3980b252f..f37eea951a 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAdlsIT.java +++ b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewAdlsIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisRestCatalogViewAdlsIntegrationTestBase; diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcsIT.java b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewGcsIT.java similarity index 96% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcsIT.java rename to runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewGcsIT.java index 0b4b9def4f..a1c60764c1 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcsIT.java +++ b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewGcsIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisRestCatalogViewGcsIntegrationTestBase; diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewS3IT.java b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewS3IT.java similarity index 96% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewS3IT.java rename to runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewS3IT.java index 936bc1d480..39b09c7052 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewS3IT.java +++ b/runtime/server/src/cloudTest/java/org/apache/polaris/server/it/RestCatalogViewS3IT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisRestCatalogViewS3IntegrationTestBase; diff --git a/runtime/service/src/cloudTest/resources/META-INF/services/org.apache.polaris.service.it.ext.PolarisServerManager b/runtime/server/src/cloudTest/resources/META-INF/services/org.apache.polaris.service.it.ext.PolarisServerManager similarity index 100% rename from runtime/service/src/cloudTest/resources/META-INF/services/org.apache.polaris.service.it.ext.PolarisServerManager rename to runtime/server/src/cloudTest/resources/META-INF/services/org.apache.polaris.service.it.ext.PolarisServerManager diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/ApplicationIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/ApplicationIT.java similarity index 96% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/ApplicationIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/ApplicationIT.java index 61689259f4..53cf2b559c 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/ApplicationIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/ApplicationIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisApplicationIntegrationTest; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/ManagementServiceIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/ManagementServiceIT.java similarity index 96% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/ManagementServiceIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/ManagementServiceIT.java index 5cdfc14296..00df6fe5a4 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/ManagementServiceIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/ManagementServiceIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisManagementServiceIntegrationTest; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/PolarisRestCatalogMinIOIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/PolarisRestCatalogMinIOIT.java similarity index 98% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/PolarisRestCatalogMinIOIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/PolarisRestCatalogMinIOIT.java index 48a19d8aed..283ced3878 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/PolarisRestCatalogMinIOIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/PolarisRestCatalogMinIOIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import com.google.common.collect.ImmutableMap; import io.quarkus.test.junit.QuarkusIntegrationTest; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/PolicyServiceIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/PolicyServiceIT.java similarity index 96% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/PolicyServiceIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/PolicyServiceIT.java index 4f127cd5eb..cd44ebec0b 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/PolicyServiceIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/PolicyServiceIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisPolicyServiceIntegrationTest; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogFileIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogFileIT.java similarity index 96% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogFileIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogFileIT.java index 1e2b48e2df..9e2caf810c 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogFileIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogFileIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import org.apache.polaris.service.it.test.PolarisRestCatalogFileIntegrationTest; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogKeycloakFileIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogKeycloakFileIT.java similarity index 98% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogKeycloakFileIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogKeycloakFileIT.java index 842ed4ffbe..94fd8fc7d0 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogKeycloakFileIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogKeycloakFileIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.quarkus.test.junit.TestProfile; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogMinIOSpecialIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogMinIOSpecialIT.java similarity index 99% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogMinIOSpecialIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogMinIOSpecialIT.java index 3cc2ac9648..6c34984411 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogMinIOSpecialIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogMinIOSpecialIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.iceberg.CatalogProperties.TABLE_DEFAULT_PREFIX; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogViewFileIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogViewFileIT.java similarity index 97% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogViewFileIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogViewFileIT.java index 36c7d191d5..4762d5da3a 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/RestCatalogViewFileIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/RestCatalogViewFileIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it; +package org.apache.polaris.server.it; import io.quarkus.test.junit.QuarkusIntegrationTest; import java.lang.reflect.Field; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcApplicationIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcApplicationIT.java similarity index 95% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcApplicationIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcApplicationIT.java index fe9b8eaf30..e1abf15e77 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcApplicationIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcApplicationIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it.relational.jdbc; +package org.apache.polaris.server.it.relational.jdbc; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.quarkus.test.junit.TestProfile; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcManagementServiceIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcManagementServiceIT.java similarity index 95% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcManagementServiceIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcManagementServiceIT.java index 045c0c20ca..2241679d77 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcManagementServiceIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcManagementServiceIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it.relational.jdbc; +package org.apache.polaris.server.it.relational.jdbc; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.quarkus.test.junit.TestProfile; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcPolicyServiceIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcPolicyServiceIT.java similarity index 95% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcPolicyServiceIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcPolicyServiceIT.java index c2dc16568c..00c2b95c3d 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcPolicyServiceIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcPolicyServiceIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it.relational.jdbc; +package org.apache.polaris.server.it.relational.jdbc; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.quarkus.test.junit.TestProfile; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcRestCatalogIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcRestCatalogIT.java similarity index 95% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcRestCatalogIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcRestCatalogIT.java index b3ee80ae8c..fd7ee2ae36 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcRestCatalogIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcRestCatalogIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it.relational.jdbc; +package org.apache.polaris.server.it.relational.jdbc; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.quarkus.test.junit.TestProfile; diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcViewFileIT.java b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcViewFileIT.java similarity index 95% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcViewFileIT.java rename to runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcViewFileIT.java index 30b9303fd4..4c3298b781 100644 --- a/runtime/service/src/intTest/java/org/apache/polaris/service/it/relational/jdbc/JdbcViewFileIT.java +++ b/runtime/server/src/intTest/java/org/apache/polaris/server/it/relational/jdbc/JdbcViewFileIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.service.it.relational.jdbc; +package org.apache.polaris.server.it.relational.jdbc; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.quarkus.test.junit.TestProfile; diff --git a/runtime/service/src/intTest/resources/META-INF/services/org.apache.polaris.service.it.ext.PolarisServerManager b/runtime/server/src/intTest/resources/META-INF/services/org.apache.polaris.service.it.ext.PolarisServerManager similarity index 100% rename from runtime/service/src/intTest/resources/META-INF/services/org.apache.polaris.service.it.ext.PolarisServerManager rename to runtime/server/src/intTest/resources/META-INF/services/org.apache.polaris.service.it.ext.PolarisServerManager diff --git a/runtime/service/README.md b/runtime/service/README.md index fd4893a505..0fe4c74363 100644 --- a/runtime/service/README.md +++ b/runtime/service/README.md @@ -21,28 +21,3 @@ ## Overview The `polaris-runtime-service` module is the core runtime service implementation of Apache Polaris. It serves as the main service layer that provides the REST API endpoints and business logic. - -## Integration tests - -Integration tests from the :polaris-tests module can be run against a local Polaris Quarkus instance -for each supported cloud storage. Set the appropriate environment variables for your target cloud, -then run the tests as shown below. - -For S3: -```shell -export INTEGRATION_TEST_S3_PATH="s3://bucket/subpath" -export INTEGRATION_TEST_S3_ROLE_ARN="your-role-arn" -./gradlew :polaris-runtime-service:cloudTest -``` -For ADLS: -```shell -export INTEGRATION_TEST_AZURE_PATH="abfss://bucket/subpath" -export INTEGRATION_TEST_AZURE_TENANT_ID="your-tenant-id" -./gradlew :polaris-runtime-service:cloudTest -``` -For GCS: -```shell -export INTEGRATION_TEST_GCS_PATH="gs://bucket/subpath" -export INTEGRATION_TEST_GCS_SERVICE_ACCOUNT="your-service-account" -./gradlew :polaris-runtime-service:cloudTest -``` diff --git a/runtime/service/build.gradle.kts b/runtime/service/build.gradle.kts index 9dcd8c5885..1340defc23 100644 --- a/runtime/service/build.gradle.kts +++ b/runtime/service/build.gradle.kts @@ -204,57 +204,3 @@ tasks.withType(Test::class.java).configureEach { // "getSubject is supported only if a security manager is allowed". systemProperty("java.security.manager", "allow") } - -listOf("intTest", "cloudTest") - .map { tasks.named(it) } - .forEach { - it.configure { - maxParallelForks = 1 - - val logsDir = project.layout.buildDirectory.get().asFile.resolve("logs") - - // JVM arguments provider does not interfere with Gradle's cache keys - jvmArgumentProviders.add( - CommandLineArgumentProvider { - // Same issue as above: allow a java security manager after Java 21 - // (this setting is for the application under test, while the setting above is for test - // code). - val securityManagerAllow = "-Djava.security.manager=allow" - - val args = mutableListOf() - - // Example: to attach a debugger to the spawned JVM running Quarkus, add - // -Dquarkus.test.arg-line=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - // to your test configuration. - val explicitQuarkusTestArgLine = System.getProperty("quarkus.test.arg-line") - var quarkusTestArgLine = - if (explicitQuarkusTestArgLine != null) - "$explicitQuarkusTestArgLine $securityManagerAllow" - else securityManagerAllow - - args.add("-Dquarkus.test.arg-line=$quarkusTestArgLine") - // This property is not honored in a per-profile application.properties file, - // so we need to set it here. - args.add("-Dquarkus.log.file.path=${logsDir.resolve("polaris.log").absolutePath}") - - // Add `quarkus.*` system properties, other than the ones explicitly set above - System.getProperties() - .filter { - it.key.toString().startsWith("quarkus.") && - !"quarkus.test.arg-line".equals(it.key) && - !"quarkus.log.file.path".equals(it.key) - } - .forEach { args.add("${it.key}=${it.value}") } - - args - } - ) - // delete files from previous runs - doFirst { - // delete log files written by Polaris - logsDir.deleteRecursively() - // delete quarkus.log file (captured Polaris stdout/stderr) - project.layout.buildDirectory.get().asFile.resolve("quarkus.log").delete() - } - } - } diff --git a/runtime/service/src/intTest/java/org/apache/polaris/service/it/ServiceProducersIT.java b/runtime/service/src/test/java/org/apache/polaris/service/it/ServiceProducersIT.java similarity index 100% rename from runtime/service/src/intTest/java/org/apache/polaris/service/it/ServiceProducersIT.java rename to runtime/service/src/test/java/org/apache/polaris/service/it/ServiceProducersIT.java