Fix test expects slightly different variant selection error message.

Error message was slightly changed on Gradle 7.

^KT-44949 In Progress
This commit is contained in:
Yahor Berdnikau
2021-03-01 16:00:20 +01:00
parent c96c50a73c
commit 2e1c1cd154
@@ -1004,17 +1004,30 @@ class KotlinGradleIT : BaseGradleIT() {
gradleBuildScript("projB").appendText("\nkotlin.target.attributes.attribute(targetAttribute, \"bar\")") gradleBuildScript("projB").appendText("\nkotlin.target.attributes.attribute(targetAttribute, \"bar\")")
build(":projB:compileKotlin") { build(":projB:compileKotlin") {
assertFailed() assertFailed()
if (projectGradleVersion < GradleVersion.version("6.4")) { when {
assertContains("Required com.example.target 'bar'") projectGradleVersion < GradleVersion.version("6.4") -> {
} else { assertContains("Required com.example.target 'bar'")
assertContains( }
"No matching variant of project :projA was found. The consumer was configured to find an API of a library " + projectGradleVersion < GradleVersion.version("6.8.4") -> {
"compatible with Java 8, preferably in the form of class files, " + assertContains(
"and its dependencies declared externally, " + "No matching variant of project :projA was found. The consumer was configured to find an API of a library " +
"as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm', " + "compatible with Java 8, preferably in the form of class files, " +
"attribute 'com.example.compilation' with value 'foo', " + "and its dependencies declared externally, " +
"attribute 'com.example.target' with value 'bar' but:" "as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm', " +
) "attribute 'com.example.compilation' with value 'foo', " +
"attribute 'com.example.target' with value 'bar' but:"
)
}
else -> {
assertContains(
"No matching variant of project :projA was found. The consumer was configured to find an API of a library " +
"compatible with Java 8, preferably in the form of class files, " +
"preferably optimized for standard JVMs, and its dependencies declared externally, " +
"as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm', " +
"attribute 'com.example.compilation' with value 'foo', " +
"attribute 'com.example.target' with value 'bar' but:"
)
}
} }
} }
@@ -1027,17 +1040,29 @@ class KotlinGradleIT : BaseGradleIT() {
) )
build(":projB:compileKotlin") { build(":projB:compileKotlin") {
assertFailed() assertFailed()
val projectGradleVersion = project.chooseWrapperVersionOrFinishTest() when {
if (GradleVersion.version(projectGradleVersion) < GradleVersion.version("6.4")) { projectGradleVersion < GradleVersion.version("6.4") -> {
assertContains("Required com.example.compilation 'bar'") assertContains("Required com.example.compilation 'bar'")
} else { }
assertContains( projectGradleVersion < GradleVersion.version("6.8.4") -> {
"No matching variant of project :projA was found. The consumer was configured to find an API of a library " + assertContains(
"compatible with Java 8, preferably in the form of class files, and its dependencies declared externally, " + "No matching variant of project :projA was found. The consumer was configured to find an API of a library " +
"as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm', " + "compatible with Java 8, preferably in the form of class files, and its dependencies declared externally, " +
"attribute 'com.example.compilation' with value 'bar', " + "as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm', " +
"attribute 'com.example.target' with value 'foo' but:" "attribute 'com.example.compilation' with value 'bar', " +
) "attribute 'com.example.target' with value 'foo' but:"
)
}
else -> {
assertContains(
"No matching variant of project :projA was found. The consumer was configured to find an API of a library " +
"compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, " +
"and its dependencies declared externally, " +
"as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm', " +
"attribute 'com.example.compilation' with value 'bar', " +
"attribute 'com.example.target' with value 'foo' but:"
)
}
} }
} }
} }