Skip to content

Commit 7d58bf5

Browse files
authored
Bump dbatools to v2.0.1 (#1926)
- SqlServerDsc - Re-enable integration tests for dbatools. - Bumped dbatools to v2.0.1 for the integration tests.
1 parent a91b02c commit 7d58bf5

File tree

4 files changed

+159
-152
lines changed

4 files changed

+159
-152
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"DynamicAlloc",
7070
"GetxPDTVariable",
7171
"Dbcc",
72-
"creplace"
72+
"creplace",
73+
"dbatools"
7374
],
7475
"cSpell.ignorePaths": [
7576
".git"

CHANGELOG.md

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

66
## [Unreleased]
77

8+
### Changed
9+
10+
- SqlServerDsc
11+
- Re-enable integration tests for dbatools.
12+
- Bumped dbatools to v2.0.1 for the integration tests.
13+
814
## [16.3.1] - 2023-05-06
915

1016
### Changed

azure-pipelines.yml

Lines changed: 147 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -239,95 +239,95 @@ stages:
239239
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
240240
testRunTitle: 'Integration ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
241241

242-
# - job: Test_Integration_dbatools
243-
# displayName: 'Integration (dbatools)'
244-
# dependsOn: Test_Integration
245-
# strategy:
246-
# matrix:
247-
# SQL2016_WIN2022:
248-
# JOB_VMIMAGE: 'windows-2022'
249-
# TEST_CONFIGURATION: 'Integration_SQL2016'
250-
# SQL2017_WIN2022:
251-
# JOB_VMIMAGE: 'windows-2022'
252-
# TEST_CONFIGURATION: 'Integration_SQL2017'
253-
# SQL2019_WIN2022:
254-
# JOB_VMIMAGE: 'windows-2022'
255-
# TEST_CONFIGURATION: 'Integration_SQL2019'
256-
# SQL2022_WIN2022:
257-
# JOB_VMIMAGE: 'windows-2022'
258-
# TEST_CONFIGURATION: 'Integration_SQL2022'
259-
# pool:
260-
# vmImage: $(JOB_VMIMAGE)
261-
# timeoutInMinutes: 0
262-
# variables:
263-
# SMODefaultModuleName: 'dbatools'
264-
# steps:
265-
# - task: DownloadPipelineArtifact@2
266-
# displayName: 'Download Build Artifact'
267-
# inputs:
268-
# buildType: 'current'
269-
# artifactName: $(buildArtifactName)
270-
# targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
271-
# - task: PowerShell@2
272-
# name: configureWinRM
273-
# displayName: 'Configure WinRM'
274-
# inputs:
275-
# targetType: 'inline'
276-
# script: 'winrm quickconfig -quiet'
277-
# pwsh: false
278-
# - powershell: |
279-
# Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
280-
# # Make sure to keep SQLPS so that Invoke-SqlCmd is available.
281-
# Remove-PowerShellModuleFromCI -Name @('SqlServer')
282-
# Remove-Module -Name CommonTestHelper
283-
# name: cleanCIWorker
284-
# displayName: 'Clean CI worker'
285-
# - powershell: |
286-
# ./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
287-
# # Run the integration tests in a specific group order.
288-
# # Group 1
289-
# 'tests/Integration/DSC_SqlSetup.Integration.Tests.ps1'
290-
# # Group 2
291-
# 'tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1'
292-
# 'tests/Integration/DSC_SqlLogin.Integration.Tests.ps1'
293-
# 'tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1'
294-
# 'tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1'
295-
# 'tests/Integration/DSC_SqlRSSetup.Integration.Tests.ps1'
296-
# 'tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1'
297-
# 'tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1'
298-
# 'tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1'
299-
# 'tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1'
300-
# 'tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1'
301-
# 'tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1'
302-
# 'tests/Integration/DSC_SqlTraceFlag.Integration.Tests.ps1'
303-
# # Group 3
304-
# 'tests/Integration/DSC_SqlRole.Integration.Tests.ps1'
305-
# 'tests/Integration/DSC_SqlRS_Default.Integration.Tests.ps1'
306-
# 'tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1'
307-
# 'tests/Integration/DSC_SqlReplication.Integration.Tests.ps1'
308-
# 'tests/Integration/DSC_SqlAudit.Integration.Tests.ps1'
309-
# # Group 4
310-
# 'tests/Integration/DSC_SqlScript.Integration.Tests.ps1'
311-
# 'tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1'
312-
# 'tests/Integration/DSC_SqlPermission.Integration.Tests.ps1'
313-
# 'tests/Integration/DSC_SqlWindowsFirewall.Integration.Tests.ps1'
314-
# # Group 5
315-
# 'tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1'
316-
# 'tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1'
317-
# 'tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1'
318-
# # Group 6 (tests makes changes that could make SQL Server to loose connectivity)
319-
# 'tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1'
320-
# 'tests/Integration/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1'
321-
# )
322-
# name: test
323-
# displayName: 'Run Integration Test'
324-
# - task: PublishTestResults@2
325-
# displayName: 'Publish Test Results'
326-
# condition: succeededOrFailed()
327-
# inputs:
328-
# testResultsFormat: 'NUnit'
329-
# testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
330-
# testRunTitle: 'Integration (dbatools) ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
242+
- job: Test_Integration_dbatools
243+
displayName: 'Integration (dbatools)'
244+
dependsOn: Test_Integration
245+
strategy:
246+
matrix:
247+
SQL2016_WIN2022:
248+
JOB_VMIMAGE: 'windows-2022'
249+
TEST_CONFIGURATION: 'Integration_SQL2016'
250+
SQL2017_WIN2022:
251+
JOB_VMIMAGE: 'windows-2022'
252+
TEST_CONFIGURATION: 'Integration_SQL2017'
253+
SQL2019_WIN2022:
254+
JOB_VMIMAGE: 'windows-2022'
255+
TEST_CONFIGURATION: 'Integration_SQL2019'
256+
SQL2022_WIN2022:
257+
JOB_VMIMAGE: 'windows-2022'
258+
TEST_CONFIGURATION: 'Integration_SQL2022'
259+
pool:
260+
vmImage: $(JOB_VMIMAGE)
261+
timeoutInMinutes: 0
262+
variables:
263+
SMODefaultModuleName: 'dbatools'
264+
steps:
265+
- task: DownloadPipelineArtifact@2
266+
displayName: 'Download Build Artifact'
267+
inputs:
268+
buildType: 'current'
269+
artifactName: $(buildArtifactName)
270+
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
271+
- task: PowerShell@2
272+
name: configureWinRM
273+
displayName: 'Configure WinRM'
274+
inputs:
275+
targetType: 'inline'
276+
script: 'winrm quickconfig -quiet'
277+
pwsh: false
278+
- powershell: |
279+
Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
280+
# Make sure to keep SQLPS so that Invoke-SqlCmd is available.
281+
Remove-PowerShellModuleFromCI -Name @('SqlServer')
282+
Remove-Module -Name CommonTestHelper
283+
name: cleanCIWorker
284+
displayName: 'Clean CI worker'
285+
- powershell: |
286+
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
287+
# Run the integration tests in a specific group order.
288+
# Group 1
289+
'tests/Integration/DSC_SqlSetup.Integration.Tests.ps1'
290+
# Group 2
291+
'tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1'
292+
'tests/Integration/DSC_SqlLogin.Integration.Tests.ps1'
293+
'tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1'
294+
'tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1'
295+
'tests/Integration/DSC_SqlRSSetup.Integration.Tests.ps1'
296+
'tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1'
297+
'tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1'
298+
'tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1'
299+
'tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1'
300+
'tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1'
301+
'tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1'
302+
'tests/Integration/DSC_SqlTraceFlag.Integration.Tests.ps1'
303+
# Group 3
304+
'tests/Integration/DSC_SqlRole.Integration.Tests.ps1'
305+
'tests/Integration/DSC_SqlRS_Default.Integration.Tests.ps1'
306+
'tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1'
307+
'tests/Integration/DSC_SqlReplication.Integration.Tests.ps1'
308+
'tests/Integration/DSC_SqlAudit.Integration.Tests.ps1'
309+
# Group 4
310+
'tests/Integration/DSC_SqlScript.Integration.Tests.ps1'
311+
'tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1'
312+
'tests/Integration/DSC_SqlPermission.Integration.Tests.ps1'
313+
'tests/Integration/DSC_SqlWindowsFirewall.Integration.Tests.ps1'
314+
# Group 5
315+
'tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1'
316+
'tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1'
317+
'tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1'
318+
# Group 6 (tests makes changes that could make SQL Server to loose connectivity)
319+
'tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1'
320+
'tests/Integration/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1'
321+
)
322+
name: test
323+
displayName: 'Run Integration Test'
324+
- task: PublishTestResults@2
325+
displayName: 'Publish Test Results'
326+
condition: succeededOrFailed()
327+
inputs:
328+
testResultsFormat: 'NUnit'
329+
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
330+
testRunTitle: 'Integration (dbatools) ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
331331

