Update settings script properly, more tests with warning-mode=fail
For some test class where most of the sub tests are able to run warning-mode=fail, we should not disable that warning mode for all sub tests in that class.
This commit is contained in:
+6
-4
@@ -153,13 +153,15 @@ abstract class BaseGradleIT {
|
|||||||
return wrapper
|
return wrapper
|
||||||
}
|
}
|
||||||
|
|
||||||
fun mightUpdateSettingsScript(wrapperVersion: String, settingsScript: File) {
|
fun maybeUpdateSettingsScript(wrapperVersion: String, settingsScript: File) {
|
||||||
// enableFeaturePreview("GRADLE_METADATA") is no longer needed when building with Gradle 5.4 or above
|
// enableFeaturePreview("GRADLE_METADATA") is no longer needed when building with Gradle 5.4 or above
|
||||||
if (GradleVersion.version(wrapperVersion) > GradleVersion.version("5.3")) {
|
if (GradleVersion.version(wrapperVersion) >= GradleVersion.version("5.4")) {
|
||||||
settingsScript.apply {
|
settingsScript.apply {
|
||||||
if(exists()) {
|
if(exists()) {
|
||||||
modify {
|
modify {
|
||||||
it.replace("enableFeaturePreview('GRADLE_METADATA')", "//")
|
it.replace("enableFeaturePreview('GRADLE_METADATA')", "//")
|
||||||
|
}
|
||||||
|
modify {
|
||||||
it.replace("enableFeaturePreview(\"GRADLE_METADATA\")", "//")
|
it.replace("enableFeaturePreview(\"GRADLE_METADATA\")", "//")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -336,8 +338,6 @@ abstract class BaseGradleIT {
|
|||||||
val env = createEnvironmentVariablesMap(options)
|
val env = createEnvironmentVariablesMap(options)
|
||||||
val wrapperDir = prepareWrapper(wrapperVersion, env)
|
val wrapperDir = prepareWrapper(wrapperVersion, env)
|
||||||
|
|
||||||
mightUpdateSettingsScript(wrapperVersion, gradleSettingsScript())
|
|
||||||
|
|
||||||
val cmd = createBuildCommand(wrapperDir, params, options)
|
val cmd = createBuildCommand(wrapperDir, params, options)
|
||||||
|
|
||||||
println("<=== Test build: ${this.projectName} $cmd ===>")
|
println("<=== Test build: ${this.projectName} $cmd ===>")
|
||||||
@@ -346,6 +346,8 @@ abstract class BaseGradleIT {
|
|||||||
setupWorkingDir()
|
setupWorkingDir()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maybeUpdateSettingsScript(wrapperVersion, gradleSettingsScript())
|
||||||
|
|
||||||
val result = runProcess(cmd, projectDir, env, options)
|
val result = runProcess(cmd, projectDir, env, options)
|
||||||
try {
|
try {
|
||||||
CompiledProject(this, result.output, result.exitCode).check()
|
CompiledProject(this, result.output, result.exitCode).check()
|
||||||
|
|||||||
+5
-3
@@ -19,8 +19,7 @@ class ConfigurationCacheForAndroidIT : AbstractConfigurationCacheIT() {
|
|||||||
androidHome = KotlinTestUtils.findAndroidSdk(),
|
androidHome = KotlinTestUtils.findAndroidSdk(),
|
||||||
androidGradlePluginVersion = androidGradlePluginVersion,
|
androidGradlePluginVersion = androidGradlePluginVersion,
|
||||||
configurationCache = true,
|
configurationCache = true,
|
||||||
configurationCacheProblems = ConfigurationCacheProblems.FAIL,
|
configurationCacheProblems = ConfigurationCacheProblems.FAIL
|
||||||
warningMode = WarningMode.Summary
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -39,7 +38,10 @@ class ConfigurationCacheForAndroidIT : AbstractConfigurationCacheIT() {
|
|||||||
@Test
|
@Test
|
||||||
fun testKotlinAndroidProjectTests() = with(Project("AndroidIncrementalMultiModule")) {
|
fun testKotlinAndroidProjectTests() = with(Project("AndroidIncrementalMultiModule")) {
|
||||||
applyAndroid40Alpha4KotlinVersionWorkaround()
|
applyAndroid40Alpha4KotlinVersionWorkaround()
|
||||||
testConfigurationCacheOf(":app:compileDebugAndroidTestKotlin", ":app:compileDebugUnitTestKotlin")
|
testConfigurationCacheOf(
|
||||||
|
":app:compileDebugAndroidTestKotlin", ":app:compileDebugUnitTestKotlin",
|
||||||
|
buildOptions = defaultBuildOptions().copy(warningMode = WarningMode.Summary)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -93,7 +93,7 @@ abstract class AbstractConfigurationCacheIT : BaseGradleIT() {
|
|||||||
checkInstantExecutionSucceeded()
|
checkInstantExecutionSucceeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
build("clean") {
|
build("clean", options = buildOptions) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-6
@@ -36,10 +36,6 @@ import kotlin.test.assertTrue
|
|||||||
|
|
||||||
class KotlinGradleIT : BaseGradleIT() {
|
class KotlinGradleIT : BaseGradleIT() {
|
||||||
|
|
||||||
override fun defaultBuildOptions(): BuildOptions {
|
|
||||||
return super.defaultBuildOptions().copy(warningMode = WarningMode.Summary)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testCrossCompile() {
|
fun testCrossCompile() {
|
||||||
val project = Project("kotlinJavaProject")
|
val project = Project("kotlinJavaProject")
|
||||||
@@ -395,7 +391,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
|||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
}
|
}
|
||||||
|
|
||||||
project.build("build", "install") {
|
project.build("build", "install", options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertTasksExecuted(":compileKotlin", ":compileTestKotlin")
|
assertTasksExecuted(":compileKotlin", ":compileTestKotlin")
|
||||||
val pomLines = File(project.projectDir, "build/poms/pom-default.xml").readLines()
|
val pomLines = File(project.projectDir, "build/poms/pom-default.xml").readLines()
|
||||||
@@ -934,7 +930,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
|||||||
setupWorkingDir()
|
setupWorkingDir()
|
||||||
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
|
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
|
||||||
|
|
||||||
build("publish", "check", "runBenchmark") {
|
build("publish", "check", "runBenchmark", options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertTasksExecuted(":compileKotlin", ":compileTestKotlin", ":compileBenchmarkKotlin", ":test", ":runBenchmark")
|
assertTasksExecuted(":compileKotlin", ":compileTestKotlin", ":compileBenchmarkKotlin", ":test", ":runBenchmark")
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.util
|
package org.jetbrains.kotlin.gradle.util
|
||||||
|
|
||||||
|
import org.gradle.api.logging.configuration.WarningMode
|
||||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
@@ -31,7 +32,7 @@ fun BaseGradleIT.Project.testResolveAllConfigurations(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
build(RESOLVE_ALL_CONFIGURATIONS_TASK_NAME) {
|
build(RESOLVE_ALL_CONFIGURATIONS_TASK_NAME, options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertTasksExecuted(":${subproject?.let { "$it:" }.orEmpty()}$RESOLVE_ALL_CONFIGURATIONS_TASK_NAME")
|
assertTasksExecuted(":${subproject?.let { "$it:" }.orEmpty()}$RESOLVE_ALL_CONFIGURATIONS_TASK_NAME")
|
||||||
val unresolvedConfigurations = unresolvedConfigurationRegex.findAll(output).map { it.groupValues[1] }.toList()
|
val unresolvedConfigurations = unresolvedConfigurationRegex.findAll(output).map { it.groupValues[1] }.toList()
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ const val IMPLEMENT_DEPRECATION_WARNING = "The '$IMPLEMENT_CONFIG_NAME' configur
|
|||||||
open class KotlinPlatformImplementationPluginBase(platformName: String) : KotlinPlatformPluginBase(platformName) {
|
open class KotlinPlatformImplementationPluginBase(platformName: String) : KotlinPlatformPluginBase(platformName) {
|
||||||
private val commonProjects = arrayListOf<Project>()
|
private val commonProjects = arrayListOf<Project>()
|
||||||
|
|
||||||
protected open fun configurationsForCommonModuleDependency(project: Project): List<Configuration> =
|
private fun configurationsForCommonModuleDependency(project: Project): List<Configuration> =
|
||||||
listOf(project.configurations.getByName("api"))
|
listOf(project.configurations.getByName("api"))
|
||||||
|
|
||||||
override fun apply(project: Project) {
|
override fun apply(project: Project) {
|
||||||
|
|||||||
Reference in New Issue
Block a user