I'm adding Stryker.net
to my C# project. I see that it mutates on all log entries. Is there any way I can ignore these in the config?
Ignore log entries in Stryker mutation test
892 views Asked by runnerpaul At
2
There are 2 answers
1
On
The following is a valid solution, when for logging you are using the interface Microsoft.Extensions.Logging.ILogger<>.
Create a file named stryker-config.json in the root of your tests project. Populate it with the following:
{
"stryker-config": {
"ignore-methods": [
"*LogCrititcal*",
"*LogDebug*",
"*LogError*",
"*LogInformation*",
"*LogTrace*",
"*LogWarning*"
]
}
}
This configuration will ignore the methods of the interface.
Depends on how your logging looks like, but most probably you can play with the
ignore-methods
option.For example,
dotnet stryker -im "['Logger.Log']"
or even justdotnet stryker -im "['*Log']"