From a512effd08e67bcff9bbdabd36f69cffcd2980dd Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 26 Nov 2022 13:57:08 +0100 Subject: [PATCH] SqlServerDsc: Integration tests for SQL Server 2022 (#1803) - SqlServerDsc - Integration tests are now also run on SQL Server 2022. - SqlDatabase - Added compatibility levels for SQL Server 2022 (version 16). - SqlSetup - Paths for SQL Server 2022 are correctly returned by Get. --- CHANGELOG.md | 5 +++ azure-pipelines.yml | 6 +++ .../DSC_SqlDatabase/DSC_SqlDatabase.psm1 | 1 + .../DSC_SqlSetup/DSC_SqlSetup.psm1 | 6 +-- .../DSC_SqlAgentAlert.Integration.Tests.ps1 | 2 +- ...DSC_SqlAgentFailsafe.Integration.Tests.ps1 | 2 +- ...DSC_SqlAgentOperator.Integration.Tests.ps1 | 2 +- ...C_SqlAlwaysOnService.Integration.Tests.ps1 | 2 +- .../DSC_SqlAudit.Integration.Tests.ps1 | 2 +- .../DSC_SqlDatabase.Integration.Tests.ps1 | 2 +- ...abaseDefaultLocation.Integration.Tests.ps1 | 2 +- .../DSC_SqlDatabaseMail.Integration.Tests.ps1 | 2 +- ...baseObjectPermission.Integration.Tests.ps1 | 2 +- ...qlDatabasePermission.Integration.Tests.ps1 | 2 +- .../DSC_SqlDatabaseUser.Integration.Tests.ps1 | 2 +- .../DSC_SqlEndpoint.Integration.Tests.ps1 | 2 +- .../DSC_SqlLogin.Integration.Tests.ps1 | 2 +- .../DSC_SqlPermission.Integration.Tests.ps1 | 2 +- .../DSC_SqlProtocol.Integration.Tests.ps1 | 2 +- ...DSC_SqlProtocolTcpIp.Integration.Tests.ps1 | 2 +- .../DSC_SqlReplication.Integration.Tests.ps1 | 2 +- .../DSC_SqlRole.Integration.Tests.ps1 | 2 +- .../DSC_SqlScript.Integration.Tests.ps1 | 2 +- .../DSC_SqlScriptQuery.Integration.Tests.ps1 | 2 +- ..._SqlSecureConnection.Integration.Tests.ps1 | 2 +- ...SC_SqlServiceAccount.Integration.Tests.ps1 | 2 +- .../DSC_SqlSetup.Integration.Tests.ps1 | 44 ++++++++++++++++--- tests/Integration/DSC_SqlSetup.config.ps1 | 42 +++++++++++------- ...C_SqlWindowsFirewall.Integration.Tests.ps1 | 2 +- 29 files changed, 103 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d782551..83d0a8796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - New GitHub issue templates for proposing new public commands, proposing an enhancement to an existing command, or having a problem with an existing command. + - Integration tests are now also run on SQL Server 2022. +- SqlDatabase + - Added compatibility levels for SQL Server 2022 (major version 16). +- SqlSetup + - Paths for SQL Server 2022 are correctly returned by Get. ### Changed diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 844d7d014..72f5aecd8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -156,6 +156,12 @@ stages: SQL2019_WIN2022: JOB_VMIMAGE: 'windows-2022' TEST_CONFIGURATION: 'Integration_SQL2019' + SQL2022_WIN2019: + JOB_VMIMAGE: 'windows-2019' + TEST_CONFIGURATION: 'Integration_SQL2022' + SQL2022_WIN2022: + JOB_VMIMAGE: 'windows-2022' + TEST_CONFIGURATION: 'Integration_SQL2022' pool: vmImage: $(JOB_VMIMAGE) timeoutInMinutes: 0 diff --git a/source/DSCResources/DSC_SqlDatabase/DSC_SqlDatabase.psm1 b/source/DSCResources/DSC_SqlDatabase/DSC_SqlDatabase.psm1 index 5b8ccbcbe..6bc7fb3bd 100644 --- a/source/DSCResources/DSC_SqlDatabase/DSC_SqlDatabase.psm1 +++ b/source/DSCResources/DSC_SqlDatabase/DSC_SqlDatabase.psm1 @@ -15,6 +15,7 @@ $script:supportedCompatibilityLevels = @{ 13 = @('Version100', 'Version110', 'Version120', 'Version130') 14 = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140') 15 = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150') + 16 = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160') } <# diff --git a/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 b/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 index 80e0bc43e..a9f16d336 100644 --- a/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 +++ b/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 @@ -987,7 +987,7 @@ function Set-TargetResource foreach ($feature in $featuresArray) { - if (($sqlVersion -in ('13', '14', '15')) -and ($feature -in ('ADV_SSMS', 'SSMS'))) + if (($sqlVersion -in ('13', '14', '15', '16')) -and ($feature -in ('ADV_SSMS', 'SSMS'))) { $errorMessage = $script:localizedData.FeatureNotSupported -f $feature New-InvalidOperationException -Message $errorMessage @@ -1009,7 +1009,7 @@ function Set-TargetResource # If SQL shared components already installed, clear InstallShared*Dir variables switch ($sqlVersion) { - { $_ -in ('10', '11', '12', '13', '14', '15') } + { $_ -in ('10', '11', '12', '13', '14', '15', '16') } { if ((Get-Variable -Name 'InstallSharedDir' -ErrorAction SilentlyContinue) -and (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\FEE2E540D20152D4597229B6CFBC0A69' -ErrorAction SilentlyContinue)) { @@ -3211,7 +3211,7 @@ function Get-SqlSharedPaths switch ($SqlServerMajorVersion) { - { $_ -in ('10', '11', '12', '13', '14', '15') } + { $_ -in ('10', '11', '12', '13', '14', '15', '16') } { $registryKeySharedDir = 'FEE2E540D20152D4597229B6CFBC0A69' $registryKeySharedWOWDir = 'A79497A344129F64CA7D69C56F5DD8B4' diff --git a/tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1 b/tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1 index 49718c71b..3764678fb 100644 --- a/tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1 b/tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1 index 3d4f78b7a..884912655 100644 --- a/tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1 b/tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1 index 07b0123e7..7b3efaea0 100644 --- a/tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1 b/tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1 index fa33eb18b..2dc9ddd46 100644 --- a/tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1 @@ -54,7 +54,7 @@ AfterAll { <# TODO: This has temporarily been disabled as the test is not passing. - Tags should be changed to @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') + Tags should be changed to @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') #> Describe "$($script:dscResourceName)_Integration" -Tag 'Skip' { BeforeAll { diff --git a/tests/Integration/DSC_SqlAudit.Integration.Tests.ps1 b/tests/Integration/DSC_SqlAudit.Integration.Tests.ps1 index 1a8801404..8e152cad6 100644 --- a/tests/Integration/DSC_SqlAudit.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlAudit.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 index 767d62126..accaec5e9 100644 --- a/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 index bbed107d2..bc778c8fa 100644 --- a/tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1 index 082c80024..b337ece9c 100644 --- a/tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 index d3f963aac..fa66ffa03 100644 --- a/tests/Integration/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1 index 66454bdef..7e73cf826 100644 --- a/tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1 index 3f3acdb30..6a226f6b7 100644 --- a/tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1 b/tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1 index 71834bb80..2c50124a1 100644 --- a/tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlLogin.Integration.Tests.ps1 b/tests/Integration/DSC_SqlLogin.Integration.Tests.ps1 index 665237f99..7cb757d30 100644 --- a/tests/Integration/DSC_SqlLogin.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlLogin.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlPermission.Integration.Tests.ps1 b/tests/Integration/DSC_SqlPermission.Integration.Tests.ps1 index 04ca4ffaf..094625243 100644 --- a/tests/Integration/DSC_SqlPermission.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlPermission.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1 b/tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1 index 3b4146e03..ccb6006c9 100644 --- a/tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019' <#, 'Integration_SQL2022' #>) { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 b/tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 index 5d5899935..e76f7a074 100644 --- a/tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019' <#, 'Integration_SQL2022' #>) { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlReplication.Integration.Tests.ps1 b/tests/Integration/DSC_SqlReplication.Integration.Tests.ps1 index d78457ef5..aad2840fe 100644 --- a/tests/Integration/DSC_SqlReplication.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlReplication.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019' <#, 'Integration_SQL2022' #>) { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlRole.Integration.Tests.ps1 b/tests/Integration/DSC_SqlRole.Integration.Tests.ps1 index 24ee6816f..cf96c4102 100644 --- a/tests/Integration/DSC_SqlRole.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlRole.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlScript.Integration.Tests.ps1 b/tests/Integration/DSC_SqlScript.Integration.Tests.ps1 index b86c8a1f8..daa3349d3 100644 --- a/tests/Integration/DSC_SqlScript.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlScript.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1 b/tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1 index b0b8277d7..ea1cc5998 100644 --- a/tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1 b/tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1 index 648da2625..9987a9149 100644 --- a/tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Get-Module -Name 'CommonTestHelper' -All | Remove-Module -Force } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1 b/tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1 index ac7f8cfee..00c8817c5 100644 --- a/tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1 @@ -45,7 +45,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019' <#, 'Integration_SQL2022' #>) { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 index a0b470364..af71a7fac 100644 --- a/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 @@ -71,8 +71,15 @@ BeforeAll { This is used in both the configuration file and in this script file to run the correct tests depending of what version of SQL Server is being tested in the current job. + + The actual download URL can easiest be found in the browser download history. #> - if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2019') + if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022') + { + $script:sqlVersion = '160' + $script:mockSourceDownloadExeUrl = 'https://download.microsoft.com/download/c/c/9/cc9c6797-383c-4b24-8920-dc057c1de9d3/SQL2022-SSEI-Dev.exe' + } + elseif (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2019') { $script:sqlVersion = '150' $script:mockSourceDownloadExeUrl = 'https://download.microsoft.com/download/d/a/2/da259851-b941-459d-989c-54a18a5d44dd/SQL2019-SSEI-Dev.exe' @@ -119,7 +126,6 @@ BeforeAll { # Rename the ISO to maintain consistency of names within integration tests Rename-Item -Path $ConfigurationData.AllNodes.DownloadIsoPath ` -NewName $(Split-Path -Path $ConfigurationData.AllNodes.ImagePath -Leaf) | Out-Null - } else { @@ -154,7 +160,7 @@ AfterAll { Get-Module -Name 'CommonTestHelper' -All | Remove-Module -Force } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } @@ -636,7 +642,21 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', $resourceCurrentState.FailoverClusterGroupName | Should -BeNullOrEmpty $resourceCurrentState.FailoverClusterIPAddress | Should -BeNullOrEmpty $resourceCurrentState.FailoverClusterNetworkName | Should -BeNullOrEmpty - $resourceCurrentState.Features | Should -Be $ConfigurationData.AllNodes.AnalysisServicesMultiFeatures + + if ($script:sqlVersion -in (160)) + { + <# + The features CONN, BC, SDK is no longer supported after SQL Server 2019. + Thus they are not installed with the Database Engine instance DSCSQLTEST + in prior test, so this test do not find them already installed. + #> + $resourceCurrentState.Features | Should -Be 'AS' + } + else + { + $resourceCurrentState.Features | Should -Be 'AS,CONN,BC,SDK' + } + $resourceCurrentState.ForceReboot | Should -BeNullOrEmpty $resourceCurrentState.FTSvcAccount | Should -BeNullOrEmpty $resourceCurrentState.FTSvcAccountUsername | Should -BeNullOrEmpty @@ -788,7 +808,21 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', $resourceCurrentState.FailoverClusterGroupName | Should -BeNullOrEmpty $resourceCurrentState.FailoverClusterIPAddress | Should -BeNullOrEmpty $resourceCurrentState.FailoverClusterNetworkName | Should -BeNullOrEmpty - $resourceCurrentState.Features | Should -Be $ConfigurationData.AllNodes.AnalysisServicesTabularFeatures + + if ($script:sqlVersion -in (160)) + { + <# + The features CONN, BC, SDK is no longer supported after SQL Server 2019. + Thus they are not installed with the Database Engine instance DSCSQLTEST + in prior test, so this test do not find them already installed. + #> + $resourceCurrentState.Features | Should -Be 'AS' + } + else + { + $resourceCurrentState.Features | Should -Be 'AS,CONN,BC,SDK' + } + $resourceCurrentState.ForceReboot | Should -BeNullOrEmpty $resourceCurrentState.FTSvcAccount | Should -BeNullOrEmpty $resourceCurrentState.FTSvcAccountUsername | Should -BeNullOrEmpty diff --git a/tests/Integration/DSC_SqlSetup.config.ps1 b/tests/Integration/DSC_SqlSetup.config.ps1 index ea1849abc..6bb636467 100644 --- a/tests/Integration/DSC_SqlSetup.config.ps1 +++ b/tests/Integration/DSC_SqlSetup.config.ps1 @@ -23,6 +23,22 @@ else #> switch ($script:sqlVersion) { + '160' + { + $versionSpecificData = @{ + SqlServerInstanceIdPrefix = 'MSSQL16' + AnalysisServiceInstanceIdPrefix = 'MSAS16' + IsoImageName = 'SQL2022.iso' + + # Additional variables required as ISO is downloaded via additional EXE + DownloadExeName = 'SQL2022_Download.exe' + DownloadIsoName = 'SQLServer2022-x64-ENU-Dev.iso' + + # Features CONN, BC, SDK, SNAC_SDK, DREPLAY_CLT, DREPLAY_CTLR are no longer supported in 2022. + SupportedFeatures = 'SQLENGINE,REPLICATION' + } + } + '150' { $versionSpecificData = @{ @@ -33,6 +49,8 @@ else # Additional variables required as ISO is downloaded via additional EXE DownloadExeName = 'SQL2019_Download.exe' DownloadIsoName = 'SQLServer2019-x64-ENU-Dev.iso' + + SupportedFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK' } } @@ -42,6 +60,8 @@ else SqlServerInstanceIdPrefix = 'MSSQL14' AnalysisServiceInstanceIdPrefix = 'MSAS14' IsoImageName = 'SQL2017.iso' + + SupportedFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK' } } @@ -51,6 +71,8 @@ else SqlServerInstanceIdPrefix = 'MSSQL13' AnalysisServiceInstanceIdPrefix = 'MSAS13' IsoImageName = 'SQL2016.iso' + + SupportedFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK' } } } @@ -69,39 +91,27 @@ else # Database Engine properties. DatabaseEngineNamedInstanceName = 'DSCSQLTEST' - DatabaseEngineNamedInstanceFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK' + DatabaseEngineNamedInstanceFeatures = $versionSpecificData.SupportedFeatures <# Analysis Services Multi-dimensional properties. - The features CONN,BC,SDK is installed with the DSCSQLTEST so those - features will found for DSCTABULAR instance as well. - The features is added here so the same property can be used to - evaluate the result in the test. #> AnalysisServicesMultiInstanceName = 'DSCMULTI' - AnalysisServicesMultiFeatures = 'AS,CONN,BC,SDK' + AnalysisServicesMultiFeatures = 'AS' AnalysisServicesMultiServerMode = 'MULTIDIMENSIONAL' <# Analysis Services Tabular properties. - The features CONN,BC,SDK is installed with the DSCSQLTEST so those - features will found for DSCTABULAR instance as well. - The features is added here so the same property can be used to - evaluate the result in the test. #> AnalysisServicesTabularInstanceName = 'DSCTABULAR' - AnalysisServicesTabularFeatures = 'AS,CONN,BC,SDK' + AnalysisServicesTabularFeatures = 'AS' AnalysisServicesTabularServerMode = 'TABULAR' <# Database Engine default instance properties. - The features CONN,BC,SDK is installed with the DSCSQLTEST so those - features will found for DSCTABULAR instance as well. - The features is added here so the same property can be used to - evaluate the result in the test. #> DatabaseEngineDefaultInstanceName = 'MSSQLSERVER' - DatabaseEngineDefaultInstanceFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK' + DatabaseEngineDefaultInstanceFeatures = $versionSpecificData.SupportedFeatures # General SqlSetup properties Collation = 'Finnish_Swedish_CI_AS' diff --git a/tests/Integration/DSC_SqlWindowsFirewall.Integration.Tests.ps1 b/tests/Integration/DSC_SqlWindowsFirewall.Integration.Tests.ps1 index e55e7e323..d57eb50fa 100644 --- a/tests/Integration/DSC_SqlWindowsFirewall.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlWindowsFirewall.Integration.Tests.ps1 @@ -36,7 +36,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" }