Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ tasks.named<RatTask>("rat").configure {

excludes.add("logs/**")
excludes.add("service/common/src/**/banner.txt")
excludes.add("quarkus/service/logs")

excludes.add("site/node_modules/**")
excludes.add("site/layouts/robots.txt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.core.Response;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Instant;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -179,10 +181,16 @@ public void before(PolarisApiEndpoints apiEndpoints, ClientCredentials credentia
}

private SparkSession.Builder withCatalog(SparkSession.Builder builder, String catalogName) {
String warehouseLocation = System.getProperty("spark.sql.warehouse.dir");
Path warehouseDir =
warehouseLocation != null
? Paths.get(warehouseLocation)
: Paths.get(System.getProperty("user.dir"), "build", "intTest", "spark-warehouse");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about defaulting to a temp dir managed by JUnit5?

return builder
.config(
String.format("spark.sql.catalog.%s", catalogName),
"org.apache.iceberg.spark.SparkCatalog")
.config("spark.sql.warehouse.dir", warehouseDir.toString())
.config(String.format("spark.sql.catalog.%s.type", catalogName), "rest")
.config(
String.format("spark.sql.catalog.%s.uri", catalogName),
Expand Down
20 changes: 18 additions & 2 deletions quarkus/service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ dependencies {

tasks.withType(Test::class.java).configureEach {
systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager")
addSparkJvmOptions()
if (System.getenv("AWS_REGION") == null) {
environment("AWS_REGION", "us-west-2")
}
Expand All @@ -160,7 +159,24 @@ tasks.withType(Test::class.java).configureEach {

tasks.named<Test>("test").configure { maxParallelForks = 4 }

tasks.named<Test>("intTest").configure { maxParallelForks = 1 }
tasks.named<Test>("intTest").configure {
maxParallelForks = 1
val intTestDir = project.layout.buildDirectory.get().asFile.resolve("intTest")
// delete files from previous runs
doFirst {
intTestDir.deleteRecursively()
project.layout.buildDirectory.get().asFile.resolve("quarkus.log").delete()
}
// This property is not honored in a per-profile application.properties file,
// so we need to set it here.
systemProperty(
"quarkus.log.file.path",
intTestDir.resolve("logs").resolve("polaris.log").absolutePath,
)
// For Spark integration tests
addSparkJvmOptions()
systemProperty("spark.sql.warehouse.dir", intTestDir.resolve("spark-warehouse").absolutePath)
}

/**
* Adds the JPMS options required for Spark to run on Java 17, taken from the
Expand Down