snazy commented on code in PR #4588:
URL: https://github.com/apache/polaris/pull/4588#discussion_r3407631348
##########
plugins/spark/v3.5/integration/build.gradle.kts:
##########
@@ -169,3 +185,75 @@ tasks.named<Test>("intTest").configure {
// For Spark integration tests
addSparkJvmOptions()
}
+
+// Bundle-jar sanity test
+testing {
+ suites {
+ register<JvmTestSuite>("sparkBundleTest") {
+ useJUnitJupiter()
+ dependencies {
+
implementation("org.apache.spark:spark-sql_${scalaVersion}:${spark35Version}") {
+ exclude("org.apache.logging.log4j", "log4j-slf4j2-impl")
+ exclude("org.apache.logging.log4j", "log4j-1.2-api")
+ exclude("org.apache.logging.log4j", "log4j-core")
+ exclude("org.slf4j", "jul-to-slf4j")
+ }
+ implementation(
+
"org.apache.iceberg:iceberg-spark-runtime-${sparkMajorVersion}_${scalaVersion}:${icebergVersion}"
+ )
+
implementation(enforcedPlatform("org.scala-lang:scala-library:${scalaLibraryVersion}"))
+
implementation(enforcedPlatform("org.scala-lang:scala-reflect:${scalaLibraryVersion}"))
+ implementation(libs.antlr4.runtime.spark35)
+ implementation(libs.javax.servlet.api)
+ runtimeOnly("org.apache.logging.log4j:log4j-core:2.26.0")
+
+ implementation(project(":polaris-api-management-model"))
+ implementation(testFixtures(project(":polaris-runtime-service")))
+
+ implementation(platform(libs.quarkus.bom))
+ implementation("io.quarkus:quarkus-junit")
+ implementation(libs.assertj.core)
+ }
+ targets.all {
+ testTask.configure {
+ systemProperty("build.output.directory",
layout.buildDirectory.asFile.get())
+ dependsOn(tasks.named("quarkusBuild"))
+
inputs.files(SparkBundleClasspath).withPropertyName("polarisSparkBundle")
+ doFirst {
+ systemProperty("polaris.spark.bundle.jar",
SparkBundleClasspath.singleFile.absolutePath)
+ }
+ systemProperty("polaris.version", project.version.toString())
+ systemProperty("polaris.scala.version", scalaVersion)
+ dependsOn(":publishToMavenLocal")
+ dependsOn(":polaris-core:publishMavenPublicationToMavenLocal")
+ dependsOn(
+
":polaris-spark-${sparkMajorVersion}_${scalaVersion}:publishMavenPublicationToMavenLocal"
+ )
+ jvmArgumentProviders.add(CommandLineArgumentProvider {
listOf("-Dquarkus.profile=it") })
+
+ if (System.getenv("AWS_REGION") == null) {
+ environment("AWS_REGION", "us-west-2")
+ }
Review Comment:
```suggestion
environment("AWS_REGION",
providers.environmentVariable("AWS_REGION").orElse("us-west-2"))
```
##########
plugins/spark/v3.5/integration/build.gradle.kts:
##########
Review Comment:
```suggestion
environment("AWS_REGION",
providers.environmentVariable("AWS_REGION").orElse("us-west-2"))
```
##########
plugins/spark/v3.5/integration/build.gradle.kts:
##########
@@ -162,3 +171,76 @@ tasks.named<Test>("intTest").configure {
// For Spark integration tests
addSparkJvmOptions()
}
+
+// Bundle-jar sanity test
+testing {
+ suites {
+ register<JvmTestSuite>("sparkBundleTest") {
+ useJUnitJupiter()
+ dependencies {
+
implementation("org.apache.spark:spark-sql_${scalaVersion}:${spark35Version}") {
+ exclude("org.apache.logging.log4j", "log4j-slf4j2-impl")
+ exclude("org.apache.logging.log4j", "log4j-1.2-api")
+ exclude("org.apache.logging.log4j", "log4j-core")
+ exclude("org.slf4j", "jul-to-slf4j")
+ }
+ implementation(
+
"org.apache.iceberg:iceberg-spark-runtime-${sparkMajorVersion}_${scalaVersion}:${icebergVersion}"
+ )
+
implementation(enforcedPlatform("org.scala-lang:scala-library:${scalaLibraryVersion}"))
+
implementation(enforcedPlatform("org.scala-lang:scala-reflect:${scalaLibraryVersion}"))
+ implementation(libs.antlr4.runtime)
+ implementation(libs.javax.servlet.api)
+ runtimeOnly("org.apache.logging.log4j:log4j-core:2.26.0")
+
+ implementation(project(":polaris-api-management-model"))
+ implementation(testFixtures(project(":polaris-runtime-service")))
+
+ implementation(platform(libs.quarkus.bom))
+ implementation("io.quarkus:quarkus-junit")
+ implementation(libs.assertj.core)
+ }
+ targets.all {
+ testTask.configure {
+ systemProperty("build.output.directory",
layout.buildDirectory.asFile.get())
+ dependsOn(tasks.named("quarkusBuild"))
+ dependsOn(sparkBundleJarTask)
+ systemProperty(
+ "polaris.spark.bundle.jar",
+ sparkBundleJarTask.flatMap { it.archiveFile
}.get().asFile.absolutePath,
+ )
+ systemProperty("polaris.version", project.version.toString())
+ systemProperty("polaris.scala.version", scalaVersion)
+ dependsOn(":publishToMavenLocal")
+ dependsOn(":polaris-core:publishMavenPublicationToMavenLocal")
+ dependsOn(
+
":polaris-spark-${sparkMajorVersion}_${scalaVersion}:publishMavenPublicationToMavenLocal"
+ )
Review Comment:
I don't think that we need to test Maven/Ivy artifact resolution of
`SparkSubmitUtils` here.
But we should really avoid adding cross-project references.
Plus publishing functionality is generally not cachable.
AFAIK users should use the bundle jar, which contains everything.
--
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]