Please help me - How do I enable/show code coverage result for .NET Standard library project (2.0) in VSTS (CI). Have enable Test result through dotnet Test task (.NET Core 2.0 preview) and able to to see the passed Test cases. Next step I have added "publish result" task but it's showing the below warning during Build -
No test result files matching _temp*/.trx were found.
Even I have modified the .csproj file and added <DebugType>Full</DebugType>
.
Using Visual Studio 2017 Professional (version - 15.5.2) Project - .NET Standard Library (2.0) Unit Test - MSTest (inbuilt in Visual Studio)
What tasks / how tasks should I need to add/modify in Build Definition in VSTS, so that I can see Code Coverage against Unit Testing.
Tasks for Code Coverage - TestAssemblies
other option
Now I am able to see the Code Coverage (not sure whether correct code coverage is showing or not) but the tasks - Test Assemblies ***.test*.dll is failing with the below error - Code-Coverage-Result
No test is available in .........$(BuildConfiguration)\netcoreapp2.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate and try again.
Thanks.
Regards, Deb
First, make sure you can get code coverage result through Visual Studio. As far as I know, Enterprise version is required (You can use Hosted VS 2017 agent).
The Code Coverage for .Net Core Unit test project:
<DebugType>Full</DebugType>
to PreopertyGroupSample:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
<DebugType>Full</DebugType>
</PropertyGroup>
Secondly, you can run test through Visual Studio Test task: (
Path to vstest.console.exe: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe
Check Code coverage enabled
option
Other console options: /framework:".NETCoreApp,Version=v2.0"
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With