Skip to content

Commit

Permalink
report to xml
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd committed May 24, 2024
1 parent 09192c3 commit d931a37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ stages:
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: 'coverage.xml'
pathToSources: 'src/'
pathToSources: 'bin/'
failIfCoverageEmpty: false
condition: succeededOrFailed()
- task: PublishTestResults@2
Expand Down
4 changes: 4 additions & 0 deletions test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ if ($CC) {
Write-Host "Running Code Coverage"
$env:PESTER_CC_DEBUG = 0
$env:PESTER_CC_IN_CC = 1
$sw = [System.Diagnostics.Stopwatch]::StartNew()
$here = {}
$bp = Set-PSBreakpoint -Script $PSCommandPath -Line $here.StartPosition.StartLine -Action {}
$null = $bp | Disable-PSBreakpoint
Expand Down Expand Up @@ -193,6 +194,7 @@ if ($CC) {
$Write_CoverageReport = & (Get-Module Pester) { Get-Command Write-CoverageReport }
$Stop_TraceScript = & (Get-Module Pester) { Get-Command Stop-TraceScript }
$Get_CoverageReport = & (Get-Module Pester) { Get-Command Get-CoverageReport }
$Get_JaCoCoReportXml = & (Get-Module Pester) { Get-Command Get-JaCoCoReportXml }

& $Stop_TraceScript -Patched $patched
$measure = $tracer.Hits
Expand All @@ -204,6 +206,8 @@ if ($CC) {
}
}

[xml] $jaCoCoReport = [xml] (& $Get_JaCoCoReportXml -CommandCoverage $breakpoints -TotalMilliseconds $sw.ElapsedMilliseconds -CoverageReport $coverageReport -Format "JaCoCo")
$jaCoCoReport | Set-Content -Path $PSScriptRoot/coverage.xml
& $Write_CoverageReport -CoverageReport $coverageReport
}

Expand Down

0 comments on commit d931a37

Please sign in to comment.