Rogeriohsjr / CoverageConverter

Azure DevOps Task which converts .coverage file into .coveragexml to be used with Report Generator in Azure Pipeline.

Home Page:https://marketplace.visualstudio.com/items?itemName=rogeriohsjr.build-release-task

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coverage Converter

This Task converts .coverage file into .coveragexml to be used with Report Generator.

๐Ÿ˜ Motivation/Points:

  • I created this extension to help my pipeline process.
  • Instead building a script which I would use only for me, I rather share the same code with everyone, so people don't need to waste their time searching for things that should be out of the box.
  • Learning some new stuff like AzureDevOps Tasks and a bit of Node.

โš ๏ธ Things to keep in mind

๐Ÿ“ How to setup this pipeline?

Basically we need to add these tasks in Azure DevOps.

  1. Execute Code Coverage(CoverageConverter@0)
    1. This task will execute vsTest.exe which is the same used when we use VSTest@2 in azure DevOps.
    2. The result of vsTest.exe is the *.coverage files.
    3. The task will get all *.coverage file and covert into *.coveragexml, which is the format that Report Generator uses to generate a nice interface in Azure DevOps.
  2. Execute Report Generator(reportgenerator@4) to generate the Reports
    1. This task will get the .coveragexml that we generated and generate the reports into a folder.
  3. Execute Publish Code Coverage Results task(PublishCodeCoverageResults@1)
    1. This Task will get the Report and publish into Azure Code Coverage Tab.

Example of YML Files

Azure Pipeline YML File - Example 1

โš™๏ธ How does the convertion works?

Take a look in the code, I tried to comment the code to make that easier to understand. It is all in one file.

https://github.com/Rogeriohsjr/AzureDevOpsTask/blob/master/buildAndReleaseTask/index.ts

About

Azure DevOps Task which converts .coverage file into .coveragexml to be used with Report Generator in Azure Pipeline.

https://marketplace.visualstudio.com/items?itemName=rogeriohsjr.build-release-task

License:MIT License


Languages

Language:TypeScript 100.0%