- Command Line Options
- Using with CI
- Mutation Badge
- How-to Guides
- Compare with competitors
- What's new in Infection 0.12.0
- What's new in Infection 0.11.0
- What's new in Infection 0.10.0
- What's new in Infection 0.9.0
- What's new in Infection 0.8.0
If you have thousands of files and too many tests, running Mutation Testing can take hours for your project. In this case, it’s very convenient to run it only for the modified files.
Assuming you are on a feature branch, and the main branch is
master, we can do it as the following:
CHANGED_FILES=$(git diff origin/master --diff-filter=AM --name-only | grep src/ | paste -sd "," -);
--diff-filter=AM returns only added and modified files, because we are not going to use removed ones.
--ignore-msi-with-no-mutations option tells Infection to not error on min MSI when we have
For each job, Travis CI fetches only tested branch:
git clone --depth=50 --branch=feature/branch
That’s why we need to fetch
$TRAVIS_BRANCH as well to make a
git diff possible. Otherwise, you will get an error:
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.