-
Notifications
You must be signed in to change notification settings - Fork 250
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
feat(incremental): add incremental mode #3609
Conversation
Add incremental mode. When incremental mode is active, Stryker will use the results from the previous run to determine which mutants need to be retested, yielding much faster results. You can enable incremental mode with `--incremental` (or using `"incremental": true` in the config file), Results are stored in the `reports/.mutation-incremental.json` file.
For anyone that wants to help test this feature: please install Stryker beta and report your findings here.
|
I just had a talk with @rouke-broersma . This feature has a lot of overlap with Baseline of Stryker.NET. There are some differences:
The |
I'm excited for this feature I think it will be very valuable! I have tried to run this and it seems to be working for me. One thing of note
And having the info statements give some details would be awesome like number of files changes, new mutants added. Also having the report say this it is an incremental run would be cool too. Having the ability to just report the new mutants would be nice. I would want to add this to a merge request process and showing all of the details is much less important than just showing the diff. Thank you for your effort on this. |
Thanks for the feedback @yesmar12
Yeah, good point. Suggestions are welcome. We also have the data for the total amount of tests run, so we could provide both metrics in that scenario. I've added it to the TODO list.
Good idea! We currently have this: "Incremental mode: 3390/3546 are reused.", but we can indeed do better! I've added it to the TODO list.
Hmm this would be some more work. You are probably referring to the HTML reporter. The HTML reporter is shared across all Stryker frameworks and even other mutation testing frameworks. Changes to that central core are expensive and need to be approved by all members. Maybe we could think of a new |
In stryker-net this would be called the since feature which is different from incremental (or what we call baseline). The point of incremental is imo that you don't have to run all mutations but you do end up with a full report. The since feature is then intended to test only those mutants changed or new since a previous state in our case currently implemented based on git information), you then also only see a report on those mutants. We currently mark all other mutants as ignored in the report which effectively removes them from the report. I don't personally see a reason to make the report fit this specific feature, we already have the ignored state. |
Add incremental mode. When incremental mode is active, Stryker will use the results from the previous run to determine which mutants need to be retested, yielding much faster results.
You can enable incremental mode with
--incremental
(using"incremental": true
in the config file will also work but is not recommended),Results are stored in the
reports/.mutation-incremental.json
file. This file adheres to the JSON result schema, so they are interchangeable.TODO:
command
test runner)--incremental
compatible with--mutate
--incremental
compatible with--mutate
and--force
--incremental
modeReassign mutant ids in the mutation test helperdon't show mutant ids in reportsLimitations:
Running in incremental mode, Stryker will do its best to produce an accurate mutation testing report. However, there are some limitations here:
dependencies
,devDependencies
, changes to your environment variables, changes to your.snap
files, updates to readme files, etcWith these limitations in mind, it is still recommended to do a full run once in a while instead of relying on incremental for all your mutation testing needs.
Fixes #2753