Closed Aidenwasalreadytaken closed 2 years ago
Of course we are open to contributions! Before you put in the effort to try and fix this, could you explain in which scenario you think this goes wrong so I can verify?
Thanks Rouke,
The scenario is running dotnet dotnet-stryker --since:master
from the source project directory. I have modified both test and source files. The modified source files are being logged as Changed test file
and the modified test files as Changed file
. All mutations are being ignored because of Mutant not changed compared to target commit
I see. It looks like this feature was built assuming running from the test project directory. This used to be the only way to run stryker. The correct fix would be to pass the MutationTestInput to the GitDiffProvider and to check whether a file exists in the source project or in one of the test projects.
Fixed by #2256
GitDiffProvider is incorrectly classifying source files as test files.
https://github.com/stryker-mutator/stryker-net/blob/46985134192ade92d5e56dc2ce45681ff92e41c9/src/Stryker.Core/Stryker.Core/DiffProviders/GitDiffProvider.cs#L55
If you're open to contributions, I can fix this issue up later today.