mutagen icon indicating copy to clipboard operation
mutagen copied to clipboard

Feature Request: passing feature flags

Open elichai opened this issue 4 years ago • 3 comments

Hi, First this crate is awesome :) Thank you!. Second, In my view there are 2 important features missing to add this to a CI:

  1. Feature gate the mutations, in real code you don't want to risk mutagen affecting the code with regular tests and the compilation overhead. (a naive solution is https://github.com/llogiq/mutagen/compare/master...TheBlueMatt:master a real one involves the ability of passing arbitrary feature flags when running cargo mutagen)

~2. There are some mutations that can't be "fixed" with more tests, because their path isn't really reachable or the mutation doesn't really matter to the function, so a way to add "ignore" to mutations, either with a file (like sanitizers supressions) or with attributes (like #[allow(...)]) that can be also feature gated.~ (opened #156)

Thanks, Elichai.

elichai avatar Jan 21 '20 17:01 elichai

Thank you for your feedback.

Did I understand your first request correctly: "make it possible to run cargo mutagen --features x,y,z and cargo mutagen --all-features"? I can do that.

The diff also includes a panic when a single mutation is not killed. Insisting on 100% mutation score is not the intention of mutation testing. However, I understand that regressions in mutation score can be caught in CI. Could you open a seperate issue for that?

The topic of skipping a mutations, should also be discussed in a separate issue. I have experimented with some design, but waited for feedback until publishing that featureset.

PS: what version of mutagen are you using?

samuelpilz avatar Jan 22 '20 07:01 samuelpilz

I agree about the panic, Altough it can make CI's easier if it fails on first mutation (assuming I can skip some)

And I'm currently using master.

elichai avatar Jan 22 '20 08:01 elichai

The first part is implemented in #155. Would it be possible to open separate issues for the remaining concerns?

samuelpilz avatar Jan 22 '20 10:01 samuelpilz