2

I'm trying to figure out how to show Coverage in TFS. with .net CORE.

Below is my build definition. I have a "Test .NET Core" task.

tfsbuilddef

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21

From above url, I found this hint:

Run the tests in the project in the current directory and generate a test results file in the trx format:

dotnet test --logger:trx

And I have test results working.

(Details of Test-Task and the Publish-Test-Results below)

Publish Test Results (task). With the following arguments

Test Result Format: VSTest

Test Results Files **/*.trx

So I can see Test Results :) (below image)

tfs build succeeded

But how do you get Code Coverage working? (above image, red circle...there is a place holder for Coverage)

What I've tried:

There is a "Coverage" task..but doesn't seem right to me. (image below)

faux coverage task

granadaCoder
  • 26,328
  • 10
  • 113
  • 146
  • Do you have Visual Studio Enterprise installed on the build machine? – Shayki Abramczyk Mar 13 '19 at 15:58
  • Hi. I don't "own" the build machine. I will find out. Is this a magic button? :) – granadaCoder Mar 14 '19 at 14:36
  • The Code Coverage works only in Visual Studio Enterprise.. – Shayki Abramczyk Mar 14 '19 at 14:40
  • I kinda understand you. But the TFS Build Machine has a place holder for it. (My screen shots). Are you saying the TFS-Build-Machine placeholder relies on VS Studio Ent on the build machine? That's seems weird to me. ( Yes, I do understand that DEVELOPERS need VS-2017-Enterprise to see coverage while developing). – granadaCoder Mar 14 '19 at 15:27
  • Did you ever find a solution for that problem? – Andre Kraemer Mar 25 '19 at 09:17
  • @Andre. The short answer is "no". HOWEVER, if you follow my answer at the url I provide in this comment and follow one of the URL that I mention.. IIRC, there is a person who got "reportgenerator" working on the build machine. (My answer to this other question is about using it locally). https://stackoverflow.com/questions/38425936/how-to-measure-code-coverage-in-asp-net-core-projects-in-visual-studio/55271781#55271781 – granadaCoder Mar 25 '19 at 12:55

0 Answers0