0

I am using VSTS build pipline to build my project ( ASP .Net Core 2.1 ) .
I have added test command to run test project and enabled Publish test results and code coverage checkbox to be able to view code coverage results.

enter image description here

I can see the test results are getting uploaded but can't see any information regarding code coverage.

enter image description here

Am I missing anything ?

UPDATE 1 I am using Hosted VS2017 Agent Pool

enter image description here

user2243747
  • 2,767
  • 6
  • 41
  • 61
  • Possible duplicate of [VSTS - how to get Code Coverage results](https://stackoverflow.com/questions/51982938/vsts-how-to-get-code-coverage-results) – Shayki Abramczyk Dec 10 '18 at 07:37
  • @ShaykiAbramczyk , I have gone through that post but it looks like that post belongs to .Net framework 4.6 framework, I am having issue with .Net core 2.1 and I am 100% sure that I have enabled code coverage in my task. – user2243747 Dec 10 '18 at 07:47
  • Do you use hosted agent or private agent? – Shayki Abramczyk Dec 10 '18 at 08:12
  • @ShaykiAbramczyk I have updated original question. I am using 'Hosted VS 2017' Agent Pool – user2243747 Dec 10 '18 at 20:25

1 Answers1

2

Code coverage can be collected by adding --collect "Code coverage" option to the command line arguments. This is currently only available on the Windows platform.

In your case your arguments should look like --configuration $(BuildConfiguration) --collect "Code coverage"

This information is available if you hover your mouse over the (!) icon besides the checkbox for "Publish test results and code coverage"

vlef
  • 36
  • 3