New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce --noop
option to run Noop mutators that does not change the source code (AST)
#1465
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea!
Below is just nitpicking.
$mutators[$mutator->getName()] = $mutator; | ||
if ($ignored !== []) { | ||
$mutator = new IgnoreMutator(new IgnoreConfig($ignored), $mutator); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
--noop
options, we see killed mutants, it means that Infection environment somehow breaks the tests--noop
option. 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
--noop
option, it indicates the issues with the test suite:--threads=x
makes tests suite broken (tests can't run in parallel)In order to further debug the issue, developer ca use
--log-verbosite=all
andtext
logger and analyzeinfection.log
file to understand what was going wrong.Interesting, running Infection for iself with 4 threads and
--noop
option uncovers issues with our tests suite as well:infection.log
So, it looks like we have tests that can't work in parallel: