- Guide
- Playground
- GitHub
-
Ecosystem
Help
Resource Lists
Recent Posts
- What's new in Infection 0.26.0
- What's new in Infection 0.25.0
- What's new in Infection 0.24.0
- What's new in Infection 0.23.0
- What's new in Infection 0.21.0
- What's new in Infection 0.20.0
- What's new in Infection 0.19.0
- What's new in Infection 0.18.0
- What's new in Infection 0.17.0
- What's new in Infection 0.16.0
What's new in Infection 0.26.0
Jan 10, 2022
Release: https://github.com/infection/infection/releases/tag/0.26.0
BC Breaks
badge
logger has been replaced with more advanced stryker
logger. Previously, to use Stryker Dashboard for uploading MSI score and display badge information, the following setting was used:
{ |
Now, the same behavior can be achieved by using stryker
logger:
{ |
New features and updates
HTML report (local and cloud)
It’s now possible to generate HTML reports, similar to PHPUnit HTML report, for Infection execution.
- Example of a local report: html-report-example.html
- Example of a report stored in Stryker Dashboard: https://dashboard.stryker-mutator.io/reports/github.com/infection/infection/master
To generate HTML report locally, the new html
logger should be used:
{ |
To upload HTML report to Stryker Dashboard, please read this guide for setting up integration and upload it by:
{ |
Mutating only affected lines
In the previous Infection versions, it was possible to mutate only added and changed files:
infection --git-diff-filter=AM |
However, if you have a big legacy project, changing 1 line in a file with thousands of lines led to too many mutants, that not always possible to kill due to lack of the tests / time.
Now, we’ve added a new feature that mutates only touched lines of code - new or modified:
infection --git-diff-lines |
Under the hood, this option mutates only added and changed files, then only added and changed lines in these files, comparing your current branch with master
branch by default.
Base branch can be changed by using --git-diff-base=main
option. In this case, your current branch will be compared with main
branch.
infection --git-diff-lines --git-diff-base=main |
Useful to check how your changes impacts MSI in a feature branch.
Can significantly improve performance since fewer Mutants are generated in comparison to using --git-diff-filter=AM
or mutating all files.
Show ignored mutants
There is a setting to ignore mutations by adding a regular expression for matching the source code:
{ |
but it wasn’t clear whether Infection applies it or not. Now, the output will contain I
chars for ignored Mutants:
Processing source code files: 7/7 |
Automatic XDEBUG_MODE=coverage
Previously, with Xdebug
3+, Infection had to be executed with XDEBUG_MODE=coverage
if mode
has no coverage
value by default in order to generate coverage for internal purposes:
XDEBUG_MODE=coverage infection |
Now, you can skip it and just run
infection |
coverage
mode will be used automatically.
Set failOnRisky
, failOnWarning
to true
if parameters are not already set for Mutants
There can be a situation when mutation leads to generating a warning, and if you don’t have failOnWarning
set to true - such Mutant becomes escaped. Now Infection will kill such Mutants.
Enjoying Infection? Consider supporting us on GitHub Sponsors ♥️