fix: accept --no-results and the --do-not-* test run history options with --parallel (#1982)

* fix: accept `--no-results` and the `--do-not-*` test run history options with `--parallel`

* Update success snapshot count

---------

Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
This commit is contained in:
Adil Khan
2026-11-03 21:11:05 +05:00
committed by GitHub
parent 9a77ff6b96
commit b3baf7e210
4 changed files with 58 additions and 2 deletions
@@ -6,6 +6,7 @@ namespace Pest\Plugins\Parallel\Handlers;
use Pest\Contracts\Plugins\HandlesArguments;
use Pest\Plugins\Concerns\HandleArguments;
use Pest\Plugins\Parallel as ParallelPlugin;
use Pest\Plugins\Parallel\Paratest\WrapperRunner;
/**
@@ -19,12 +20,24 @@ final class Parallel implements HandlesArguments
'--parallel',
'-p',
'--no-output',
'--no-results',
'--cache-result',
'--do-not-cache-result',
'--record-test-run-history',
'--do-not-record-test-run-history',
];
private const array ARGS_THAT_DISABLE_TEST_RUN_HISTORY = [
'--do-not-cache-result',
'--do-not-record-test-run-history',
];
public function handleArguments(array $arguments): array
{
if (array_any(self::ARGS_THAT_DISABLE_TEST_RUN_HISTORY, fn (string $argument): bool => $this->hasArgument($argument, $arguments))) {
ParallelPlugin::setGlobal(WrapperRunner::DO_NOT_RECORD_TEST_RUN_HISTORY, true);
}
$args = array_reduce(self::ARGS_TO_REMOVE, fn (array $args, string $arg): array => $this->popArgument($arg, $args), $arguments);
return $this->pushArgument('--runner='.WrapperRunner::class, $args);