szpak / gradle-pitest-plugin

Gradle plugin for PIT Mutation Testing
http://gradle-pitest-plugin.solidsoft.info/
213 stars 58 forks source link

Support for excluding mutators #187

Open christianhujer opened 4 years ago

christianhujer commented 4 years ago

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.

npathai commented 3 years ago

I will work on it and raise a PR

szpak commented 3 years ago

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

npathai commented 3 years ago

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

npathai commented 3 years ago

@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?

szpak commented 3 years ago

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.

npathai commented 3 years ago

Apologies for late reply. I will do that.

kamesh95 commented 3 years ago

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

szpak commented 2 years ago

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

npathai commented 2 years ago

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

szpak commented 2 years ago

@npathai Could you check it with PIT 1.7.3?

pitest {
    pitestVersion = '1.7.3'
    mutators = ['ALL', '-UOI', ...]
    ...
}
npathai commented 2 years ago

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