psake / PowerShellBuild

Common build tasks for psake and Invoke-Build that build and test PowerShell modules
MIT License
134 stars 24 forks source link

Add pester code coverage output parameters #48

Closed solstone closed 3 years ago

solstone commented 4 years ago

Expected Behavior

We should have 2 additional Preference parameters for the pester code coverage report output. CodeCoverageOutputFile CodeCoverageOutputFileFormat

Current Behavior

Currently the only Code coverage options are to enable it, files to be scanned and the failure threshold. There are no options for output customization.

Possible Solution

Add these to the PSBPreference object $PSBPreference.Test.CodeCoverage.OutputFile $PSBPreference.Test.CodeCoverage.OutputFileFormat

Then enabled those options in the Test-PSBuildPester.ps1 function

Steps to Reproduce (for bugs)

Context

I am starting to learn to build modules in Azure Devops and I would like to be able to display the code coverage in the Azure pipeline report. So far the only way I have found to do that is to have pester output the code coverage report to a JaCoCo xml file.

Your Environment

Windows 10 2004 Powershell 5.1 BuildHelpers = '2.0.15' psake = '4.9.0' PSScriptAnalyzer = '1.19.1' PowerShellBuild = '0.4.0'

devblackops commented 3 years ago

Implemented in https://github.com/psake/PowerShellBuild/commit/638b8378322aa8a50318b95fde9c01700fc64763