- Guide
- Playground
- GitHub
-
Ecosystem
Help
Resource Lists
Documentation
- Introduction
- Installation
- Usage
- Command Line Options
- Mutators
- Custom Mutators
- Profiles
- Using with CI
- Mutation Badge, cloud HTML report
- How-to Guides
- Caveats
- Debugging Issues
- Infection Playground
- GitHub Sponsors ♥️
- Supported Test Frameworks
Miscellaneous
- Compare with competitors
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
Using with CI
CLI options
We like the idea of using Infection together with other code quality tools in your Continuous Integration (CI) server.
For this purpose, there are two available options:
--min-msi
--min-covered-msi
Metrics: |
The first option --min-msi
allows to control your Mutation Score Indicator. As soon as the actual MSI value is below than the value you provided by this option your build will fail.
Example of usage in CI server:
./infection.phar --min-msi=48 --threads=4 |
This example means that if you get MSI 47%
, the build will be failed. This forces you to write more tests with each commit.
The second option --min-covered-msi
allows to control Covered Code MSI.
As soon as the actual Covered Code MSI value is below than the value you provided by this option your build will fail.
Example of usage in CI server:
./infection.phar --min-covered-msi=70 --threads=4 |
This forces you to write more effective tests.
Both these options can be used together. As soon as one of them is failed - the build will also be failed.
Example:
./infection.phar --min-msi=48 --min-covered-msi=70 --threads=4 |
Using with Travis
The simplest .travis.yml
config to integrate Infection with Travis is:
before_script: |
Read more about how to add a Mutation Badge to your Github Project