FIR/FIR IDE: fix FirFailingTestSuppressor for IDE

We need to have IdeTestIgnoreHandler executed after FirFailingTestSuppressor,
otherwise IdeTestIgnoreHandler will suppress exceptions
and FirFailingTestSuppressor will throw error
saying that file .fir.fail exists but test passes
This commit is contained in:
Ilya Kirillov
2021-06-01 18:10:01 +02:00
committed by teamcityserver
parent 948d9390d6
commit 20d1a84002
2 changed files with 10 additions and 6 deletions
@@ -19,9 +19,7 @@ class FirFailingTestSuppressor(testServices: TestServices) : AfterAnalysisChecke
return when {
failFile.exists() && exceptionFromFir != null -> emptyList()
failFile.exists() && exceptionFromFir == null -> {
emptyList()
// TODO: revert it when `DiagnosisCompilerTestFE10TestdataTestGenerated` supports `*.fir.fail` files
// failedAssertions + AssertionError("Fail file exists but no exception was throw. Please remove ${failFile.name}").wrap()
failedAssertions + AssertionError("Fail file exists but no exception was throw. Please remove ${failFile.name}").wrap()
}
else -> failedAssertions
}
@@ -13,8 +13,14 @@ import org.jetbrains.kotlin.idea.fir.low.level.api.compiler.based.IdeTestIgnoreH
abstract class AbstractDiagnosisCompilerTestDataTest : AbstractCompilerBasedTest() {
override fun TestConfigurationBuilder.configureTest() {
baseFirDiagnosticTestConfiguration()
useAfterAnalysisCheckers(
::IdeTestIgnoreHandler
)
/* IdeTestIgnoreHandler should be executed after FirFailingTestSuppressor,
otherwise IdeTestIgnoreHandler will suppress exceptions and FirFailingTestSuppressor will throw error
saying that file .fir.fail exists but test passes
*/
forTestsMatching("*") {
useAfterAnalysisCheckers(
::IdeTestIgnoreHandler
)
}
}
}