-
-
Notifications
You must be signed in to change notification settings - Fork 443
[3.x] fix: respect --colors=never option in parallel mode #1430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1f97e6f
395888b
3c210e8
c2b6f40
75c2852
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| use Stringable; | ||
| use Symfony\Component\Console\Application; | ||
| use Symfony\Component\Console\Input\ArgvInput; | ||
| use Symfony\Component\Console\Output\ConsoleOutput; | ||
|
|
||
| use function Pest\version; | ||
|
|
||
|
|
@@ -127,7 +128,10 @@ private function runTestSuiteInParallel(array $arguments): int | |
| $arguments | ||
| ); | ||
|
|
||
| $exitCode = $this->paratestCommand()->run(new ArgvInput($filteredArguments), new CleanConsoleOutput); | ||
| $input = new ArgvInput($filteredArguments); | ||
| $isDecorated = $input->getParameterOption('--colors', 'always') !== 'never'; | ||
| $output = new CleanConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated); | ||
| $exitCode = $this->paratestCommand()->run($input, $output); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Main parallel process wasn't passing decoration setting to CleanConsoleOutput. Now checks |
||
|
|
||
| return CallsAddsOutput::execute($exitCode); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,11 +63,19 @@ public function __construct( | |
| * Creates a new instance of the Compact Printer. | ||
| */ | ||
| public static function default(): self | ||
| { | ||
| return self::create(true); | ||
| } | ||
|
|
||
| /** | ||
| * Creates a new instance of the Compact Printer with specific decoration setting. | ||
| */ | ||
| public static function create(bool $decorated): self | ||
| { | ||
| return new self( | ||
| terminal(), | ||
| new ConsoleOutput(decorated: true), | ||
| new Style(new ConsoleOutput(decorated: true)), | ||
| new ConsoleOutput(decorated: $decorated), | ||
| new Style(new ConsoleOutput(decorated: $decorated)), | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
| terminal()->width() - 4, | ||
| ); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1676,6 +1676,7 @@ | |
| PASS Tests\Visual\Parallel | ||
| ✓ parallel | ||
| ✓ a parallel test can extend another test with same name | ||
| ✓ parallel mode respects --colors=never option | ||
|
|
||
| PASS Tests\Visual\SingleTestOrDirectory | ||
| ✓ allows to run a single test | ||
|
|
@@ -1698,4 +1699,4 @@ | |
| WARN Tests\Visual\Version | ||
| - visual snapshot of help command output | ||
|
|
||
| Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 38 todos, 33 skipped, 1144 passed (2736 assertions) | ||
| Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 38 todos, 33 skipped, 1145 passed (2739 assertions) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unsure if I'm supposed to update the snapshot or not. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ | |
| 'dd', | ||
| 'dump', | ||
| 'expect', | ||
| 'ray', | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This actually stumps me a bit -- because everyone else's pipelines pass. Had to have Claude help me, and they pointed out that the issue seems to be that |
||
| 'uses', | ||
| 'Termwind', | ||
| 'ParaTest', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worker processes were hardcoded to use decorated output (
true), causing--colors=neverto be ignored in parallel mode. Now respects the--colorsparameter from command line arguments.