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
+34
View File
@@ -71,3 +71,37 @@ test('parallel can have multiple groups', function () use ($run): void {
->toContain('Tests: 2 passed (2 assertions)')
->toContain('Parallel: 3 processes');
})->skipOnWindows();
test('parallel accepts the options that the workers ignore', function (string $option) use ($run): void {
expect($run('tests/Fixtures/Inheritance', $option))
->toContain('Tests: 1 skipped, 1 passed (1 assertions)')
->toContain('Parallel: 3 processes');
})->with([
'--no-results',
'--do-not-cache-result',
'--do-not-record-test-run-history',
])->skipOnWindows();
test('parallel records the test run history', function () use ($run): void {
$cacheDirectory = sys_get_temp_dir().'/pest-parallel-history-'.bin2hex(random_bytes(8));
$run('tests/Fixtures/Inheritance', '--cache-directory='.$cacheDirectory);
expect($cacheDirectory.'/test-run-history')->toBeFile();
unlink($cacheDirectory.'/test-run-history');
rmdir($cacheDirectory);
})->skipOnWindows();
test('parallel does not record the test run history when asked not to', function (string $option) use ($run): void {
$cacheDirectory = sys_get_temp_dir().'/pest-parallel-history-'.bin2hex(random_bytes(8));
expect($run('tests/Fixtures/Inheritance', '--cache-directory='.$cacheDirectory, $option))
->toContain('Tests: 1 skipped, 1 passed (1 assertions)')
->and($cacheDirectory.'/test-run-history')->not->toBeFile();
rmdir($cacheDirectory);
})->with([
'--do-not-cache-result',
'--do-not-record-test-run-history',
])->skipOnWindows();