[Gradle] Check if configuration cache was stored in JS CoCa tests

This commit is contained in:
Alexander Likhachev
2023-01-03 19:20:20 +01:00
committed by Space Team
parent 89811f8d95
commit 51b011706b
2 changed files with 11 additions and 3 deletions
@@ -61,7 +61,9 @@ abstract class AbstractJsConfigurationCacheIT(protected val irBackend: Boolean)
@GradleTest
fun testBrowserDistributionOnIdeaPropertyChange(gradleVersion: GradleVersion) {
project("kotlin-js-browser-project", gradleVersion) {
build(":app:build")
build(":app:build") {
assertConfigurationCacheStored()
}
// check IdeaPropertiesEvaluator for the logic
build(":app:build", "-Didea.version=2020.1") {
assertConfigurationCacheReused()
@@ -99,7 +101,9 @@ abstract class AbstractJsConfigurationCacheIT(protected val irBackend: Boolean)
@GradleTest
fun testNodeJsOnIdeaPropertyChange(gradleVersion: GradleVersion) {
project("kotlin-js-nodejs-project", gradleVersion) {
build(":build")
build(":build") {
assertConfigurationCacheStored()
}
// check IdeaPropertiesEvaluator for the logic
build(":build", "-Didea.version=2020.1") {
assertConfigurationCacheReused()
@@ -33,7 +33,7 @@ fun TestProject.assertSimpleConfigurationCacheScenarioWorks(
"Calculating task graph as no configuration cache is available for tasks: ${buildArguments.joinToString(separator = " ")}"
)
assertOutputContains("Configuration cache entry stored.")
assertConfigurationCacheStored()
}
build("clean", buildOptions = buildOptions)
@@ -51,6 +51,10 @@ fun TestProject.assertSimpleConfigurationCacheScenarioWorks(
}
}
fun BuildResult.assertConfigurationCacheStored() {
assertOutputContains("Configuration cache entry stored.")
}
fun BuildResult.assertConfigurationCacheReused() {
assertOutputContains("Reusing configuration cache.")
}