-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coverlet Intergration with VSTest #410
Coverlet Intergration with VSTest #410
Conversation
src/coverlet.collector/DataCollector/CoverletCoverageDataCollector.cs
Outdated
Show resolved
Hide resolved
src/coverlet.collector/DataCollector/CoverletCoverageDataCollector.cs
Outdated
Show resolved
Hide resolved
src/coverlet.collector/DataCollector/CoverletCoverageDataCollector.cs
Outdated
Show resolved
Hide resolved
|
||
// Note: | ||
// 1) .NET core test run supports one testModule per run. Coverlet also supports one testModule per run. So, we are using first testSource only and ignoring others. | ||
// 2) If and when .NET full is supported with coverlet OR .NET core starts supporting multiple testModules, revisit this code to use other testModules as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We support .NET Full...but not multiple tests modules AFAIK cc: @tonerdo
src/coverlet.collector/DataCollector/CoverletCoverageDataCollector.cs
Outdated
Show resolved
Hide resolved
I did a part of review(until |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Module two comments
@vagisha-nidhi this is good to go, thank you! Out of curiosity, will this just work or is there an accompanying change that needs to be done in vstest or otherwise? |
@tonerdo Yeah. There have been changes in vstest which we have made but waiting on https://github.com/dotnet/cli to release with the latest changes. This might take a week. I will update you with that. We should be able to release the nuget once that is done. |
@vagisha-nidhi ok thanks. Can you please point me to the changes in the two repos, for my learning benefit |
@tonerdo Sure. Dotnet cli : These changes are going in dotnet cli in 16.1.0 release of test platform. TP insertion here dotnet/cli#11312 |
src/coverlet.collector/InProcDataCollection/CoverletInProcDataCollector.cs
Outdated
Show resolved
Hide resolved
src/coverlet.collector/InProcDataCollection/CoverletInProcDataCollector.cs
Outdated
Show resolved
Hide resolved
src/coverlet.collector/InProcDataCollection/CoverletInProcDataCollector.cs
Show resolved
Hide resolved
src/coverlet.collector/InProcDataCollection/CoverletInProcDataCollector.cs
Outdated
Show resolved
Hide resolved
unloadModule.Invoke(null, new[] { null, EventArgs.Empty }); | ||
} | ||
catch(Exception ex) | ||
{ | ||
// Ignore exceptions and continue with the unload | ||
if (EqtTrace.IsWarningEnabled) | ||
// Throw any exception if unload fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thank's @vagisha-nidhi!
@tonerdo we can merge! |
@vagisha-nidhi I would like to test locally but I think we need to wait for VSTests PRs? |
@MarcoRossignoli You can test locally. Get the dlls from https://www.nuget.org/packages/Microsoft.TestPlatform/ version 16.1.0. You can replace these dlls in dotnet sdk folder and run Please let me know if you face any issues. |
@MarcoRossignoli This might not work I just checked. Else, you can pull the latest master from vstest, build it, and you will find netcore dlls in artifacts/Debug/netcoreapp2.0 folder. Replace these in dotnet sdk. |
Ok I'll do some test on my local with fresh sdk. |
@vagisha-nidhi I tried but i get exception I copied artifacts/Debug/netcoreapp2.0 to dotnet\sdk\3.0.100-preview6-012013
|
@MarcoRossignoli Copy everything except Microsoft.DotNet.PlatformAbstractions and Microsoft.Extensions.DependencyModel. This error has something to do with version mismatch of the assembly, which are not part of vstest. |
@vagisha-nidhi another unrelated question...is there a way inside VS to "Set test as startup" and launch debug with F5? |
I am not sure if such an option is available. |
Integration with VSTest
Implementation details and user documentation here : #402
Overview of Implementaion :
a. Instrumenting modules in
OnSessionStart
ofCoverletCoverageDataCollector
b. Collecting coverage report in
OnSessionEnd
ofCoverletCoverageDataCollector
c. Sending coverage report back to test platform in
OnSessionEnd
contributes to #395