Skip to content

Commit

Permalink
Display time and consumed memory even in case of insufficient MSI (#1562
Browse files Browse the repository at this point in the history
)

`Time: 3s. Memory: 15Mb` - this is printed on `ApplicationExecutionWasFinished` event, but if MSI check fails, exception is thrown and `ApplicationExecutionWasFinished` is not dispatched, so time and memory is not printed.

This change fixes the issue. Now, `ApplicationExecutionWasFinished` event is dispatched regardless of thrown exception
  • Loading branch information
maks-rafalko committed Aug 29, 2021
1 parent 8cc8140 commit c87fab9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/Engine.php
Expand Up @@ -110,14 +110,16 @@ public function execute(): void
$this->runInitialTestSuite();
$this->runMutationAnalysis();

$this->minMsiChecker->checkMetrics(
$this->metricsCalculator->getTestedMutantsCount(),
$this->metricsCalculator->getMutationScoreIndicator(),
$this->metricsCalculator->getCoveredCodeMutationScoreIndicator(),
$this->consoleOutput
);

$this->eventDispatcher->dispatch(new ApplicationExecutionWasFinished());
try {
$this->minMsiChecker->checkMetrics(
$this->metricsCalculator->getTestedMutantsCount(),
$this->metricsCalculator->getMutationScoreIndicator(),
$this->metricsCalculator->getCoveredCodeMutationScoreIndicator(),
$this->consoleOutput
);
} finally {
$this->eventDispatcher->dispatch(new ApplicationExecutionWasFinished());
}
}

private function runInitialTestSuite(): void
Expand Down

0 comments on commit c87fab9

Please sign in to comment.