Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cannot find CodeCoverage.exe" on self-hosted agent #7377

Closed
SeriousM opened this issue Jun 5, 2018 · 6 comments
Closed

"Cannot find CodeCoverage.exe" on self-hosted agent #7377

SeriousM opened this issue Jun 5, 2018 · 6 comments
Assignees

Comments

@SeriousM
Copy link

SeriousM commented Jun 5, 2018

FROM: microsoft/azure-pipelines-agent#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

@ShreyasRmsft
Copy link
Member

@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

@SeriousM
Copy link
Author

SeriousM commented Jun 7, 2018

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?

@ShreyasRmsft
Copy link
Member

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

@jairov4
Copy link

jairov4 commented Jul 9, 2018

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

@PBoraMSFT
Copy link
Member

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

@p00j4
Copy link

p00j4 commented Nov 16, 2021

I used Visual Studio Test Platform Installer task like this. however I still face dll not loading exception when i try to access it from the runsettings

  1. VSTPI task before running the VsTest task using the runsettings
- task: VisualStudioTestPlatformInstaller@1
displayName: 'Visual Studio Test Platform Installer'
inputs:
versionSelector: specificVersion
testPlatformVersion: 16.10.0"
  1. runsettings file
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
          <Configuration>
                <CodeCoverage>
                  <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
                  <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
                  <CollectFromChildProcesses>True</CollectFromChildProcesses>
                  <CollectAspDotNet>False</CollectAspDotNet>
            </CodeCoverage>
      </Configuration>
    </DataCollector>
    </DataCollectors>
  </DataCollectionRunSettings>
</RunSettings>
  1. Logs - Visual Studio Test Platform Installer.docx
    -- they don't show up if it has installed the codecoverage

what could be I missing. how to specically say, hey VSTPI, install the DynamicCoverageDataCollector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants