Skip to content

Commit 09bc3a6

Browse files
Merge branch 'agentV5' of https://github.com/dataplat/dbachecks into agentV5
2 parents db487be + c1d2983 commit 09bc3a6

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

source/checks/Agentv5.Tests.ps1

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ BeforeDiscovery {
1414
$Instance = $psitem
1515
try {
1616
$InstanceSMO = Connect-DbaInstance -SqlInstance $Instance -ErrorAction SilentlyContinue -ErrorVariable errorvar
17-
} catch {
17+
}
18+
catch {
1819
$NotContactable += $Instance
1920
}
2021
if ($NotContactable -notcontains $psitem) {
@@ -57,7 +58,8 @@ Describe "SQL Agent Account" -Tag AgentServiceAccount, ServiceAccount -ForEach $
5758
It "SQL Agent service should have a start mode of Manual for FailOver Clustered Instance <_.InstanceName> on <_.Name>" -Skip:$skipServiceStartMode {
5859
$PSItem.Agent.StartMode | Should -Be "Manual" -Because 'Clustered Instances required that the Agent service is set to manual'
5960
}
60-
} else {
61+
}
62+
else {
6163
It "SQL Agent service should have a start mode of Automatic for standalone instance <_.InstanceName> on <_.Name>" -Skip:$skipServiceStartMode {
6264
$PSItem.Agent.StartMode | Should -Be "Automatic" -Because 'Otherwise the Agent Jobs wont run if the server is restarted'
6365
}
@@ -79,17 +81,6 @@ Describe "DBA Operator" -Tag DbaOperator, Operator -ForEach $InstancesToTest {
7981
}
8082
}
8183

82-
Describe "Failsafe Operator" -Tag FailsafeOperator, Operator -ForEach $InstancesToTest {
83-
$skipFailsafeoperator = Get-DbcConfigValue skip.agent.failsafeoperator
84-
$failsafeoperator = Get-DbcConfigValue agent.failsafeoperator
85-
86-
Context "Testing failsafe Operators exists on <_.Name>" {
87-
It "The Failsafe operator <_.FailSafeOperator> exists on <_.Name>" -Skip:$skipFailsafeoperator -ForEach ($PSItem.JobServer.AlertSystem | Where-Object FailSafeOperator -EQ 'null') {
88-
$PSItem.ExpectedFailSafeOperator | Should -Be $failsafeoperator -Because 'The failsafe operator will ensure that any job failures will be notified to someone if not set explicitly'
89-
}
90-
}
91-
}
92-
9384
# Describe "Failsafe Operator" -Tags FailsafeOperator, Operator, $filename {
9485
# if ($NotContactable -contains $psitem) {
9586
# Context "Testing failsafe operator exists on $psitem" {

0 commit comments

Comments
 (0)