Skip to content

Commit

Permalink
Fix upload of code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Jul 6, 2017
1 parent b8fe0d5 commit aea4011
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Build/psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,27 @@ Task Test -Depends Init,Analysis {
}
#Remove-Item "$env:BHProjectPath\$TestFile" -Force -ErrorAction SilentlyContinue

$TestResults.CodeCoverage | ConvertTo-Json -Depth 5 | Set-Content -Path "$env:BHProjectPath\CodeCoverage_PS$PSVersion`_$TimeStamp.json"
$CodeCoverage = Get-CodeCoverageMetric -CodeCoverage $TestResults.CodeCoverage

"Statement coverage: $($CodeCoverage.Statement.Analyzed) analyzed, $($CodeCoverage.Statement.Executed) executed, $($CodeCoverage.Statement.Missed) missed, $($CodeCoverage.Statement.Coverage)%."
"Function coverage: $($CodeCoverage.Function.Analyzed) analyzed, $($CodeCoverage.Function.Executed) executed, $($CodeCoverage.Function.Missed) missed, $($CodeCoverage.Function.Coverage)%."

$CoverageReport = New-CoverageReportFromPester -CodeCoverage $TestResults.CodeCoverage -Path $env:BHProjectPath
$CoverageReport.repo_token = $env:CoverallsToken
$CoverageReport.service_name = 'AppVeyor'
$CoverageReport.service_job_id = $env:APPVEYOR_JOB_ID
$CoverageReport.git = @{
head = @{
id = $env:APPVEYOR_REPO_COMMIT
authorname = $env:APPVEYOR_REPO_COMMIT_AUTHOR
authoremail = $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
comittername = $env:APPVEYOR_REPO_COMMIT_AUTHOR
comitteremail = $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
}
message = $env:APPVEYOR_REPO_COMMIT_MESSAGE
branch = $env:APPVEYOR_REPO_BRANCH
}
Publish-CoverageReport -CoverageReport $CoverageReport

if ($TestResults.FailedCount -gt 0) {
Expand Down

0 comments on commit aea4011

Please sign in to comment.