[CI] Replace inline Go test runner with tomasvotruba/fast-unit package (parallel runner + -tia) - #8351
Merged
Merged
Conversation
TomasVotruba
commented
Aug 15, 2026
| yield [$fileInfo->getRealPath()]; | ||
| // key the data set by fixture path, so a failure prints the exact | ||
| // clickable ".php.inc" file instead of an anonymous "data set #N" | ||
| yield $fileInfo->getRealPath() => [$fileInfo->getRealPath()]; |
Member
Author
There was a problem hiding this comment.
Time to give this a go 👍
- key fixture data provider by path, so a failure prints the exact clickable .php.inc file instead of 'data set #N' - tests.yaml runs vendor/bin/fastunit over tests + rules-tests + utils/phpstan/tests
… composer test script The parallel runner batches many test classes into one warm PHP process, which exposed a latent leak: RectorConfig::configure() marks only the first call in a process as 'root', so RectorConfigTest's root-rule assertions failed when another class configured first. Add RectorConfig::resetRecreated() and reset it (plus the registered-rule lists) in the test's setUp. Also add composer 'test' script running fastunit over the suite dirs.
…itignore - benchmark: keep fast-unit wording, ubuntu-only (Windows dropped in #8352) - .gitignore: main already ignores .fastunit-cache; drop the duplicate
TomasVotruba
force-pushed
the
use-fast-unit-runner
branch
from
August 15, 2026 15:42
77ae4cd to
bc7fd22
Compare
Runs only tests whose static dependency closure changed, with a persisted .fastunit-cache via actions/cache. PR-only and non-blocking in intent: the full 'tests' job stays the authoritative gate, since -tia over-approximates but cannot see dynamic (reflection / class-string) dependencies.
TomasVotruba
marked this pull request as ready for review
August 15, 2026 18:54
Member
Author
|
Let's give this a go :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracts the inline Go PHPUnit runner (
utils-tests-runner/, added in #8349) into a standalone, reusable Composer package -- tomasvotruba/fast-unit -- and adopts it as the main test runner here.What it does
fast-unitsplits the suite's test classes into N weight-balanced chunks and runs each chunk in one warm PHP process, so the container boots N times instead of once per class. It ships prebuilt Go binaries fetched on first run (sha256-verified), so no Go toolchain is needed; the downloader shim is PHP 7.2+ compatible.Speed -- ubuntu CI, same 4-vCPU hardware
vendor/bin/phpunitgo run(previous, onmain)vendor/bin/fastunit(this PR)The prebuilt binary also beats the old
go runstep, which recompiled the runner on every invocation. The full ~4x from the runner's README needs more cores; GitHub runners give 4 vCPU.Changes
composer.jsonrequirestomasvotruba/fast-unit(dev), plustest/test-tiascripts.utils-tests-runner/is removed.tests.yamlrunsvendor/bin/fastunitovertests rules-tests utils/phpstan/tests..php.incfile (clickable in an IDE) instead of an anonymousdata set #N:RectorConfig::configure()marks only the first call in a process as "root", soRectorConfigTest's root-rule assertions failed depending on chunk order. Fixed withRectorConfig::resetRecreated()+ a reset in the test'ssetUp. Same family as thephpVersion()leak fixed in [PoC] Parallel PHPUnit runner in Go (~4x faster) + fix phpVersion leak between test classes #8349.Optional
-tia(test impact analysis)fast-unit -tiaruns only the tests whose code changed, using a static tokenizer-based dependency graph (nopcov/xdebug, works on any PHP 7.2+). For each test it takes the transitive closure from its directory (so a rule wired inconfig/configured_rule.phpcounts) and re-runs only classes whose closure or fixtures changed vs a cached sha256 snapshot.Safe by construction: static analysis over-approximates, so it may run a few extra tests but never silently skips a real dependency; first run or any scan error runs everything.
A PR-only
tests_tiajob runs it with a persisted.fastunit-cache(viaactions/cache) for fast feedback. It is not the merge gate -- the fulltestsjob stays authoritative, since-tiacannot see dynamic (reflection / class-string) dependencies.