Introduce --noop option to run Noop mutators that does not change the source code (AST)#1465
Introduce --noop option to run Noop mutators that does not change the source code (AST)#1465maks-rafalko merged 3 commits intomasterfrom
--noop option to run Noop mutators that does not change the source code (AST)#1465Conversation
| $mutators[$mutator->getName()] = $mutator; | ||
| if ($ignored !== []) { | ||
| $mutator = new IgnoreMutator(new IgnoreConfig($ignored), $mutator); | ||
| } |
There was a problem hiding this comment.
It appears to me the mutator factory does slightly more than it should. There could be a thin decorator object, that would be super easy to test.
In the same light adding IgnoreMutator could a job of a similar object, yet we're already here so it might be easier to leave it as it is for time being.
There was a problem hiding this comment.
TBH, I didn't get the idea here, or this file still looks ok for me. I left it as is for now.
…he source code (AST) This is needed for debugging purposes, to understand how and why Infection kills mutant even if no change is made for the given source code line. If, using `--noop` options, we see killed mutants, it means that Infection environment somehow breaks the tests
f3e0881 to
bee2c55
Compare
This one is from mbj, the author of ruby's Mutant lib. Agree - cool idea! @infection/core here is an invite link to our discord channel https://discord.gg/ZUmyHTJ - there are many other channels of mutation testing libs for different languages, as well as a |
|
@sanmai auto-merge worked here 👍 |
This is needed for debugging purposes, to understand how and why Infection kills mutant even if no change is made for the given source code line.
If, using
--noopoptions, we see killed mutants, it means that Infection environment somehow breaks the tests--noopoption. site#206Ideally, when you run
you should see the following picture:
so, mutants are either not covered by tests or escaped. It means tests are green for each noop mutator that just don't change the code.
If we get killed mutants using
--noopoption, it indicates the issues with the test suite:--threads=xmakes tests suite broken (tests can't run in parallel)In order to further debug the issue, developer ca use
--log-verbosite=allandtextlogger and analyzeinfection.logfile to understand what was going wrong.Interesting, running Infection for iself with 4 threads and
--noopoption uncovers issues with our tests suite as well:infection.log
So, it looks like we have tests that can't work in parallel: