0
votes

I'am trying to create a build pipeline in Azure DevOps which contain a "vs test task". Nothing fancy here. I want to get the code coverage to send it to sonaQube. However, after the pipeline went through the task there is not .Coverage file created.

Error in vs test task

There is some errors that might be the issue but i'm not sure. there is a big "Data collection : Could not find data collector 'Code Coverage'", This might be related to the fact that my UnitTestProject.dll is built for Framework 4.6.2 and Platform AnyCPU(for this issue I tried to forced: otherConsoleOptions:/Framework:NETFramework,Version=v4.6.2').

My agent is running on Windows server 2012 and Visual Studio Enterprise everything is up to date: VS version

[command]"C:\Program Files (x86)\Microsoft VisualStudio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" @C:\Agent_AzureDevOps_1_work_temp\22f8bb11-e53e-11e9-95d5-5bdab8c29281.txt Microsoft (R) Test Execution Command Line Tool Version 15.9.0

My .trx file is created, however, my .coverage file is nowhere to be seen. I made sure Code Coverage was Enabled.

My package contain those NuGet NuGet in my package.config

I'am blocked and don't know where to look anymore if you guys have an idea.

Thanks for the time. If you guys want more information don't hesitate to ask.

1
The logs clearly say "Couldn't find data collector: Code Coverage". Did you do any troubleshooting on that? Is this a private agent or are you using the Microsoft hosted agents? If a private agent, did you verify that the appropriate Visual Studio SKU is installed to allow for code coverage collection?Daniel Mann
It's a private agent hosted on a Windows Server 2012.Sébastien Honorine
VSTests - Could not find diagnostic data adapter 'Code Coverage'. I ve check this post and no. its not a duplicate.Sébastien Honorine
So your build server has VS Enterprise installed on it?Daniel Mann

1 Answers

0
votes

I do not have enough reputation to add a comment, so I hope this post will not be deleted (although it is not a direct answer, I think). I wanted to suggest you the following:

Do you have an own *.runsettings file (where you might have specified a specific entry? If you do not specify a *.runsettings file by yourself, the Azure DevOps vstest@2 Task will use a "default" runsettings file. At least this is what I could observe in the log (debug=true)

Hope this helps

BR Michael