diff --git a/src/Logging/TeamCity/Converter.php b/src/Logging/TeamCity/Converter.php index 1f0de446..120e2f82 100644 --- a/src/Logging/TeamCity/Converter.php +++ b/src/Logging/TeamCity/Converter.php @@ -180,6 +180,13 @@ final class Converter */ public function getStateFromResult(PhpUnitTestResult $result): State { - return $this->stateGenerator->fromPhpUnitTestResult($result); + $numberOfPassedTests = $result->numberOfTestsRun() + - $result->numberOfTestErroredEvents() + - $result->numberOfTestFailedEvents() + - $result->numberOfTestSkippedEvents() + - $result->numberOfTestsWithTestConsideredRiskyEvents() + - $result->numberOfTestMarkedIncompleteEvents(); + + return $this->stateGenerator->fromPhpUnitTestResult($numberOfPassedTests, $result); } } diff --git a/src/Logging/TeamCity/TeamCityLogger.php b/src/Logging/TeamCity/TeamCityLogger.php index 9e5d6312..85994a84 100644 --- a/src/Logging/TeamCity/TeamCityLogger.php +++ b/src/Logging/TeamCity/TeamCityLogger.php @@ -91,7 +91,6 @@ final class TeamCityLogger public function testMarkedIncomplete(MarkedIncomplete $event): never { - // TODO: when does this trigger? throw ShouldNotHappen::fromMessage('testMarkedIncomplete not implemented.'); } diff --git a/tests/.snapshots/Failure.php.inc b/tests/.snapshots/Failure.php.inc index cc3837bd..cde5f942 100644 --- a/tests/.snapshots/Failure.php.inc +++ b/tests/.snapshots/Failure.php.inc @@ -18,3 +18,7 @@ ##teamcity[testIgnored name='build this one.' message='This test was ignored.' details='' flowId='1234'] ##teamcity[testFinished name='build this one.' duration='100000' flowId='1234'] ##teamcity[testSuiteFinished name='Tests/tests/Failure' flowId='1234'] + + Tests: 2 failed, 1 risky, 2 todos, 1 skipped (2 assertions) + Duration: 1.00s + diff --git a/tests/.snapshots/SuccessOnly.php.inc b/tests/.snapshots/SuccessOnly.php.inc index 5629be43..21e8a362 100644 --- a/tests/.snapshots/SuccessOnly.php.inc +++ b/tests/.snapshots/SuccessOnly.php.inc @@ -4,3 +4,7 @@ ##teamcity[testStarted name='can also pass' locationHint='pest_qn://tests/.tests/SuccessOnly.php::can also pass' flowId='1234'] ##teamcity[testFinished name='can also pass' duration='100000' flowId='1234'] ##teamcity[testSuiteFinished name='Tests/tests/SuccessOnly' flowId='1234'] + + Tests: 2 passed (2 assertions) + Duration: 1.00s +