PSCodeHealth icon indicating copy to clipboard operation
PSCodeHealth copied to clipboard

Potential feature: Export NUnitResults

Open mkellerman opened this issue 8 years ago • 1 comments

Having the NUnit Results would allow us to use this module to not only generate the HTML report, but also, the NUnit results we import back into Jenkins.

Adding a parameter like so: Invoke-PSCodeHealth -Path '.\coveralls' -TestsPath '.\coveralls' -HtmlReportPath "$env:USERPROFILE\Desktop\Report.html" -NUnitPath ".\NUnitResults.xml"

Expected Behavior

A NUnit Results file should be created in $NUnitPath path.

Current Behavior

An non-standard object is returned from Invoke-PSCodeHealth, that cannot be easily exported to JSON/XML to be used by other services.

Possible Solution

In: PSCodeHealth/PSCodeHealth/Private/Metrics/Get-FunctionTestCoverage.ps1 Line 54: Add a check for the NUnitPath, if a path is provided, then add: -OutputFile "$NUnitPath" -OutputFormat "NUnitXml"

or Create a more extensive NUnit result file from all the metrics gathered from PCHealthCheck

Could use -PesterNUnitXmlPath to export just Pester, so we dont think it's the actual HealthCheck report.

Your Environment

  • Module version used: 0.2.9

mkellerman avatar Jan 22 '18 16:01 mkellerman

I would also like to see this feature implemented

sit-md avatar Nov 09 '18 09:11 sit-md