mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
fix: --todos in parallel and feedback on process isolation
This commit is contained in:
5
bin/pest
5
bin/pest
@ -3,6 +3,7 @@
|
||||
|
||||
use Pest\ConfigLoader;
|
||||
use Pest\Kernel;
|
||||
use Pest\Panic;
|
||||
use Pest\TestCaseFilters\GitDirtyTestCaseFilter;
|
||||
use Pest\TestCaseMethodFilters\TodoTestCaseFilter;
|
||||
use Pest\TestSuite;
|
||||
@ -85,11 +86,15 @@ use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
|
||||
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated);
|
||||
|
||||
try {
|
||||
$kernel = Kernel::boot($testSuite, $input, $output);
|
||||
|
||||
$result = $kernel->handle($args);
|
||||
|
||||
$kernel->shutdown();
|
||||
} catch (Throwable|Error $e) {
|
||||
Panic::with($e);
|
||||
}
|
||||
|
||||
exit($result);
|
||||
})();
|
||||
|
||||
@ -94,6 +94,7 @@
|
||||
"Pest\\Plugins\\Help",
|
||||
"Pest\\Plugins\\Memory",
|
||||
"Pest\\Plugins\\Printer",
|
||||
"Pest\\Plugins\\ProcessIsolation",
|
||||
"Pest\\Plugins\\Retry",
|
||||
"Pest\\Plugins\\Version",
|
||||
"Pest\\Plugins\\Parallel"
|
||||
|
||||
@ -32,7 +32,7 @@ final class Parallel implements HandlesArguments
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private const UNSUPPORTED_ARGUMENTS = ['--todo', '--retry'];
|
||||
private const UNSUPPORTED_ARGUMENTS = ['--todos', '--retry'];
|
||||
|
||||
/**
|
||||
* Whether the given command line arguments indicate that the test suite should be run in parallel.
|
||||
|
||||
28
src/Plugins/ProcessIsolation.php
Normal file
28
src/Plugins/ProcessIsolation.php
Normal 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 ProcessIsolation implements HandlesArguments
|
||||
{
|
||||
use Concerns\HandleArguments;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function handleArguments(array $arguments): array
|
||||
{
|
||||
if ($this->hasArgument('--process-isolation', $arguments)) {
|
||||
throw new InvalidOption('The [--process-isolation] option is not supported.');
|
||||
}
|
||||
|
||||
return $arguments;
|
||||
}
|
||||
}
|
||||
@ -25,9 +25,9 @@ $snapshot = function ($name) {
|
||||
};
|
||||
|
||||
test('todo', function () use ($run, $snapshot) {
|
||||
expect($run('--todo', false))->toContain($snapshot('todo'));
|
||||
expect($run('--todos', false))->toContain($snapshot('todo'));
|
||||
})->skip(PHP_OS_FAMILY === 'Windows');
|
||||
|
||||
test('todo in parallel', function () use ($run, $snapshot) {
|
||||
expect($run('--todo', true))->toContain($snapshot('todo'));
|
||||
expect($run('--todos', true))->toContain($snapshot('todo'));
|
||||
})->skip(PHP_OS_FAMILY === 'Windows');
|
||||
|
||||
Reference in New Issue
Block a user