From c9fb8e6f52d4cdfd815bec22faac192ef5c647d0 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 18 Feb 2023 15:00:59 +0000 Subject: [PATCH] feat: improves parallel output --- .../Parallel/Support/CompactPrinter.php | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Plugins/Parallel/Support/CompactPrinter.php b/src/Plugins/Parallel/Support/CompactPrinter.php index cb917adf..ed25be77 100644 --- a/src/Plugins/Parallel/Support/CompactPrinter.php +++ b/src/Plugins/Parallel/Support/CompactPrinter.php @@ -77,14 +77,6 @@ final class CompactPrinter render('
'); } - /** - * Write the given message to the console, adding vertical and horizontal padding. - */ - public function line(string $message): void - { - render("{$message}"); - } - /** * Outputs the given description item from the ProgressPrinter as a gorgeous, colored symbol. */ @@ -119,7 +111,7 @@ final class CompactPrinter /** * Outputs a clean recap of the test run, including the number of tests, assertions, and failures. */ - public function recap(State $state, PHPUnitTestResult $testResult, Duration $duration): void + public function recap(State $state, PHPUnitTestResult $testResult, Duration $duration, Options $options): void { assert($this->output instanceof ConsoleOutput); @@ -140,5 +132,17 @@ final class CompactPrinter ); $this->style->writeRecap($state, $telemetry, $testResult); + + $this->output->write("\033[1A"); + + $this->output->write([ + sprintf( + ' Parallel: %s process%s', + $options->processes, + $options->processes > 1 ? 'es' : '', + ), + "\n", + "\n", + ]); } }