Repository navigation
Conversation
Narrows inside the runner rather than through --class, which lifts the __pest_mutate_only group and so runs different tests than a full run.
No unchanged test can call a new function, and the tests that do are in the diff anyway.
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.
What:
Description:
Adds
--changed[=<revision>](andmutate()->changed()), which only generates mutations in the source files a change sincegit merge-base <revision> HEADcan affect. Without a revision it takes uncommitted changes.covers()/mutates()name before and after the change, plus the source files its tests ran.composer.lock,phpunit.xml, PHP outside the source paths) mutates everything, and the output says why. A support file liketests/Pest.phpthat only gains functions doesn't count.It narrows inside
MutationTestRunner::run()rather than through--class, which lifts the__pest_mutate_onlygroup and so runs different tests than a full run. A run with nothing to mutate passes--min.On real pull requests of a 1,500-mutation suite, full runs take 27 s and
--changedruns 8–12 s; a docs-only change takes 3 s.--changed=HEAD^1tests/Pest.phpREADME.mdonlyEach row replays the pull request's merge commit with
--parallel --covered-only --no-cacheon 16 threads, PHP 8.5 with PCOV and Pest 5.3.4;--changedtimes are the mean of two runs, and every run scored 100%. The same scope passed as--classtook the same time, but on fkrzski/php-steam-api-sdk#176 it mutated 12 files instead of 11, because its initial run also counts coverage from tests withoutcovers(). On GitHub's runners the full mutation job took a median 374 s per pull request.It covers what
--changed-onlydid before its removal in a6ec515, at file level and with test changes taken into account.5.xalready fails 3 visual snapshot tests and 2 PHPStan errors on a fresh install; this adds none.