[FIR] continue executing the test pipeline in a case of FirLazyResolveContractViolationException is thrown

Previously in the black-box test, no actual tests were run in a case FirLazyResolveContractViolationException were thrown
This commit is contained in:
Ilya Kirillov
2023-02-22 11:24:28 +01:00
parent d2f3dce8c9
commit dec9bdefb6
2 changed files with 13 additions and 2 deletions
@@ -134,7 +134,8 @@ class TestRunner(private val testConfiguration: TestConfiguration) {
for (step in testConfiguration.steps) {
if (!step.shouldProcessModule(module, inputArtifact)) continue
when (val result = step.hackyProcessModule(module, inputArtifact, allFailedExceptions.isNotEmpty())) {
val thereWereCriticalExceptionsOnPreviousSteps = allFailedExceptions.any { it.failureDisablesNextSteps }
when (val result = step.hackyProcessModule(module, inputArtifact, thereWereCriticalExceptionsOnPreviousSteps)) {
is TestStep.StepResult.Artifact<*> -> {
require(step is TestStep.FacadeStep<*, *>)
if (step.inputArtifactKind != step.outputArtifactKind) {
@@ -13,6 +13,13 @@ sealed class WrappedException(
val priority: Int,
val additionalPriority: Int
) : Exception(cause), Comparable<WrappedException> {
/**
* If [failureDisablesNextSteps] is `true`,
* then the following test steps might not be run considering this exception as critical.
* If false, the next steps will ignore this exception and continue running.
*/
open val failureDisablesNextSteps: Boolean get() = true
class FromFacade(cause: Throwable, val facade: AbstractTestFacade<*, *>) : WrappedException(cause, 0, 1) {
override val message: String
get() = "Exception was thrown"
@@ -20,7 +27,10 @@ sealed class WrappedException(
class FromMetaInfoHandler(cause: Throwable) : WrappedException(cause, 1, 1)
class FromHandler(cause: Throwable, val handler: AnalysisHandler<*>) : WrappedException(cause, 1, 2)
class FromHandler(cause: Throwable, val handler: AnalysisHandler<*>) : WrappedException(cause, 1, 2) {
override val failureDisablesNextSteps: Boolean
get() = handler.failureDisablesNextSteps
}
class FromAfterAnalysisChecker(cause: Throwable) : WrappedException(cause, 2, 1)