Skip to content

Commit

Permalink
fixing stuff Add Pester V5 Instance Level Checks #882
Browse files Browse the repository at this point in the history
  • Loading branch information
SQLDBAWithABeard committed Aug 26, 2023
1 parent e2072c7 commit 7ec8934
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions containers/JessAndBeard.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,13 @@ The Tags are the same"
PassedChange = +2 # + or - the number of tests passed for v5
FailedChange = -2 # + or - the number of tests failed for v5
SkippedChange = 0 # + or - the number of tests skipped for v5
},
@{
Name = 'SqlEngineServiceAccount'
RunChange = -3 # + or - the number of tests run for v5
PassedChange = 0 # + or - the number of tests passed for v5
FailedChange = 0 # + or - the number of tests failed for v5
SkippedChange = -3 # + or - the number of tests skipped for v5
}
)
$runchange = 0
Expand Down Expand Up @@ -2414,6 +2421,7 @@ The Total Tests Run are the same {0} {1}

#total passed checks
If ($v5Passed -ne $v4code.PassedCount) {

$Message = "
Uh-Oh - The total tests Passed between v4 and v5 are not the same somehow.
For v4 We Passed
Expand All @@ -2422,11 +2430,16 @@ and
For v5 we Passed
{1} tests
{2}
" -f $v4code.PassedCount, $v5Passed, $messageAppend
if($MessageAppend){
$Message += "
v4 TestNames
{3}
{0}
v5 TestNames
{4}
" -f $v4code.PassedCount, $v5Passed, $messageAppend, ($v4code.TestResult.Where{$_.Result -eq 'Passed'}.Name |Out-String),($v5code.Passed.ExpandedName |Out-String)
{1}
" -f ($v4code.TestResult.Where{$_.Result -eq 'Passed'}.Name |Out-String),($v5code.Passed.ExpandedName |Out-String)
}
Write-PSFMessage -Message $Message -Level Warning
} else {
$message = "
Expand All @@ -2443,11 +2456,16 @@ For v4 We Failed
and
For v5 we Failed
{1} tests
" -f $v4code.FailedCount, $v5Failed, $messageAppend
if($MessageAppend){
$Message += "
v4 TestNames
{2}
{0}
v5 TestNames
{3}
" -f $v4code.FailedCount, $v5failed,($v4code.TestResult.Where{$_.Result -eq 'Failed'}.Name |Out-String),($v5code.Failed.ExpandedName |Out-String)
{1}
" -f ($v4code.TestResult.Where{$_.Result -eq 'Failed'}.Name |Out-String),($v5code.Failed.ExpandedName |Out-String)
}
Write-PSFMessage -Message $Message -Level Warning
} else {
$message = "
Expand All @@ -2464,11 +2482,16 @@ For v4 We Skipped
and
For v5 we Skipped
{1}
" -f $v4code.SkippedCount, $v5Skipped, $messageAppend
if($MessageAppend){
$Message += "
v4 TestNames
{3}
{0}
v5 TestNames
{4}
{2}" -f $v4code.SkippedCount, $v5skipped, $messageAppend,($v4code.TestResult.Where{$_.Result -eq 'Skipped'}.Name |Out-String),($v5code.Skipped.ExpandedName |Out-String)
{1}
" -f ($v4code.TestResult.Where{$_.Result -eq 'Skipped'}.Name |Out-String),($v5code.Skipped.ExpandedName |Out-String)
}
Write-PSFMessage -Message $Message -Level Warning
} else {
$message = "
Expand Down

0 comments on commit 7ec8934

Please sign in to comment.