Skip to content

Commit

Permalink
Merge pull request #1235 from pestphp/3.x_herd_fix
Browse files Browse the repository at this point in the history
Fixes parallel mutation testing when using Laravel Herd
  • Loading branch information
nunomaduro committed Sep 11, 2024
2 parents 47ce45d + b16e865 commit 45f1648
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Plugins/Parallel/Paratest/WrapperRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ public function __construct(
$parameters = array_merge($parameters, $options->passthruPhp);
}

$parameters = $this->handleLaravelHerd($parameters);

$parameters[] = $wrapper;

$this->parameters = $parameters;
Expand Down Expand Up @@ -153,6 +155,21 @@ public function run(): int
return $this->complete($result);
}

/**
* Handles Laravel Herd's debug and coverage modes.
*
* @param array<string> $parameters
* @return array<string>
*/
private function handleLaravelHerd(array $parameters): array
{
if (isset($_ENV['HERD_DEBUG_INI'])) {
return array_merge($parameters, ['-c', $_ENV['HERD_DEBUG_INI']]);
}

return $parameters;
}

private function startWorkers(): void
{
for ($token = 1; $token <= $this->options->processes; $token++) {
Expand Down

0 comments on commit 45f1648

Please sign in to comment.