ModuleBuilder icon indicating copy to clipboard operation
ModuleBuilder copied to clipboard

Add a -CoverageFile for Convert-CodeCoverage

Open Jaykul opened this issue 7 years ago • 1 comments
trafficstars

As a module author In order to understand my code coverage I need to use CodeCov.io and other such tools


Basically I just want to overwrite Pester's coverage file with one based on the modified output of Convert-CodeCoverage. If that's already possible by piping this to some Pester functions, can you put an example of how to do it in the help for Convert-CodeCoverage so others can figure out how -- or better yet, just add a parameter and do it yourself...

Jaykul avatar May 04 '18 17:05 Jaykul

There is code here that might help with this issue. Happy to see this functionality be implemented in ModuleBuilder instead so that we can just call a command from the task. Anyway, hope anything can be reused or used as an inspiration.

https://github.com/gaelcolas/Sampler/blob/bc25ba558383d3ddba7ded9a2e51233f2bc9d4e7/.build/tasks/JaCoCo.coverage.build.ps1#L328-L457

The main activities the task does:

  • Coverts hits and misses using this modules' ConvertTo-SourceLineNumber (but uses the alias Convert-LineNumber)
  • Create a new JaCoCo file from the converted coverage.
  • Updated the JaCoCo statistics in the new JaCoCo file.

johlju avatar Jun 19 '22 07:06 johlju