- Notifications
You must be signed in to change notification settings - Fork4
Azure DevOps Task which converts .coverage file into .coveragexml to be used with Report Generator in Azure Pipeline.
License
Rogeriohsjr/CoverageConverter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This Task converts.coverage file into.coveragexml to be used withReport Generator.
- 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.
We can't use Coverage.exe to generate .coverage file
💔 We can't useVSTest@2 Task withcodeCoverageEnabled astrue
- If we enabled it, this will add a file intoCode Coverage tab in Azure DevOps, which will override theReport Generator reports.
- This is not becauseCode Coverage, it is becauseVSTest@2 upload the coverage generated by itself to Azure Pipeline Tab Code Coverage automatically and we can't disable it. If they didn't upload the code coverage automatically we could use the coverage file generated by theVSTest@2. That is why theCode Coverage needs to execute again theVSTest@2.
- Here is Review Code Coverage Results Documentation from Microsoft.
- Here is a thread that I asked to update the documentation to make it clear.
- To be clear, we can use theVSTest@2 in our YML file, but we cannot use the Test Coverage from that task, theCode Coverage needs to be executed again, in order to get the coverage files.
Basically we need to add these tasks in Azure DevOps.
- ExecuteCode Coverage(CoverageConverter@0)
- This task will execute vsTest.exe which is the same used when we use VSTest@2 in azure DevOps.
- The result of vsTest.exe is the *.coverage files.
- 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.
- ExecuteReport Generator(reportgenerator@4) to generate the Reports
- This task will get the.coveragexml that we generated and generate the reports into a folder.
- ExecutePublish Code Coverage Results task(PublishCodeCoverageResults@1)
- This Task will get the Report and publish intoAzure Code Coverage Tab.
Azure Pipeline YML File - Example 1
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.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.