0

Stryker-net has an option since.ignore-changes-in and I'm trying to understand in which use case it may be useful to ignore non C# files 1.

The doc gives that example of value ['/*Assets.json','/favicon.ico'], but if my last commit changes only Assets.json and if I run stryker with "since": {"target": "<sha1 of my previous commit>"}, then no mutation will be found on this change, with or without this ignore-changes-in option, right? What am I missing?

1: Sure, if I don't find it useful I could just avoid using it on my personal projects. However I'm responsible for providing stryker in CI for several teams in my company and I'm hence interested in making sure I have a good understanding of the consequences of using (or not) this.

gturri
  • 13,807
  • 9
  • 40
  • 57

1 Answers1

1

I can think of two cases.

First, it might bring some performance gain (just by reducing the amount of files Stryker will get to), e.g. when your change updates 100 XML localizations of some string.

Second, you might have real code you don't want to run Stryker against. E.g. you have some Obsolete folder with a bunch of projects you don't care about but which automatically updates with some renaming and so on. This might be interchangeable with the mutate option, unless you want to have different filters for "normal" and "diff" Stryker executions.

psfinaki
  • 1,814
  • 15
  • 29
  • Thanks for this information :) I'm afraid there are a couple things that are still not clear to me and it would be awesome if you can add more information by editing your answer: - you say "it can *probably* bring some performance gain": is it just a guess, or is it a certainty that it would do that in some cases? - with obsolete folders, wouldn't it make more sense to use the config `"mutate": ['!**/obsolete_folder/**` instead (so it is also ignore even if `since.enabled` is set to `false`)? – gturri Dec 17 '22 at 11:03
  • Sure, I updated the answer. I personally haven't used this option, so just guessing and analyzing the [source](https://github.com/stryker-mutator/stryker-net/blob/7f04c822fa1a6cbb934e134d19d9726fc8ddcbfd/src/Stryker.Core/Stryker.Core/DiffProviders/GitDiffProvider.cs#L74). Also, feel free to start the discussion at their GitHub, the maintainers are friendly and responsive, that I am sure of :) – psfinaki Dec 19 '22 at 14:59