Files
pest/tests/Visual/Parallel.php
2023-03-29 13:23:43 +03:00

28 lines
981 B
PHP

<?php
use Symfony\Component\Process\Process;
$run = function () {
$process = new Process(
array_merge(['php', 'bin/pest', '--parallel', '--processes=3'], func_get_args()),
dirname(__DIR__, 2),
['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true'],
);
$process->run();
// expect($process->getExitCode())->toBe(0);
return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
};
test('parallel', function () use ($run) {
expect($run('--exclude-group=integration'))
->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 11 skipped, 694 passed (1692 assertions)')
->toContain('Parallel: 3 processes');
})->skip(PHP_OS_FAMILY === 'Windows');
test('a parallel test can extend another test with same name', function () use ($run) {
expect($run('tests/Fixtures/Inheritance'))->toContain('Tests: 1 skipped, 1 passed (1 assertions)');
});