mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Bugfix. The TestCase is now aware of if it is running in parallel or not 😎
This commit is contained in:
9
bin/pest
9
bin/pest
@ -35,12 +35,21 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
$argv = new ArgvInput();
|
||||
|
||||
$testSuite = TestSuite::getInstance($rootPath, $argv->getParameterOption('--test-directory', 'tests'));
|
||||
|
||||
$shouldExecuteInParallel = $argv->hasParameterOption('--parallel');
|
||||
// Let's remove the parallel option now we've retrieved its value
|
||||
if (($parallelKey = array_search('--parallel', $_SERVER['argv'])) !== false) {
|
||||
unset($_SERVER['argv'][$parallelKey]);
|
||||
}
|
||||
|
||||
if ($argv->hasParameterOption('--isInParallel')) {
|
||||
$testSuite->isInParallel = true;
|
||||
}
|
||||
// Let's remove the parallel flag now we've retrieved its value
|
||||
if (($parallelKey = array_search('--isInParallel', $_SERVER['argv'])) !== false) {
|
||||
unset($_SERVER['argv'][$parallelKey]);
|
||||
}
|
||||
|
||||
$isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never';
|
||||
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user