diff --git a/src/Plugins/Retry.php b/src/Plugins/Retry.php index f5199381..05a9fa4d 100644 --- a/src/Plugins/Retry.php +++ b/src/Plugins/Retry.php @@ -23,7 +23,7 @@ final class Retry implements HandlesArguments return $arguments; } - if ($this->hasArgument('--parallel', $arguments)) { + if ($this->hasArgument('--parallel', $arguments) || in_array('-p', $arguments, true)) { throw new InvalidOption('The [--retry] option is not supported when running in parallel.'); } diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 60f0b523..8a57548b 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -1870,6 +1870,8 @@ PASS Tests\Unit\Plugins\Retry ✓ it orders by defects and stop on defects if when --retry is used + ✓ it rejects retry with a parallel flag with ('--parallel') + ✓ it rejects retry with a parallel flag with ('-p') PASS Tests\Unit\Plugins\Shard ✓ getShard → it parses valid shard format with ('1/2', 1, 2) @@ -2562,4 +2564,4 @@ ✓ pass with dataset with ('my-datas-set-value') ✓ within describe → pass with dataset with ('my-datas-set-value') - Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 38 skipped, 1856 passed (4269 assertions) \ No newline at end of file + Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 38 skipped, 1858 passed (4273 assertions) \ No newline at end of file diff --git a/tests/Unit/Plugins/Retry.php b/tests/Unit/Plugins/Retry.php index c8fe996a..8ace36a7 100644 --- a/tests/Unit/Plugins/Retry.php +++ b/tests/Unit/Plugins/Retry.php @@ -1,5 +1,6 @@ handleArguments(['--retry', $parallelFlag]); +})->with(['--parallel', '-p'])->throws( + InvalidOption::class, + 'The [--retry] option is not supported when running in parallel.', +); diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php index 7c5df7dd..aa2f6ba5 100644 --- a/tests/Visual/Parallel.php +++ b/tests/Visual/Parallel.php @@ -21,7 +21,7 @@ test('parallel', function () use ($run): void { $output = implode("\n", array_slice(explode("\n", (string) $output), -10)); $profileOutput = $run('tests/Fixtures/Suites/SuccessOnly.php', '--profile'); - $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 30 skipped, 1734 passed (3752 assertions)'; + $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 30 skipped, 1736 passed (3756 assertions)'; expect($output) ->toContain("Tests: {$expected}")