Improvements to code coverage experience under test automation

Ravi Kumar

If you’re using Azure DevOps for your CI/CD pipeline, you may be interested in our recent improvements to code coverage testing. Code coverage tests can help you identify areas of your code that are not tested, or not tested enough, and improve the quality of your automated tests and overall code quality.

With our recent updates, you can now view code coverage results in a default view for .coverage format, using the default vstest task to publish code coverage. Additionally, if you have enabled code coverage policy, you will see comments in the pull request indicating whether or not the policy has been met, including comments about missing test cases or test executables.

We are continuously collecting feedback to improve our automated testing capabilities, so you can expect more updates and improvements in the future. More details on the released features below:

Default view for ‘.coverage’ format:

Code coverage results generated using the ‘.coverage’ format can now be viewed directly in the web portal. Previously results for ‘.coverage’ files could not be viewed in the portal UI and users were provided with a link to download the test results which could be viewed offline in an editor of choice. However, this created a broken experience whereby developers were forced to go outside the boundaries of the product to view ‘.coverage’ test results and then come back for completing other tasks. This feature release also brings parity with test cases generated using other tasks which can already be viewed directly in the portal. Read more here: Publish Code Coverage Results v2 Task

Improvements to comments and collaboration experience:

If a PR(pull request) fails to meet the code coverage policy set by your organisation, it automatically gets rejected. However, going forward the comments section of the PR will now be kept open so that developers can give justification as to why their code could not meet the policy. This helps provide improved clarity to the managers and whole team in general when reviewing past PRs.

Add comments to rejected Pull requests

3 comments

Discussion is closed. Login to edit/delete existing comments.

  • Frederic Forjan 1

    The ordering by clicking on the header Total Lines/Line Coverage odes not work for me.
    Where should we report bug ?

    • Ravi KumarMicrosoft employee 0

      Hi Frederic,
      The sort functionality at table header level for ‘Covered Lines’, ‘Total Lines’ inside the code coverage tab was not working as expected for a subset of our customers. The fix will be generally available in ~2 weeks time.

      If the issue is not fixed by then you can report an issue with our Developer community here. Hope it helps.

  • endra hidayah 0

    thanks guys, I’ll give it a try

Feedback usabilla icon