Skip to content

Commit 846fbeb

Browse files
authored
chore: fix integ test (#2467)
1 parent b7c9be7 commit 846fbeb

29 files changed

Lines changed: 137 additions & 134 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Fixed
1414

15+
- SqlServerDsc
16+
- Several integration tests wrongly said that the command `Test-DscConfiguration`
17+
return `$true` when it is in fact return the string value `'True'`.
1518
- DSC_SqlRS and DSC_SqlWindowsFirewall
1619
- Fixed a duplicated word in localized `TestFailedAfterSet` messages.
1720
- SqlServerDsc

tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Describe "<dscResourceFriendlyName>_Integration" -Tag @('Integration_SQL2016', '
111111
}
112112
}
113113

114-
It 'Should return $true when Test-DscConfiguration is run' {
114+
It 'Should return True when Test-DscConfiguration is run' {
115115
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
116116
}
117117
}
@@ -163,7 +163,7 @@ Describe "<dscResourceFriendlyName>_Integration" -Tag @('Integration_SQL2016', '
163163
$resourceCurrentState.Severity | Should-BeFalsy
164164
}
165165

166-
It 'Should return $true when Test-DscConfiguration is run' {
166+
It 'Should return True when Test-DscConfiguration is run' {
167167
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
168168
}
169169
}

tests/Integration/Resources/DSC_SqlAgentFailsafe.Integration.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
102102
$resourceCurrentState.NotificationMethod | Should-Be $ConfigurationData.AllNodes.NotificationMethod
103103
}
104104

105-
It 'Should return $true when Test-DscConfiguration is run' {
105+
It 'Should return True when Test-DscConfiguration is run' {
106106
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
107107
}
108108
}
@@ -154,7 +154,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
154154
$resourceCurrentState.NotificationMethod | Should-BeFalsy
155155
}
156156

157-
It 'Should return $true when Test-DscConfiguration is run' {
157+
It 'Should return True when Test-DscConfiguration is run' {
158158
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
159159
}
160160
}

tests/Integration/Resources/DSC_SqlAgentOperator.Integration.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
102102
$resourceCurrentState.EmailAddress | Should-Be $ConfigurationData.AllNodes.EmailAddress
103103
}
104104

105-
It 'Should return $true when Test-DscConfiguration is run' {
105+
It 'Should return True when Test-DscConfiguration is run' {
106106
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
107107
}
108108
}
@@ -154,7 +154,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
154154
$resourceCurrentState.EmailAddress | Should-Be $ConfigurationData.AllNodes.NewEmailAddress1
155155
}
156156

157-
It 'Should return $true when Test-DscConfiguration is run' {
157+
It 'Should return True when Test-DscConfiguration is run' {
158158
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
159159
}
160160
}
@@ -206,7 +206,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
206206
$resourceCurrentState.EmailAddress | Should-Be ('{0};{1}' -f $ConfigurationData.AllNodes.NewEmailAddress1, $ConfigurationData.AllNodes.NewEmailAddress2 )
207207
}
208208

209-
It 'Should return $true when Test-DscConfiguration is run' {
209+
It 'Should return True when Test-DscConfiguration is run' {
210210
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
211211
}
212212
}
@@ -258,7 +258,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
258258
$resourceCurrentState.EmailAddress | Should-BeFalsy
259259
}
260260

261-
It 'Should return $true when Test-DscConfiguration is run' {
261+
It 'Should return True when Test-DscConfiguration is run' {
262262
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
263263
}
264264
}

tests/Integration/Resources/DSC_SqlAlwaysOnService.Integration.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Describe "$($script:dscResourceName)_Integration" -Skip {
153153
$resourceCurrentState.Ensure | Should-Be 'Present'
154154
}
155155

156-
It 'Should return $true when Test-DscConfiguration is run' {
156+
It 'Should return True when Test-DscConfiguration is run' {
157157
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
158158
}
159159
}
@@ -203,7 +203,7 @@ Describe "$($script:dscResourceName)_Integration" -Skip {
203203
$resourceCurrentState.Ensure | Should-Be 'Absent'
204204
}
205205

