fix: retry option should not be used in parallel

This commit is contained in:
Nuno Maduro
2023-02-20 16:26:01 +00:00
parent 23b42730ba
commit 0348037638

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Pest\Plugins;
use Pest\Contracts\Plugins\HandlesArguments;
use Pest\Exceptions\InvalidOption;
/**
* @internal
@ -22,6 +23,11 @@ final class Retry implements HandlesArguments
return $arguments;
}
// If running in parallel, we need to disable the retry plugin
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);