How to enable the code coverage view on VSTS?

11,687

In Code coverage Tab, you need to use Publish Code Coverage Results task to show tables and graphs there.

While for Publish Code Coverage Results task, it only supports Code Coverage data in Jacoco or Cobertura formats. So the result of the *.coverage file can not be shown by tables and graphs in Code coverage Tab.

More details, you can refer the blog Browse Code Coverage reports and the issue How to publish the code coverage result with a .coverage file.

Share:
11,687

Related videos on Youtube

Herman Cordes
Author by

Herman Cordes

Started as a web developer in PHP, which gradually changed into ASP.NET. However the last couple of years I'm mostly focused on building WPF and WCF applications. Also interested in development-accelerating tools and techniques, like DevOps.

Updated on June 04, 2022

Comments

  • Herman Cordes
    Herman Cordes almost 2 years

    My team uses VSTS with hosted agents and a Visual Studio Test build task to run all tests and produce code coverage. However the tab Code coverage remains empty afterwards, only showing a link to download the *.coverage file.

    I actually expect the code coverage results to be shown, with tables and graphs which projects are tested and it's respective coverage.

    We are using the Visual Studio Test build task to test net461 assemblies with the Code Coverage enabled checked.

    Somewhat related are both this and this issue, but not entirely, because we are just using MSTest Framework with built-in Visual Studio Test build task, which (I understand) should also automatically publish the code coverage results.

    Am I missing something to get this Code coverage view working? Thanks!!

    enter image description here

  • D3X
    D3X over 5 years
    VSTS doesn't support Microsoft's own code coverage format ? Are you kidding me ?
  • reckface
    reckface over 5 years
    @AlexMarshall I'm wondering the same thing... Can we get some clarification on this?
  • Daniël Tulp
    Daniël Tulp over 5 years
    Microsoft allows you to download the .Coverage file which you can open only with Visual Studio enterprise IDE, just to belittle you that you did not buy in to the premium label ... (says the Community edition user)
  • Craig W.
    Craig W. over 5 years
    @DaniëlTulp, the Enterprise requirement is not, or at least no longer, true. I don't know about Community, but VS Pro will open the .coverage file. However, you do have to do it a certain way. Open the solution that the coverage file is for, then use File -> Open... -> File... and select the .coverage file. It will open, analyze the results, and display them in the Code Coverage Results window.