Skip to content

Commit

Permalink
Simplify handling of runtime java for tests clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Jan 10, 2024
1 parent b5a6179 commit 4c0697c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ configure(allprojects) {
}
}
}

project.plugins.withType(RestTestBasePlugin) {
tasks.withType(StandaloneRestIntegTestTask).configureEach {
if (BuildParams.getIsRuntimeJavaHomeSet() == false) {
nonInputProperties.systemProperty("tests.runtime.java", "${-> launcher.map { it.metadata.installationPath.asFile.path }.get()}")
}
}
}

project.plugins.withType(ThirdPartyAuditPrecommitPlugin) {
project.getTasks().withType(ThirdPartyAuditTask.class).configureEach {
if (BuildParams.getIsRuntimeJavaHomeSet() == false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ public void apply(Project project) {
// Wire up integ-test distribution by default for all test tasks
FileCollection extracted = integTestDistro.getExtracted();
nonInputSystemProperties.systemProperty(INTEG_TEST_DISTRIBUTION_SYSPROP, () -> extracted.getSingleFile().getPath());
nonInputSystemProperties.systemProperty(TESTS_RUNTIME_JAVA_SYSPROP, BuildParams.getRuntimeJavaHome());

// Pass the current test task runtime java home to test framework via system property
nonInputSystemProperties.systemProperty(
TESTS_RUNTIME_JAVA_SYSPROP,
task.getJavaLauncher().map(l -> l.getMetadata().getInstallationPath().getAsFile().getPath())
);

// Add `usesDefaultDistribution()` extension method to test tasks to indicate they require the default distro
task.getExtensions().getExtraProperties().set("usesDefaultDistribution", new Closure<Void>(task) {
Expand Down

0 comments on commit 4c0697c

Please sign in to comment.