gradle-pitest-plugin icon indicating copy to clipboard operation
gradle-pitest-plugin copied to clipboard

Support for excluding mutators

Open christianhujer opened this issue 4 years ago • 11 comments

Feature Request:

I would like to be able to specify the mutators like this:

pitest {
    // …
    mutators = ['All'] - ['UOI']
    // …
}

or, if that is not possible, with something equivalent, like this:

pitest {
    // …
    mutators = ['All']
    excludeMutators = ['UOI']
    // …
}

Use case: instead of having a long list of all mutators to run, be able to specify a large set of mutators, like 'ALL', and then just exclude some from the list, like ['UOI'], when they produce too many false positives.

christianhujer avatar Mar 24 '20 20:03 christianhujer

I will work on it and raise a PR

npathai avatar Oct 23 '20 10:10 npathai

Just remember to test it thoroughly. What possible in unit (or unit-like) tests.

szpak avatar Oct 23 '20 20:10 szpak

@szpak Yep will do that. Will look at all existing tests and add required tests accordingly 👍 Will ask if I have any questions

npathai avatar Oct 26 '20 12:10 npathai

@szpak From what I found out, there is no support for excluding mutators in PIT project. What do you think should be the next step?

npathai avatar Oct 28 '20 15:10 npathai

I didn't need it before, but it seems there is no easy way to exclude mutators (instead of provide just the list of selected mutators to use). It could be implemented in the Gradle plugin alone, but most likely it would be good to have it available in pit-core. Therefore, I propose to report that suggestion in the PIT issue tracker to see what Henry thinks about that.

szpak avatar Oct 30 '20 00:10 szpak

Apologies for late reply. I will do that.

npathai avatar Feb 28 '21 08:02 npathai

Any update here? I wanted to change mutators group to ALL with pitest gradle plugin but I cannot find any property to do that in here. Can you help on this? Thank you

kamesh95 avatar Jul 29 '21 12:07 kamesh95

@kamesh95 I haven't seen a related issue in the PIT issue tracker. You might want to create one.

szpak avatar Sep 20 '21 20:09 szpak

@szpak I have raised the feature request in PIT issue tracker.

npathai avatar Oct 30 '21 11:10 npathai

@npathai Could you check it with PIT 1.7.3?

pitest {
    pitestVersion = '1.7.3'
    mutators = ['ALL', '-UOI', ...]
    ...
}

szpak avatar Nov 09 '21 17:11 szpak

@szpak Sure let me do that. I will raise PR when ready.

npathai avatar Nov 25 '21 12:11 npathai