332332
- job: Test_Integration_RS
333333
displayName: 'Integration Reporting Services'
@@ -405,64 +405,64 @@ stages:
405405
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
406406
testRunTitle: 'Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
407407

408-
# - job: Test_Integration_RS_dbatools
409-
# displayName: 'Integration Reporting Services (dbatools)'
410-
# dependsOn: Test_Integration_RS
411-
# strategy:
412-
# matrix:
413-
# SQL2016_WIN2022:
414-
# JOB_VMIMAGE: 'windows-2022'
415-
# TEST_CONFIGURATION: 'Integration_SQL2016'
416-
# SQL2017_WIN2022:
417-
# JOB_VMIMAGE: 'windows-2022'
418-
# TEST_CONFIGURATION: 'Integration_SQL2017'
419-
# SQL2019_WIN2022:
420-
# JOB_VMIMAGE: 'windows-2022'
421-
# TEST_CONFIGURATION: 'Integration_SQL2019'
422-
# SQL2022_WIN2022:
423-
# JOB_VMIMAGE: 'windows-2022'
424-
# TEST_CONFIGURATION: 'Integration_SQL2022'
425-
# variables:
426-
# SKIP_DATABASE_ENGINE_DEFAULT_INSTANCE: true
427-
# SKIP_ANALYSIS_MULTI_INSTANCE: true
428-
# SKIP_ANALYSIS_TABULAR_INSTANCE: true
429-
# SMODefaultModuleName: 'dbatools'
430-
# pool:
431-
# vmImage: $(JOB_VMIMAGE)
432-
# timeoutInMinutes: 0
433-
# steps:
434-
# - task: DownloadPipelineArtifact@2
435-
# displayName: 'Download Build Artifact'
436-
# inputs:
437-
# buildType: 'current'
438-
# artifactName: $(buildArtifactName)
439-
# targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
440-
# - task: PowerShell@2
441-
# name: configureWinRM
442-
# displayName: 'Configure WinRM'
443-
# inputs:
444-
# targetType: 'inline'
445-
# script: 'winrm quickconfig -quiet'
446-
# pwsh: false
447-
# - powershell: |
448-
# ./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
449-
# # Run the integration tests in a specific group order.
450-
# # Group 1
451-
# 'tests/Integration/DSC_SqlSetup.Integration.Tests.ps1'
452-
# # Group 2
453-
# 'tests/Integration/DSC_SqlRSSetup.Integration.Tests.ps1'
454-
# # Group 3
455-
# 'tests/Integration/DSC_SqlRS.Integration.Tests.ps1'
456-
# )
457-
# name: test
458-
# displayName: 'Run Reporting Services Integration Test'
459-
# - task: PublishTestResults@2
460-
# displayName: 'Publish Test Results'
461-
# condition: succeededOrFailed()
462-
# inputs:
463-
# testResultsFormat: 'NUnit'
464-
# testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
465-
# testRunTitle: 'Integration RS (dbatools) ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
408+
- job: Test_Integration_RS_dbatools
409+
displayName: 'Integration Reporting Services (dbatools)'
410+
dependsOn: Test_Integration_RS
411+
strategy:
412+
matrix:
413+
SQL2016_WIN2022:
414+
JOB_VMIMAGE: 'windows-2022'
415+
TEST_CONFIGURATION: 'Integration_SQL2016'
416+
SQL2017_WIN2022:
417+
JOB_VMIMAGE: 'windows-2022'
418+
TEST_CONFIGURATION: 'Integration_SQL2017'
419+
SQL2019_WIN2022:
420+
JOB_VMIMAGE: 'windows-2022'
421+
TEST_CONFIGURATION: 'Integration_SQL2019'
422+
SQL2022_WIN2022:
423+
JOB_VMIMAGE: 'windows-2022'
424+
TEST_CONFIGURATION: 'Integration_SQL2022'
425+
variables:
426+
SKIP_DATABASE_ENGINE_DEFAULT_INSTANCE: true
427+
SKIP_ANALYSIS_MULTI_INSTANCE: true
428+
SKIP_ANALYSIS_TABULAR_INSTANCE: true
429+
SMODefaultModuleName: 'dbatools'
430+
pool:
431+
vmImage: $(JOB_VMIMAGE)
432+
timeoutInMinutes: 0
433+
steps:
434+
- task: DownloadPipelineArtifact@2
435+
displayName: 'Download Build Artifact'
436+
inputs:
437+
buildType: 'current'
438+
artifactName: $(buildArtifactName)
439+
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
440+
- task: PowerShell@2
441+
name: configureWinRM
442+
displayName: 'Configure WinRM'
443+
inputs:
444+
targetType: 'inline'
445+
script: 'winrm quickconfig -quiet'
446+
pwsh: false
447+
- powershell: |
448+
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
449+
# Run the integration tests in a specific group order.
450+
# Group 1
451+
'tests/Integration/DSC_SqlSetup.Integration.Tests.ps1'
452+
# Group 2
453+
'tests/Integration/DSC_SqlRSSetup.Integration.Tests.ps1'
454+
# Group 3
455+
'tests/Integration/DSC_SqlRS.Integration.Tests.ps1'
456+
)
457+
name: test
458+
displayName: 'Run Reporting Services Integration Test'
459+
- task: PublishTestResults@2
460+
displayName: 'Publish Test Results'
461+
condition: succeededOrFailed()
462+
inputs:
463+
testResultsFormat: 'NUnit'
464+
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
465+
testRunTitle: 'Integration RS (dbatools) ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
466466

