Enable execution of muted on database tests marked as FLAKY (KTI-288)
It became possible to do, because all the muted flaky tests are now synchronized with TeamCity and muted there too
This commit is contained in:
committed by
Yunir Salimzyanov
parent
27e7116f60
commit
e5bca3ce29
@@ -20,7 +20,7 @@ private val SKIP_MUTED_TESTS = java.lang.Boolean.getBoolean("org.jetbrains.kotli
|
|||||||
|
|
||||||
private fun isMutedInDatabase(testClass: Class<*>, methodKey: String): Boolean {
|
private fun isMutedInDatabase(testClass: Class<*>, methodKey: String): Boolean {
|
||||||
val mutedTest = mutedSet.mutedTest(testClass, methodKey)
|
val mutedTest = mutedSet.mutedTest(testClass, methodKey)
|
||||||
return mutedTest != null && (if (SKIP_MUTED_TESTS) !mutedTest.hasFailFile else mutedTest.isFlaky)
|
return SKIP_MUTED_TESTS && isPresentedInDatabaseWithoutFailMarker(mutedTest)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isMutedInDatabaseWithLog(testClass: Class<*>, methodKey: String): Boolean {
|
private fun isMutedInDatabaseWithLog(testClass: Class<*>, methodKey: String): Boolean {
|
||||||
@@ -49,8 +49,12 @@ internal fun wrapWithMuteInDatabase(testCase: TestCase, f: () -> Unit): (() -> U
|
|||||||
System.err.println(mutedMessage(testClass, methodKey))
|
System.err.println(mutedMessage(testClass, methodKey))
|
||||||
}
|
}
|
||||||
} else if (isPresentedInDatabaseWithoutFailMarker(mutedTest)) {
|
} else if (isPresentedInDatabaseWithoutFailMarker(mutedTest)) {
|
||||||
return {
|
if (mutedTest?.isFlaky == true) {
|
||||||
invertMutedTestResultWithLog(f, testKey)
|
return f
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
invertMutedTestResultWithLog(f, testKey)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return wrapWithAutoMute(f, testKey)
|
return wrapWithAutoMute(f, testKey)
|
||||||
@@ -86,9 +90,14 @@ class RunnerFactoryWithMuteInDatabase : ParametersRunnerFactory {
|
|||||||
val methodKey = parametrizedMethodKey(method, name)
|
val methodKey = parametrizedMethodKey(method, name)
|
||||||
val mutedTest = getMutedTest(methodClass, methodKey) ?: getMutedTest(methodClass, method.method.name)
|
val mutedTest = getMutedTest(methodClass, methodKey) ?: getMutedTest(methodClass, method.method.name)
|
||||||
if (isPresentedInDatabaseWithoutFailMarker(mutedTest)) {
|
if (isPresentedInDatabaseWithoutFailMarker(mutedTest)) {
|
||||||
val testKey = testKey(methodClass, methodKey)
|
if (mutedTest?.isFlaky == true) {
|
||||||
invertMutedTestResultWithLog({ super.evaluate() }, testKey)
|
super.evaluate()
|
||||||
return
|
return
|
||||||
|
} else {
|
||||||
|
val testKey = testKey(methodClass, methodKey)
|
||||||
|
invertMutedTestResultWithLog({ super.evaluate() }, testKey)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
super.evaluate()
|
super.evaluate()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user