Skip to content

Add polaris-server-test-runner plugin#4732

Merged
snazy merged 3 commits into
apache:mainfrom
snazy:polaris-server-int-tests
Jun 19, 2026
Merged

Add polaris-server-test-runner plugin#4732
snazy merged 3 commits into
apache:mainfrom
snazy:polaris-server-int-tests

Conversation

@snazy

@snazy snazy commented Jun 12, 2026

Copy link
Copy Markdown
Member

This new plugin for test purposes mainly buys us separation and faster feedback:

  • Test projects no longer need to build or embed a full Quarkus test app just to run against Polaris.
  • Tests can depend on a ready quarkus-run.jar via polarisServer(...), so the server lifecycle is externalized from the test JVM.
  • Less Quarkus application builds across all checks, improving overall test runtime.
  • Quarkus dependencies stop leaking into test classpaths, which reduces dependency conflicts with Spark, Iceberg, Hadoop, etc.
  • The plugin makes enforcedPlatform(libs.quarkus.bom) safer because Quarkus is mostly constrained to the app/server side instead of the tests.
  • Each test task can get its own isolated Polaris server instance and config.
  • Projects can use normal JvmTestSuites, which improves Gradle/IntelliJ behavior and keeps test classpaths scoped.
  • Custom server startup hooks still allow task-specific setup, like OPA/Testcontainers or RustFS, without baking those concerns into the plugin.

This new plugin for test purposes mainly buys us separation and faster feedback:

- Test projects no longer need to build or embed a full Quarkus test app just to run against Polaris.
- Tests can depend on a ready `quarkus-run.jar` via `polarisServer(...)`, so the server lifecycle is externalized from the test JVM.
- Less Quarkus application builds across all checks, improving overall test runtime.
- Quarkus dependencies stop leaking into test classpaths, which reduces dependency conflicts with Spark, Iceberg, Hadoop, etc.
- The plugin makes `enforcedPlatform(libs.quarkus.bom)` safer because Quarkus is mostly constrained to the app/server side instead of the tests.
- Each test task can get its own isolated Polaris server instance and config.
- Projects can use normal `JvmTestSuite`s, which improves Gradle/IntelliJ behavior and keeps test classpaths scoped.
- Custom server startup hooks still allow task-specific setup, like OPA/Testcontainers or RustFS, without baking those concerns into the plugin.
@snazy snazy force-pushed the polaris-server-int-tests branch from 9027de6 to 880e51b Compare June 18, 2026 13:39
/** Context passed to an isolated {@link PolarisServerStartupAction}. */
public interface PolarisServerStartupContext {
/** Build-configured action parameters. */
Map<String, String> getParameters();

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.

What are these parameters exactly? JVM parameters? Quarkus configuration properties?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the comment

failed.set(e)
ready.countDown()
} finally {
ready.countDown()

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.

nit: this would call countDown() twice in case of error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oops, good catch. Was actually worse, there's been another ready.countDown. Introduced an AtomicBoolean gate. It's triggered when either the listen-urls are captured or the process terminates.
Wasn't a real problem, but not good either.


private data class ListenUrls(val httpUrl: String, val managementUrl: String?) {
fun toPorts(): ServerPorts =
ServerPorts(URI.create(httpUrl).port, managementUrl?.let { URI.create(it).port })

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.

What happens if httpUrl does not have a port? Wouldn't URI.create(httpUrl).port return -1?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Should have never happened in practice, but the code now checks for that.

adutra
adutra previously approved these changes Jun 19, 2026
BufferedReader(InputStreamReader(process.inputStream)).useLines { lines ->
lines.forEach { line ->
logger.info("[polaris-server] {}", line)
synchronized(capturedOutput) { capturedOutput.add(line) }

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.

nit: maybe cap this collection at 200 elements, if that's all we will retain?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point - I let it capture only the first 200 lines.

Comment thread .gitignore
/.gradle
/build-logic/.gradle
/build-logic/.kotlin
/gradle/server-test-runner/.gradle

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.

nit: what is the reason for placing this plugin under ./gradle rather than somewhere inside ./build-logic?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yea some reasons:

  • it exposes a small API/SPI
  • when pulling that from build-logic we'd "pollute" the build-scripts's classpath with a lot of things (other plugins, etc)
  • can be tested standalone (Gradle's plugin test-kig)

@github-project-automation github-project-automation Bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jun 19, 2026
@snazy snazy merged commit 3f4143a into apache:main Jun 19, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to merge to Done in Basic Kanban Board Jun 19, 2026
@snazy snazy deleted the polaris-server-int-tests branch June 19, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants