fix: --retry with parallel

This commit is contained in:
Nuno Maduro
2023-02-11 17:39:46 +00:00
parent 6ddc5c8572
commit 052b9e051b
11 changed files with 67 additions and 28 deletions

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Pest\Plugins;
use Pest\Contracts\Plugins\HandlesArguments;
use Pest\Exceptions\InvalidOption;
/**
* @internal
@ -19,10 +20,15 @@ final class Retry implements HandlesArguments
public function handleArguments(array $arguments): array
{
if ($this->hasArgument('--retry', $arguments)) {
if ($this->hasArgument('--parallel', $arguments)) {
throw new InvalidOption('The --retry option is not supported when running in parallel.');
}
$arguments = $this->popArgument('--retry', $arguments);
$arguments = $this->pushArgument('--order-by=defects', $arguments);
$arguments = $this->pushArgument(' --stop-on-defect', $arguments);
$arguments = $this->pushArgument('--stop-on-failure', $arguments);
}
return $arguments;