Skip to content

Commit d2eb94d

Browse files
committed
chore: bumps phpunit and paratest
1 parent 9688b83 commit d2eb94d

File tree

4 files changed

+35
-14
lines changed

4 files changed

+35
-14
lines changed

bin/worker.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@
3232
'status-file:',
3333
'progress-file:',
3434
'unexpected-output-file:',
35-
'testresult-file:',
35+
'test-result-file:',
36+
'result-cache-file:',
3637
'teamcity-file:',
3738
'testdox-file:',
3839
'testdox-color',
40+
'testdox-columns:',
41+
'testdox-summary',
3942
'phpunit-argv:',
4043
]);
4144

@@ -61,7 +64,8 @@
6164

6265
assert(isset($getopt['progress-file']) && is_string($getopt['progress-file']));
6366
assert(isset($getopt['unexpected-output-file']) && is_string($getopt['unexpected-output-file']));
64-
assert(isset($getopt['testresult-file']) && is_string($getopt['testresult-file']));
67+
assert(isset($getopt['test-result-file']) && is_string($getopt['test-result-file']));
68+
assert(! isset($getopt['result-cache-file']) || is_string($getopt['result-cache-file']));
6569
assert(! isset($getopt['teamcity-file']) || is_string($getopt['teamcity-file']));
6670
assert(! isset($getopt['testdox-file']) || is_string($getopt['testdox-file']));
6771

@@ -77,7 +81,8 @@
7781
$phpunitArgv,
7882
$getopt['progress-file'],
7983
$getopt['unexpected-output-file'],
80-
$getopt['testresult-file'],
84+
$getopt['test-result-file'],
85+
$getopt['result-cache-file'] ?? null,
8186
$getopt['teamcity-file'] ?? null,
8287
$getopt['testdox-file'] ?? null,
8388
isset($getopt['testdox-color']),

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
],
1919
"require": {
2020
"php": "^8.2.0",
21-
"brianium/paratest": "^7.6.2",
21+
"brianium/paratest": "^7.7.0",
2222
"nunomaduro/collision": "^8.5.0",
2323
"nunomaduro/termwind": "^2.3.0",
2424
"pestphp/pest-plugin": "^3.0.0",
2525
"pestphp/pest-plugin-arch": "^3.0.0",
2626
"pestphp/pest-plugin-mutate": "^3.0.5",
27-
"phpunit/phpunit": "^11.5.0"
27+
"phpunit/phpunit": "^11.5.1"
2828
},
2929
"conflict": {
3030
"filp/whoops": "<2.16.0",
31-
"phpunit/phpunit": ">11.5.0",
31+
"phpunit/phpunit": ">11.5.1",
3232
"sebastian/exporter": "<6.0.0",
3333
"webmozart/assert": "<1.11.0"
3434
},

src/Bootstrappers/BootOverrides.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class BootOverrides implements Bootstrapper
1919
*/
2020
public const FILES = [
2121
'53c246e5f416a39817ac81124cdd64ea8403038d01d7a202e1ffa486fbdf3fa7' => 'Runner/Filter/NameFilterIterator.php',
22-
'a4a43de01f641c6944ee83d963795a46d32b5206b5ab3bbc6cce76e67190acbf' => 'Runner/ResultCache/DefaultResultCache.php',
22+
'77ffb7647b583bd82e37962c6fbdc4b04d3344d8a2c1ed103e625ed1ff7cb5c2' => 'Runner/ResultCache/DefaultResultCache.php',
2323
'd0e81317889ad88c707db4b08a94cadee4c9010d05ff0a759f04e71af5efed89' => 'Runner/TestSuiteLoader.php',
2424
'3bb609b0d3bf6dee8df8d6cd62a3c8ece823c4bb941eaaae39e3cb267171b9d2' => 'TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php',
2525
'8abdad6413329c6fe0d7d44a8b9926e390af32c0b3123f3720bb9c5bbc6fbb7e' => 'TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php',

src/Plugins/Parallel/Paratest/WrapperRunner.php

+23-7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use PHPUnit\Event\Facade as EventFacade;
2020
use PHPUnit\Event\TestRunner\WarningTriggered;
2121
use PHPUnit\Runner\CodeCoverage;
22+
use PHPUnit\Runner\ResultCache\DefaultResultCache;
2223
use PHPUnit\TestRunner\TestResult\Facade as TestResultFacade;
2324
use PHPUnit\TestRunner\TestResult\TestResult;
2425
use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry;
@@ -79,7 +80,10 @@ final class WrapperRunner implements RunnerInterface
7980
private array $unexpectedOutputFiles = [];
8081

8182
/** @var list<SplFileInfo> */
82-
private array $testresultFiles = [];
83+
private array $resultCacheFiles = [];
84+
85+
/** @var list<SplFileInfo> */
86+
private array $testResultFiles = [];
8387

8488
/** @var list<SplFileInfo> */
8589
private array $coverageFiles = [];
@@ -264,7 +268,8 @@ private function startWorker(int $token): WrapperWorker
264268
$this->batches[$token] = 0;
265269

266270
$this->unexpectedOutputFiles[] = $worker->unexpectedOutputFile;
267-
$this->testresultFiles[] = $worker->testresultFile;
271+
$this->unexpectedOutputFiles[] = $worker->unexpectedOutputFile;
272+
$this->testResultFiles[] = $worker->testResultFile;
268273

269274
if (isset($worker->junitFile)) {
270275
$this->junitFiles[] = $worker->junitFile;
@@ -298,12 +303,12 @@ private function destroyWorker(int $token): void
298303

299304
private function complete(TestResult $testResultSum): int
300305
{
301-
foreach ($this->testresultFiles as $testresultFile) {
302-
if (! $testresultFile->isFile()) {
306+
foreach ($this->testResultFiles as $testResultFile) {
307+
if (! $testResultFile->isFile()) {
303308
continue;
304309
}
305310

306-
$contents = file_get_contents($testresultFile->getPathname());
311+
$contents = file_get_contents($testResultFile->getPathname());
307312
assert($contents !== false);
308313
$testResult = unserialize($contents);
309314
assert($testResult instanceof TestResult);
@@ -360,9 +365,20 @@ private function complete(TestResult $testResultSum): int
360365
$testResultSum->phpNotices(),
361366
$testResultSum->phpWarnings(),
362367
$testResultSum->numberOfIssuesIgnoredByBaseline(),
363-
364368
);
365369

370+
if ($this->options->configuration->cacheResult()) {
371+
$resultCacheSum = new DefaultResultCache($this->options->configuration->testResultCacheFile());
372+
foreach ($this->resultCacheFiles as $resultCacheFile) {
373+
$resultCache = new DefaultResultCache($resultCacheFile->getPathname());
374+
$resultCache->load();
375+
376+
$resultCacheSum->mergeWith($resultCache);
377+
}
378+
379+
$resultCacheSum->persist();
380+
}
381+
366382
$this->printer->printResults(
367383
$testResultSum,
368384
$this->teamcityFiles,
@@ -375,7 +391,7 @@ private function complete(TestResult $testResultSum): int
375391
$exitcode = Result::exitCode($this->options->configuration, $testResultSum);
376392

377393
$this->clearFiles($this->unexpectedOutputFiles);
378-
$this->clearFiles($this->testresultFiles);
394+
$this->clearFiles($this->testResultFiles);
379395
$this->clearFiles($this->coverageFiles);
380396
$this->clearFiles($this->junitFiles);
381397
$this->clearFiles($this->teamcityFiles);

0 commit comments

Comments
 (0)