From d374a46c4dd3072ac0909d6e5d854f6a8390b40e Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 18 Feb 2023 15:00:49 +0000 Subject: [PATCH] feat: improves parallel output --- src/Plugins/Parallel/Paratest/ResultPrinter.php | 14 +------------- src/Plugins/Parallel/Paratest/WrapperRunner.php | 2 -- src/Plugins/Parallel/Support/CompactPrinter.php | 1 + 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/Plugins/Parallel/Paratest/ResultPrinter.php b/src/Plugins/Parallel/Paratest/ResultPrinter.php index e2f44e9a..71134d1f 100644 --- a/src/Plugins/Parallel/Paratest/ResultPrinter.php +++ b/src/Plugins/Parallel/Paratest/ResultPrinter.php @@ -20,7 +20,6 @@ use PHPUnit\TextUI\Output\Printer; use function preg_replace; use SebastianBergmann\Timer\Duration; use SplFileInfo; -use function sprintf; use function strlen; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Output\OutputInterface; @@ -76,17 +75,6 @@ final class ResultPrinter $this->teamcityLogFileHandle = $teamcityLogFileHandle; } - public function start(int $numberOfTests): void - { - $this->compactPrinter->line(sprintf( - 'Running %d test%s using %d process%s', - $numberOfTests, - $numberOfTests === 1 ? '' : 's', - $this->options->processes, - $this->options->processes === 1 ? '' : 'es') - ); - } - /** @param array $teamcityFiles */ public function printFeedback(SplFileInfo $progressFile, array $teamcityFiles): void { @@ -155,7 +143,7 @@ final class ResultPrinter $state = (new StateGenerator())->fromPhpUnitTestResult($testResult); $this->compactPrinter->errors($state); - $this->compactPrinter->recap($state, $testResult, $duration); + $this->compactPrinter->recap($state, $testResult, $duration, $this->options); } private function printFeedbackItem(string $item): void diff --git a/src/Plugins/Parallel/Paratest/WrapperRunner.php b/src/Plugins/Parallel/Paratest/WrapperRunner.php index e3426363..e2c7079e 100644 --- a/src/Plugins/Parallel/Paratest/WrapperRunner.php +++ b/src/Plugins/Parallel/Paratest/WrapperRunner.php @@ -121,8 +121,6 @@ final class WrapperRunner implements RunnerInterface $result = TestResultFacade::result(); - $this->printer->start($suiteLoader->testCount); - $this->timer->start(); $this->startWorkers(); diff --git a/src/Plugins/Parallel/Support/CompactPrinter.php b/src/Plugins/Parallel/Support/CompactPrinter.php index 339ad748..cb917adf 100644 --- a/src/Plugins/Parallel/Support/CompactPrinter.php +++ b/src/Plugins/Parallel/Support/CompactPrinter.php @@ -6,6 +6,7 @@ namespace Pest\Plugins\Parallel\Support; use NunoMaduro\Collision\Adapters\Phpunit\State; use NunoMaduro\Collision\Adapters\Phpunit\Style; +use ParaTest\Options; use PHPUnit\Event\Telemetry\HRTime; use PHPUnit\Event\Telemetry\Info; use PHPUnit\Event\Telemetry\MemoryUsage;