206-
It 'Should return $true when Test-DscConfiguration is run' {
206+
It 'Should return True when Test-DscConfiguration is run' {
207207
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
208208
}
209209
}

tests/Integration/Resources/DSC_SqlAudit.Integration.Tests.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
140140
$resourceCurrentState.MaximumRolloverFiles | Should-Be $ConfigurationData.AllNodes.MaximumRolloverFiles1
141141
}
142142

143-
It 'Should return $true when Test-DscConfiguration is run' {
143+
It 'Should return True when Test-DscConfiguration is run' {
144144
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
145145
}
146146
}
@@ -195,7 +195,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
195195
$resourceCurrentState.AuditFilter | Should-Be $ConfigurationData.AllNodes.AuditFilter2
196196
}
197197

198-
It 'Should return $true when Test-DscConfiguration is run' {
198+
It 'Should return True when Test-DscConfiguration is run' {
199199
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
200200
}
201201
}
@@ -250,7 +250,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
250250
$resourceCurrentState.AuditFilter | Should-BeFalsy
251251
}
252252

253-
It 'Should return $true when Test-DscConfiguration is run' {
253+
It 'Should return True when Test-DscConfiguration is run' {
254254
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
255255
}
256256
}
@@ -307,7 +307,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
307307
$resourceCurrentState.MaximumRolloverFiles | Should-BeFalsy
308308
}
309309

310-
It 'Should return $true when Test-DscConfiguration is run' {
310+
It 'Should return True when Test-DscConfiguration is run' {
311311
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
312312
}
313313
}
@@ -362,7 +362,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
362362
$resourceCurrentState.AuditFilter | Should-BeFalsy
363363
}
364364

365-
It 'Should return $true when Test-DscConfiguration is run' {
365+
It 'Should return True when Test-DscConfiguration is run' {
366366
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
367367
}
368368
}

tests/Integration/Resources/DSC_SqlDatabase.Integration.Tests.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
107107
$resourceCurrentState.OwnerName | Should-Be ('{0}\SqlAdmin' -f $env:COMPUTERNAME)
108108
}
109109

110-
It 'Should return $true when Test-DscConfiguration is run' {
110+
It 'Should return True when Test-DscConfiguration is run' {
111111
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
112112
}
113113
}
@@ -161,7 +161,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
161161
$resourceCurrentState.Collation | Should-Be $ConfigurationData.AllNodes.Collation
162162
}
163163

164-
It 'Should return $true when Test-DscConfiguration is run' {
164+
It 'Should return True when Test-DscConfiguration is run' {
165165
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
166166
}
167167
}
@@ -215,7 +215,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
215215
$resourceCurrentState.CompatibilityLevel | Should-Be $ConfigurationData.AllNodes.CompatibilityLevel
216216
}
217217

218-
It 'Should return $true when Test-DscConfiguration is run' {
218+
It 'Should return True when Test-DscConfiguration is run' {
219219
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
220220
}
221221
}
@@ -269,7 +269,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
269269
$resourceCurrentState.RecoveryModel | Should-Be $ConfigurationData.AllNodes.RecoveryModel
270270
}
271271

272-
It 'Should return $true when Test-DscConfiguration is run' {
272+
It 'Should return True when Test-DscConfiguration is run' {
273273
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
274274
}
275275
}
@@ -323,7 +323,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
323323
$resourceCurrentState.OwnerName | Should-Be $ConfigurationData.AllNodes.OwnerName
324324
}
325325

326-
It 'Should return $true when Test-DscConfiguration is run' {
326+
It 'Should return True when Test-DscConfiguration is run' {
327327
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
328328
}
329329
}
@@ -377,7 +377,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
377377
$resourceCurrentState.SnapshotIsolation | Should-Be $ConfigurationData.AllNodes.SnapshotIsolation
378378
}
379379

