fix parallel execution of test class that inherit other class with the same name

This commit is contained in:
Nikos Charalampidis
2023-03-29 13:02:18 +03:00
parent ba87e1fde8
commit 1965763cd0
9 changed files with 59 additions and 5 deletions

View File

@ -3,7 +3,9 @@
use Symfony\Component\Process\Process;
$run = function () {
$process = new Process(['php', 'bin/pest', '--parallel', '--processes=3', '--exclude-group=integration'], dirname(__DIR__, 2),
$process = new Process(
array_merge(['php', 'bin/pest', '--parallel', '--processes=3'], func_get_args()),
dirname(__DIR__, 2),
['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true'],
);
@ -15,6 +17,12 @@ $run = function () {
};
test('parallel', function () use ($run) {
expect($run())->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 11 skipped, 694 passed (1692 assertions)')
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('--configuration=tests/Fixtures/phpunit-parallel-inheritance.xml'))
->toContain('1 passed');
});