467467
- job: Code_Coverage
468468
displayName: 'Publish Code Coverage'

tests/Integration/DSC_SqlSetup.config.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ else
3737
SupportedFeatures = 'SQLENGINE,REPLICATION'
3838

3939
SqlServerModuleVersion = '22.0.59'
40-
DbatoolsModuleVersion = '2.0.0-preview7'
40+
DbatoolsModuleVersion = '2.0.1'
4141
}
4242
}
4343

@@ -55,7 +55,7 @@ else
5555
SupportedFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK'
5656

5757
SqlServerModuleVersion = '21.1.18256'
58-
DbatoolsModuleVersion = '2.0.0-preview7'
58+
DbatoolsModuleVersion = '2.0.1'
5959
}
6060
}
6161

@@ -69,7 +69,7 @@ else
6969
SupportedFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK'
7070

7171
SqlServerModuleVersion = '21.1.18256'
72-
DbatoolsModuleVersion = '2.0.0-preview7'
72+
DbatoolsModuleVersion = '2.0.1'
7373
}
7474
}
7575

@@ -83,7 +83,7 @@ else
8383
SupportedFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK'
8484

8585
SqlServerModuleVersion = '21.1.18256'
86-
DbatoolsModuleVersion = '2.0.0-preview7'
86+
DbatoolsModuleVersion = '2.0.1'
8787
}
8888
}
8989
}

0 commit comments

Comments
 (0)