380-
It 'Should return $true when Test-DscConfiguration is run' {
380+
It 'Should return True when Test-DscConfiguration is run' {
381381
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
382382
}
383383
}
@@ -435,7 +435,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
435435
$resourceCurrentState.SnapshotIsolation | Should-BeFalsy
436436
}
437437

438-
It 'Should return $true when Test-DscConfiguration is run' {
438+
It 'Should return True when Test-DscConfiguration is run' {
439439
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
440440
}
441441
}

tests/Integration/Resources/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
101101
$resourceCurrentState.Path | Should-Be $ConfigurationData.AllNodes.DataFilePath
102102
}
103103

104-
It 'Should return $true when Test-DscConfiguration is run' {
104+
It 'Should return True when Test-DscConfiguration is run' {
105105
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
106106
}
107107
}
@@ -152,7 +152,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
152152
$resourceCurrentState.Path | Should-Be $ConfigurationData.AllNodes.LogFilePath
153153
}
154154

155-
It 'Should return $true when Test-DscConfiguration is run' {
155+
It 'Should return True when Test-DscConfiguration is run' {
156156
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
157157
}
158158
}
@@ -204,7 +204,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
204204
$resourceCurrentState.Path | Should-Be $ConfigurationData.AllNodes.BackupFilePath.TrimEnd('\')
205205
}
206206

207-
It 'Should return $true when Test-DscConfiguration is run' {
207+
It 'Should return True when Test-DscConfiguration is run' {
208208
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
209209
}
210210
}

tests/Integration/Resources/DSC_SqlDatabaseMail.Integration.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
109109
$resourceCurrentState.TcpPort | Should-Be $ConfigurationData.AllNodes.TcpPort
110110
}
111111

112-
It 'Should return $true when Test-DscConfiguration is run' {
112+
It 'Should return True when Test-DscConfiguration is run' {
113113
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
114114
}
115115
}
@@ -150,7 +150,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
150150
$script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction 'Stop'
151151
}
152152

153-
It 'Should return $true when Test-DscConfiguration is run' {
153+
It 'Should return True when Test-DscConfiguration is run' {
154154
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
155155
}
156156
}
@@ -209,7 +209,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
209209
$resourceCurrentState.TcpPort | Should-BeFalsy
210210
}
211211

212-
It 'Should return $true when Test-DscConfiguration is run' {
212+
It 'Should return True when Test-DscConfiguration is run' {
213213
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
214214
}
215215
}

tests/Integration/Resources/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
219219
$grantPermission.Permission | Should-ContainCollection @('Select')
220220
}
221221

222-
It 'Should return $true when Test-DscConfiguration is run' {
222+
It 'Should return True when Test-DscConfiguration is run' {
223223
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
224224
}
225225
}
@@ -290,7 +290,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
290290
$grantPermission.Permission | Should-ContainCollection @('Select')
291291
}
292292

293-
It 'Should return $true when Test-DscConfiguration is run' {
293+
It 'Should return True when Test-DscConfiguration is run' {
294294
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
295295
}
296296
}
@@ -355,7 +355,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
355355
$grantPermission.Permission | Should-ContainCollection @('Select')
356356
}
357357

358-
It 'Should return $true when Test-DscConfiguration is run' {
358+
It 'Should return True when Test-DscConfiguration is run' {
359359
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
360360
}
361361
}
@@ -433,7 +433,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
433433
$grantPermission.Permission | Should-ContainCollection @('Alter')
434434
}
435435

436-
It 'Should return $true when Test-DscConfiguration is run' {
436+
It 'Should return True when Test-DscConfiguration is run' {
437437
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
438438
}
439439
}
@@ -508,7 +508,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016',
508508
$grantPermission.Permission | Should-ContainCollection @('Alter')
509509
}
510510

511-
It 'Should return $true when Test-DscConfiguration is run' {
511+
It 'Should return True when Test-DscConfiguration is run' {
512512
Test-DscConfiguration -Verbose -ErrorAction 'Stop' | Should-Be 'True'
513513
}
514514
}

0 commit comments

Comments
 (0)