FortuneN / FineCodeCoverage

Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage
Other
506 stars 38 forks source link

Feature: Show code coverage of only new changes #405

Closed Ridewarior closed 4 months ago

Ridewarior commented 4 months ago

Hi I recently started using this extension and so far I really enjoy it! Would there be a way to add an option to show the code coverage for only the new uncommitted changes? At work we have a specific percentage we have to meet for new changes and it would be nice if this was an option.

tonyhallett commented 4 months ago

We do not use dotnet test.

There are already two issues requesting a similar feature.

I will follow how Visual Studio Enterprise does this. Should hopefully be complete within the next two weeks. https://learn.microsoft.com/en-us/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested?view=vs-2022&tabs=csharp#filter-code-coverage-results

Ridewarior commented 4 months ago

Ah okay thanks. We don't have enterprise but maybe there is a way to still filter the reports from coverlet. I removed that example I had since that wasn't accurate.

tonyhallett commented 4 months ago

Given that we use two different coverage providers the best option is to filter after the coverage has been collected ( the only control we have over ms code coverage is the .runsettings file). This way you can select any branch and see coverage for those changes and selecting another branch will not require a further coverage collection.

tonyhallett commented 4 months ago

You will not need Enterprise. I will be using the same behaviour - with libgit2sharp and the combined results from

repository.Diff.Compare<Patch>();

repository.Diff.Compare<Patch>(branch.Tree, DiffTargets.Index).

Where you select the branch you are interested in