Do not fail build on TC when some tests fail, just report problem
Required to have green builds with failing tests muted.
This commit is contained in:
@@ -217,6 +217,7 @@ fun Task.listConfigurationContents(configName: String) {
|
|||||||
|
|
||||||
val defaultJvmTarget = "1.8"
|
val defaultJvmTarget = "1.8"
|
||||||
val defaultJavaHome = jdkPath(defaultJvmTarget!!)
|
val defaultJavaHome = jdkPath(defaultJvmTarget!!)
|
||||||
|
val ignoreTestFailures by extra(project.findProperty("ignoreTestFailures")?.toString()?.toBoolean() ?: project.hasProperty("teamcity"))
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
|
||||||
@@ -252,6 +253,10 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(VerificationTask::class.java as Class<Task>) {
|
||||||
|
(this as VerificationTask).ignoreFailures = ignoreTestFailures
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType<Javadoc> {
|
tasks.withType<Javadoc> {
|
||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}):
|
|||||||
environment("PROJECT_CLASSES_DIRS", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.asPath)
|
environment("PROJECT_CLASSES_DIRS", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.asPath)
|
||||||
environment("PROJECT_BUILD_DIR", buildDir)
|
environment("PROJECT_BUILD_DIR", buildDir)
|
||||||
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"])
|
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"])
|
||||||
ignoreFailures = System.getenv("kotlin_build_ignore_test_failures")?.let { it == "yes" } ?: false
|
|
||||||
body()
|
body()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -291,6 +291,7 @@ karma {
|
|||||||
|
|
||||||
karmaGenerateConfig.outputs.upToDateWhen { false }
|
karmaGenerateConfig.outputs.upToDateWhen { false }
|
||||||
karmaRun {
|
karmaRun {
|
||||||
|
ignoreExitValue = Boolean.valueOf(ignoreTestFailures)
|
||||||
dependsOn testClasses
|
dependsOn testClasses
|
||||||
dependsOn tasks.getByPath(':kotlin-test:kotlin-test-js:testClasses')
|
dependsOn tasks.getByPath(':kotlin-test:kotlin-test-js:testClasses')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user