From 4b244fcfe9fe561302eab2aaacd63632a48b5899 Mon Sep 17 00:00:00 2001 From: Iurii Ignatko Date: Fri, 15 Nov 2024 10:24:09 +0100 Subject: [PATCH] Remove toolchain for acceptance test --- acceptance-tests/build.gradle.kts | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/acceptance-tests/build.gradle.kts b/acceptance-tests/build.gradle.kts index 76e2295a..6e321a6f 100644 --- a/acceptance-tests/build.gradle.kts +++ b/acceptance-tests/build.gradle.kts @@ -11,6 +11,8 @@ plugins { val ciJenkinsBuild: Boolean by (gradle as ExtensionAware).extra java { + // Only used for compilation. We don't rely on toolchain for running the tests, + // as Jenkins ATH doesn't allow to specify the JAVA_HOME. toolchain { languageVersion.set(JavaLanguageVersion.of(11)) } @@ -80,14 +82,6 @@ jenkinsVersions !ciJenkinsBuild && !OperatingSystem.current().isWindows } - environment("JAVA_HOME", javaToolchains.launcherFor { - languageVersion.set(jenkinsVersion.javaVersion) - }.get().executablePath.toString()) - - javaLauncher.set(javaToolchains.launcherFor { - languageVersion.set(jenkinsVersion.javaVersion) - }) - systemProperties( mapOf( "jdk.xml.xpathExprOpLimit" to 150 @@ -106,7 +100,7 @@ jenkinsVersions } } -data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVersion: JavaLanguageVersion) { +data class JenkinsVersion(val version: String, val downloadUrl: URL) { companion object { @@ -118,14 +112,11 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer private val JENKINS_VERSION_PATTERN = "^\\d+([.]\\d+)*?\$".toRegex() - private val JAVA_11 = JavaLanguageVersion.of(11) - private val JAVA_17 = JavaLanguageVersion.of(17) - - val LATEST = of(LATEST_VERSION, JAVA_17) + val LATEST = of(LATEST_VERSION) val LATEST_LTS = of(LATEST_LTS_VERSION) val V2_401 = of(V2_401_VERSION) - private fun of(version: String, javaVersion: JavaLanguageVersion = JAVA_11): JenkinsVersion { + private fun of(version: String): JenkinsVersion { val downloadUrl = when (version) { LATEST_VERSION -> "${MIRROR}/current/latest/jenkins.war" @@ -138,7 +129,7 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer } } - return JenkinsVersion(version, URL(downloadUrl), javaVersion) + return JenkinsVersion(version, URL(downloadUrl)) } private fun isJenkinsVersion(version: String) = JENKINS_VERSION_PATTERN.matches(version) @@ -153,4 +144,5 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer } else { version.split("-").joinToString(separator = "") { it.capitalized() } } + }