Skip to content

Commit

Permalink
update failure counter
Browse files Browse the repository at this point in the history
  • Loading branch information
niphlod committed Oct 21, 2024
1 parent c0f21b9 commit 8735d8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/appveyor.pester.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ if (-not $Finalize) {
Get-ChildItem $ModuleBase\dbatools_messages_and_errors.xml.zip | ForEach-Object { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
}
#$totalcount = $results | Select-Object -ExpandProperty TotalCount | Measure-Object -Sum | Select-Object -ExpandProperty Sum
$failedcount = $results | Select-Object -ExpandProperty FailedCount | Measure-Object -Sum | Select-Object -ExpandProperty Sum
$failedcount = 0
$failedcount += $results | Select-Object -ExpandProperty FailedCount | Measure-Object -Sum | Select-Object -ExpandProperty Sum
if ($failedcount -gt 0) {
# pester 4 output
$faileditems = $results | Select-Object -ExpandProperty TestResult | Where-Object { $_.Passed -notlike $True }
Expand All @@ -353,13 +354,13 @@ if (-not $Finalize) {


$results5 = @(Get-ChildItem -Path "$ModuleBase\Pester5Results*.xml" | Import-Clixml)
$failedcount += $results | Select-Object -ExpandProperty FailedCount | Measure-Object -Sum | Select-Object -ExpandProperty Sum
# pester 5 output
$faileditems = $results5 | Select-Object -ExpandProperty Tests | Where-Object { $_.Passed -notlike $True }
if ($faileditems) {
Write-Warning "Failed tests summary (pester 5):"
$faileditems | ForEach-Object {
$name = $_.Name
$failedCount += 1
[pscustomobject]@{
Path = $_.Path -Join '/'
Name = "It $name"
Expand Down

0 comments on commit 8735d8e

Please sign in to comment.