From d5764466393c60fcb6fc92e73fe63c9db451805f Mon Sep 17 00:00:00 2001 From: Oliver Nybroe Date: Wed, 4 Nov 2020 09:17:57 +0100 Subject: [PATCH] Improve exception output in teamcity printer --- src/TeamCity.php | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/TeamCity.php b/src/TeamCity.php index b5dec5ab6..b252ab389 100644 --- a/src/TeamCity.php +++ b/src/TeamCity.php @@ -24,7 +24,6 @@ final class TeamCity extends DefaultResultPrinter private const DURATION = 'duration'; private const TEST_SUITE_STARTED = 'testSuiteStarted'; private const TEST_SUITE_FINISHED = 'testSuiteFinished'; - private const TEST_FAILED = 'testFailed'; /** @var int */ private $flowId; @@ -149,19 +148,7 @@ public function endTest(Test $test, float $time): void */ public function addError(Test $test, Throwable $t, float $time): void { - if (!TeamCity::isPestTest($test)) { - $this->phpunitTeamCity->addError($test, $t, $time); - - return; - } - - $this->printEvent( - self::TEST_FAILED, [ - self::NAME => $test->getName(), - 'message' => $t->getMessage(), - 'details' => $t->getTraceAsString(), - self::DURATION => self::toMilliseconds($time), - ]); + $this->phpunitTeamCity->addError($test, $t, $time); } /** @@ -171,19 +158,7 @@ public function addError(Test $test, Throwable $t, float $time): void */ public function addWarning(Test $test, Warning $e, float $time): void { - if (!TeamCity::isPestTest($test)) { - $this->phpunitTeamCity->addWarning($test, $e, $time); - - return; - } - - $this->printEvent( - self::TEST_FAILED, [ - self::NAME => $test->getName(), - 'message' => $e->getMessage(), - 'details' => $e->getTraceAsString(), - self::DURATION => self::toMilliseconds($time), - ]); + $this->phpunitTeamCity->addWarning($test, $e, $time); } public function addFailure(Test $test, AssertionFailedError $e, float $time): void