stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.76k stars 175 forks source link

Fix the problem that the test projects are not being enriched by VsTest. #2751

Open MischaVreeburg opened 9 months ago

MischaVreeburg commented 9 months ago

For the enrichment, an alternative datasource has been chosen along with some clever parsing. It now falls back for C# files to the previously scanned test source files and tries to map the test full name with the name in the file and uses that info to get the test file path, along with the method declaration.

This PR fixes issue: https://github.com/stryker-mutator/stryker-net/issues/2750

dupdob commented 9 months ago

Thanks for this PR. This is not a review but a bunch of general comments: 1) you need to add unit tests for this. I suggest isolating the source code searching/parsing algorithm so writing test is easier 2) note that this approach provides only partial support: unit tests can be renamed via framework specific attributes and theory-like tests may include data as part of their name.

Overall, I think this is a good move, but I would like feedback from the core team regarding if this is an approach they support (i.e. this simply improving and supporting it until a fix from VsTest teams is made available)

rouke-broersma commented 9 months ago

@dupdob sounds good to me, I have no objection and I agree with your review feedback as well.