feat: clarifies that profile is not supported in parallel

This commit is contained in:
Nuno Maduro
2023-03-19 03:51:27 +00:00
parent 085d3436c8
commit d96ddaeaac
3 changed files with 29 additions and 1 deletions

View File

@ -95,6 +95,7 @@
"Pest\\Plugins\\Memory",
"Pest\\Plugins\\Printer",
"Pest\\Plugins\\ProcessIsolation",
"Pest\\Plugins\\Profile",
"Pest\\Plugins\\Retry",
"Pest\\Plugins\\Version",
"Pest\\Plugins\\Parallel"

28
src/Plugins/Profile.php Normal file
View File

@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Pest\Plugins;
use Pest\Contracts\Plugins\HandlesArguments;
use Pest\Exceptions\InvalidOption;
/**
* @internal
*/
final class Profile implements HandlesArguments
{
use Concerns\HandleArguments;
/**
* {@inheritDoc}
*/
public function handleArguments(array $arguments): array
{
if ($this->hasArgument('--parallel', $arguments)) {
throw new InvalidOption('The [--profile] option is not supported when running in parallel.');
}
return $arguments;
}
}

View File

@ -23,7 +23,6 @@ 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.');
}