mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
chore(cleanup): Tidy-up and tweaks of Pest Parallel integration.
This commit is contained in:
@ -28,6 +28,10 @@ final class Parallel implements HandlesArguments
|
|||||||
Parallel\Handlers\Pest::class,
|
Parallel\Handlers\Pest::class,
|
||||||
Parallel\Handlers\Laravel::class,
|
Parallel\Handlers\Laravel::class,
|
||||||
];
|
];
|
||||||
|
/**
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
private const UNSUPPORTED_ARGUMENTS = ['--todo', '--retry'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the given command line arguments indicate that the test suite should be run in parallel.
|
* Whether the given command line arguments indicate that the test suite should be run in parallel.
|
||||||
@ -35,8 +39,10 @@ final class Parallel implements HandlesArguments
|
|||||||
public static function isEnabled(): bool
|
public static function isEnabled(): bool
|
||||||
{
|
{
|
||||||
$argv = new ArgvInput();
|
$argv = new ArgvInput();
|
||||||
|
if ($argv->hasParameterOption('--parallel')) {
|
||||||
return $argv->hasParameterOption('--parallel') || $argv->hasParameterOption('-p');
|
return true;
|
||||||
|
}
|
||||||
|
return $argv->hasParameterOption('-p');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,10 +162,9 @@ final class Parallel implements HandlesArguments
|
|||||||
*/
|
*/
|
||||||
private function hasArgumentsThatWouldBeFasterWithoutParallel(): bool
|
private function hasArgumentsThatWouldBeFasterWithoutParallel(): bool
|
||||||
{
|
{
|
||||||
$unsupportedArguments = ['--todo', '--retry'];
|
|
||||||
$arguments = new ArgvInput();
|
$arguments = new ArgvInput();
|
||||||
|
|
||||||
foreach ($unsupportedArguments as $unsupportedArgument) {
|
foreach (self::UNSUPPORTED_ARGUMENTS as $unsupportedArgument) {
|
||||||
if ($arguments->hasParameterOption($unsupportedArgument)) {
|
if ($arguments->hasParameterOption($unsupportedArgument)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,6 @@ final class Retry implements HandlesArguments
|
|||||||
|
|
||||||
$arguments = $this->pushArgument('--order-by=defects', $arguments);
|
$arguments = $this->pushArgument('--order-by=defects', $arguments);
|
||||||
|
|
||||||
$arguments = $this->pushArgument('--stop-on-failure', $arguments);
|
return $this->pushArgument('--stop-on-failure', $arguments);
|
||||||
|
|
||||||
return $arguments;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user