Add test for case when BuildFusService can't be injected

#KT-63990
This commit is contained in:
Nataliya.Valtman
2023-12-13 17:24:23 +01:00
committed by Space Team
parent 7b841d90e6
commit ed144a106d
5 changed files with 32 additions and 3 deletions
@@ -28,4 +28,20 @@ class ProjectIsolationIT : KGPBaseTest() {
build(":main-project:compileKotlin")
}
}
@DisplayName("project with buildSrc should be compatible with project isolation")
@GradleTestVersions(
minVersion = TestVersions.Gradle.G_7_4
)
@JvmGradlePluginTests
@GradleTest
fun testProjectIsolationWithBuildSrc(gradleVersion: GradleVersion) {
project(
projectName = "kt-63990-buildSrcWithKotlinJvmPlugin",
gradleVersion = gradleVersion,
buildOptions = defaultBuildOptions.copy(configurationCache = null)
) {
build("tasks")
}
}
}
@@ -24,7 +24,7 @@ data class BuildOptions(
val stacktraceMode: String? = StacktraceOption.FULL_STACKTRACE_LONG_OPTION,
val kotlinVersion: String = TestVersions.Kotlin.CURRENT,
val warningMode: WarningMode = WarningMode.Fail,
val configurationCache: Boolean = false,
val configurationCache: Boolean? = false, //null value is only for cases, when project isolation is used without configuration cache. Otherwise Gradle runner will throw exception "The configuration cache cannot be disabled when isolated projects is enabled."
val projectIsolation: Boolean = false,
val configurationCacheProblems: BaseGradleIT.ConfigurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL,
val parallel: Boolean = true,
@@ -117,8 +117,10 @@ data class BuildOptions(
WarningMode.None -> arguments.add("--warning-mode=none")
}
arguments.add("-Dorg.gradle.unsafe.configuration-cache=$configurationCache")
arguments.add("-Dorg.gradle.unsafe.configuration-cache-problems=${configurationCacheProblems.name.lowercase(Locale.getDefault())}")
if (configurationCache != null) {
arguments.add("-Dorg.gradle.unsafe.configuration-cache=$configurationCache")
arguments.add("-Dorg.gradle.unsafe.configuration-cache-problems=${configurationCacheProblems.name.lowercase(Locale.getDefault())}")
}
if (gradleVersion >= GradleVersion.version("7.1")) {
arguments.add("-Dorg.gradle.unsafe.isolated-projects=$projectIsolation")
@@ -0,0 +1,9 @@
plugins {
kotlin("jvm")
}
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}