Pester
Pester copied to clipboard
Add support for CoverageReport output preferences
Hey Pester Team,
I think it would be useful if you could control the verbosity of the coverage report independently from the Output preference.
Motivation: we have a set of Pester tests that are running as part of our CI, using Azure DevOps. We're using the PesterConfiguration to set the Output to Detailed, which adds an extra level of helpful logging. A side-effect of this setting is that the CodeCoverage report is displayed in full in the build output. Some of our uncovered lines include Azure DevOps "##vso" logging statements, which are incorrectly parsed by the build agent as malformed statements.
Presently, the coverage report is controlled by the output preference. Perhaps a new preference setting could be added to the CodeCoverageConfiguration?
$config.Output.Verbosity = "Detailed"
$config.CodeCoverage.OutputVerbosity = "Normal"
or
$config.Output.Verbosity = "Detailed"
$config.Output.CoverageVerbosity = "Normal"
I'd be interested in taking a stab at this. I suspect the change is rather straightforward, but the learning curve might be the tests that you're using to test pester.
Do you have any previous issues that outline some guidelines for the tests? As a first-timer, there's a mix of RSpec and Pester tests and it's a little unclear which to use.
@bryanbcook luckily for you there is a very recent PR that is adding another option for the output. It touches on all the similar areas, and also tests both in the Pester tests and P tests. Little tip: In P tests you can change the t to dt to run just that single tests or multiple tests if you mark multiple).
If you need more help please ask. We are here to help you. 🙂
I think this is the better option:
$config.Output.Verbosity = "Detailed"
$config.Output.CoverageVerbosity = "Normal"
The other PR was also adding to the output section, so we don't want to scatter the options around too many areas.
Friendly reminder @bryanbcook. Do you still want to implement this? 🙂