Azure-pipelines-tasks: "Cannot find CodeCoverage.exe" on self-hosted agent

Created on 5 Jun 2018  路  5Comments  路  Source: microsoft/azure-pipelines-tasks

FROM: https://github.com/Microsoft/vsts-agent/issues/1605

Have you tried trouble shooting?

Trouble shooting doc
yes

Agent Version and Platform

Version of your agent? 2.134.2

OS of the machine running the agent? Windows 10, 1803

The agent-machine has VS2017 Professional installed.

VSTS Type and Version

VisualStudio.com

If VisualStudio.com, what is your account name? http://scan2lead.visualstudio.com

What's not working?

I use "Visual Studio Test Platform Installer (Preview)" and "Visual Studio Test (v2)" to run my tests. I enabled Code Coverage for them.
The codecoverage.exe files are located at

C:\vstsAgent\_work\_tool\VsTest\15.8.0-preview-20180510-03\x64\tools\net451\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
C:\vstsAgent\_work\_tool\VsTest\15.8.0-preview-20180510-03\x64\tools\net451\Team Tools\Dynamic Code Coverage Tools\amd64\CodeCoverage.exe

but the logs tell me

...
2018-06-05T07:45:52.4833619Z Data collection : Logging DataCollector Diagnostics in file: C:\vstsAgent\_work\_temp\6de4f490-6894-11e8-a094-f7e855a114e8.datacollector.18-06-05_09-45-49_54108_5.txt
2018-06-05T07:45:52.4834750Z Data collector 'Code Coverage' message: Cannot find CodeCoverage.exe..
...

If I run the same tasks on a VSTS Hosted Agent the coverage works.

Agent and Worker's Diagnostic Logs

Agent_20180530-071436-utc.log
Worker_20180605-074323-utc.log

Related Repositories

Please ensure you are logging issues to the correct repository in order to get the best support.

  • Tasks Repository - contains all of the inbox tasks we ship with VSTS/TFS. If you are having issues with tasks in Build/Release jobs (e.g. unreasonable task failure) please log an issue here.
  • Hosted Agent Image Repository - contains the VM image used in the VSTS Hosted Agent Pool. If you are having Build/Release failures that seems like they are related to software installed on the Hosted Agent (e.g. the DotnetSDK is missing or the AzureSDK is not on the latest version) please log an issue here.

If you are hitting a generic issue about VSTS/TFS, please report it to the Developer Community

Test

Most helpful comment

@jairov4 - Code coverage does not ship in VS Professional edition. You need to use VS Enterprise or use the test platform installer task.

All 5 comments

@SeriousM can you please provide the build/release logs with system.debug=true.
Please upload the entire zip file you get.

Also in the vstest task have you set the test platform version to installed by tools installer?

image

Also in the vstest task have you set the test platform version to installed by tools installer?

That was the solution. It was set to "Latest" which suggested to select a special version, not a result of a preview executed task.
Thank you. Maybe this could be enhanced to be set automatically or suggested if CodeCoverage.exe wasn't found?

@SeriousM thank you for your feedback. @PBoraMSFT for taking a look at the feedback.

+1 I reproduced this with same version of agent and VS installed
@SeriousM @PBoraMSFT

@jairov4 - Code coverage does not ship in VS Professional edition. You need to use VS Enterprise or use the test platform installer task.

Was this page helpful?
0 / 5 - 0 ratings