Code Coverage (Missing CodeCoverage.exe)

Bernhard Richter's Avatar

Bernhard Richter

14 Jul, 2017 10:49 AM

Hi!

I am having trouble with running tests with code coverage using the Visual Studio 2017 image.

Tests are executed using vstest.console.exe /EnableCodeCoverage and as it turns out this requires CodeCoverage.Exe to be present on the machine that executes the tests.

CodeCoverage.exe is not shipped as part of VS 2017 Community Edition.

You can see the build fail here because of the missing CodeCoverage.exe
https://ci.appveyor.com/project/seesharper/lightinject/build/1.0.13...

The following issue explains this a bit more

https://social.msdn.microsoft.com/Forums/vstudio/en-US/57f16d1d-48c...

The strange thing is that with the Visual Studio 2015 image everything works fine

https://ci.appveyor.com/project/seesharper/lightinject-xunit

Any ideas?

  1. Support Staff 1 Posted by Ilya Finkelshte... on 20 Jul, 2017 08:54 PM

    Ilya Finkelshteyn's Avatar

    Hi Bernhard,

    Sorry for some delay, we were very busy with recent nuget download issue.

    We have Agents for Visual Studio 2017 installed in addition to Visual Studio itself. Please add the following commands at some point before build, to use vstest.console.exe from Agents for Visual Studio 2017:

    set path=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow;%path%
    copy "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions\appveyor.*" "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions" /y
    

    Ilya.

  2. 2 Posted by Daniel Jones on 15 Aug, 2017 12:55 PM

    Daniel Jones's Avatar

    Hi,

    similarly to the original post. We recently switched to 2017 image.
    We are able to pick up the vstest.console.exe location but as part of that we use the switch /EnableCodeCoverage. Subsequently we then attempt to run analysis on the results of that by invoking a tool which used to live under
    visual studio/14.0/Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe

    It's the absence of CodeCoverage.exe I believe the OP was questioning.
    The results of this process is then uploaded to Coveralls.

    Can you advise how to implement the same functioanlity on the 2017 image that was previously working on 2015?

    Thanks

  3. Support Staff 3 Posted by Ilya Finkelshte... on 15 Aug, 2017 09:06 PM

    Ilya Finkelshteyn's Avatar

    @Daniel Did you try to use the exact workaround advised in my previous post, by adding the following command at any step before you use vstest.console.exe? After you called those commands you should not have to run vstest.console.exe from specific path.

    set path=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow;%path%
    copy "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions\appveyor.*" "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions" /y
    

    This is tested workaround. If this does not work for you, please try provide a repro in public repository for us to debug.

  4. 4 Posted by Daniel Jones on 16 Aug, 2017 11:38 AM

    Daniel Jones's Avatar

    We aren’t trying to run vstest.console.exe – that is working fine.
    We are trying to run CodeCoverage.exe which on the previous image version lived under:

    … visual studio/14.0/Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe

    Daniel Jones
    Technical Architect

    Strata | gotostrata.com<https://www.gotostrata.com/>
    8th Floor Aldwych House
    71-91 Aldwych,
    London
    WC2B 4HN
    T 0207 280 4314

    [cid:[email blocked]]

    Strata is the trading name for Adazzle Limited. Adazzle Limited is a company registered in England and Wales (company number: 3910501 and VAT number: 757 1912 13 with its registered office and principal place of business at 71-91 Aldwych House, London WC2B 4HN, tel.: +44(0)20 7280 4500, e-mail [[email blocked]<mailto:[email blocked]>]. Adazzle Ltd is owned by Strata Marketing, Inc. a Comcast Company.

  5. Support Staff 5 Posted by Ilya Finkelshte... on 16 Aug, 2017 06:15 PM

    Ilya Finkelshteyn's Avatar

    Ah, I see. Here you go:

    32-bit:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Team Tools\Dynamic Code Coverage Tools

    64-bit:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Team Tools\Dynamic Code Coverage Tools\amd64

    Also note that you can always use RDP or simple run something like cd c:\ && dir /s CodeCoverage.exe during a build to discover things like this :)

  6. Ilya Finkelshteyn closed this discussion on 16 Aug, 2017 06:15 PM.

  7. Daniel Jones re-opened this discussion on 16 Aug, 2017 07:15 PM

  8. 6 Posted by Daniel Jones on 16 Aug, 2017 07:15 PM

    Daniel Jones's Avatar

    Great thanks

    Get Outlook for iOS<https://aka.ms/o0ukef>
    ________________________________

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac