From 6b4d58e1b77bb7068cf9d8d30540e18d4fca1601 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Thu, 24 Nov 2022 14:46:57 +0100 Subject: [PATCH 01/14] SqlServerDsc: Integration tests on SQL Server 2022 --- CHANGELOG.md | 1 + azure-pipelines.yml | 6 ++++++ .../Integration/DSC_SqlSetup.Integration.Tests.ps1 | 10 ++++++++-- tests/Integration/DSC_SqlSetup.config.ps1 | 13 +++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d782551..9a50de0f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ 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. ### 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/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 index a0b470364..6f8982ae6 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 { diff --git a/tests/Integration/DSC_SqlSetup.config.ps1 b/tests/Integration/DSC_SqlSetup.config.ps1 index ea1849abc..8b196cb6c 100644 --- a/tests/Integration/DSC_SqlSetup.config.ps1 +++ b/tests/Integration/DSC_SqlSetup.config.ps1 @@ -23,6 +23,19 @@ 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' + } + } + '150' { $versionSpecificData = @{ From 663da39d37bba5c695fef616f95f7b07dfb6feec Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Thu, 24 Nov 2022 15:13:40 +0100 Subject: [PATCH 02/14] Fix tag on integrations tests --- tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlAudit.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 | 2 +- .../DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1 | 2 +- .../DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 | 2 +- .../Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlLogin.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlPermission.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlReplication.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlRole.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlScript.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 | 2 +- tests/Integration/DSC_SqlWindowsFirewall.Integration.Tests.ps1 | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) 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..f48805214 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..086552694 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..336e768c7 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..f8851aa3e 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 6f8982ae6..78ed0179e 100644 --- a/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 @@ -160,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" } 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" } From 3b85e82c2e1da5473c53bfd058b22e1d248bf904 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Thu, 24 Nov 2022 15:42:45 +0100 Subject: [PATCH 03/14] Fix SQL version specific features --- tests/Integration/DSC_SqlSetup.config.ps1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/Integration/DSC_SqlSetup.config.ps1 b/tests/Integration/DSC_SqlSetup.config.ps1 index 8b196cb6c..e4491b269 100644 --- a/tests/Integration/DSC_SqlSetup.config.ps1 +++ b/tests/Integration/DSC_SqlSetup.config.ps1 @@ -33,6 +33,9 @@ else # 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' } } @@ -46,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' } } @@ -55,6 +60,8 @@ else SqlServerInstanceIdPrefix = 'MSSQL14' AnalysisServiceInstanceIdPrefix = 'MSAS14' IsoImageName = 'SQL2017.iso' + + SupportedFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK' } } @@ -64,6 +71,8 @@ else SqlServerInstanceIdPrefix = 'MSSQL13' AnalysisServiceInstanceIdPrefix = 'MSAS13' IsoImageName = 'SQL2016.iso' + + SupportedFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK' } } } @@ -82,7 +91,7 @@ else # Database Engine properties. DatabaseEngineNamedInstanceName = 'DSCSQLTEST' - DatabaseEngineNamedInstanceFeatures = 'SQLENGINE,REPLICATION,CONN,BC,SDK' + DatabaseEngineNamedInstanceFeatures = $versionSpecificData.SupportedFeatures <# Analysis Services Multi-dimensional properties. From c940d91ddc064cbd6bf5faccba5aced177ed9f5e Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Thu, 24 Nov 2022 16:02:17 +0100 Subject: [PATCH 04/14] Fix features --- tests/Integration/DSC_SqlSetup.config.ps1 | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/tests/Integration/DSC_SqlSetup.config.ps1 b/tests/Integration/DSC_SqlSetup.config.ps1 index e4491b269..6bb636467 100644 --- a/tests/Integration/DSC_SqlSetup.config.ps1 +++ b/tests/Integration/DSC_SqlSetup.config.ps1 @@ -95,35 +95,23 @@ else <# 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' From 68f69a7f908efe947d2685022aabd59a730ad4a0 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Fri, 25 Nov 2022 08:35:51 +0100 Subject: [PATCH 05/14] Fix tests for analysis services --- .../DSC_SqlSetup.Integration.Tests.ps1 | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 index 78ed0179e..73e853960 100644 --- a/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 @@ -642,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 @@ -794,7 +808,7 @@ 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 + $resourceCurrentState.Features | Should -Be 'AS,CONN,BC,SDK' $resourceCurrentState.ForceReboot | Should -BeNullOrEmpty $resourceCurrentState.FTSvcAccount | Should -BeNullOrEmpty $resourceCurrentState.FTSvcAccountUsername | Should -BeNullOrEmpty From ee2e7df388bfc4106eae05de202a6a0d9a54cdc4 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Fri, 25 Nov 2022 09:54:13 +0100 Subject: [PATCH 06/14] Fix InstalledSharedDir for major version 16 --- source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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' From da8b2e477248f48f947fafaf5921363f179eae31 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Fri, 25 Nov 2022 11:02:43 +0100 Subject: [PATCH 07/14] Fix integration tests --- .../DSC_SqlDatabase.Integration.Tests.ps1 | 17 +++++++++ tests/Integration/DSC_SqlDatabase.config.ps1 | 37 ++++++++++++++++++- .../DSC_SqlSetup.Integration.Tests.ps1 | 16 +++++++- 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 index accaec5e9..5bb3b7d21 100644 --- a/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 @@ -28,6 +28,23 @@ BeforeAll { -ResourceType 'Mof' ` -TestType 'Integration' + if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022') + { + $script:sqlVersion = '160' + } + elseif (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2019') + { + $script:sqlVersion = '150' + } + elseif (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2017') + { + $script:sqlVersion = '140' + } + else + { + $script:sqlVersion = '130' + } + $configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" . $configFile } diff --git a/tests/Integration/DSC_SqlDatabase.config.ps1 b/tests/Integration/DSC_SqlDatabase.config.ps1 index 77d455b47..42f6a0586 100644 --- a/tests/Integration/DSC_SqlDatabase.config.ps1 +++ b/tests/Integration/DSC_SqlDatabase.config.ps1 @@ -13,6 +13,41 @@ if (Test-Path -Path $configFile) } else { + <# + The variable $script:sqlVersion is set in the integration script file, + which is available once this script is dot-sourced. + #> + switch ($script:sqlVersion) + { + '160' + { + $versionSpecificData = @{ + CompatibilityLevel = 'Version150' + } + } + + '150' + { + $versionSpecificData = @{ + CompatibilityLevel = 'Version120' + } + } + + '140' + { + $versionSpecificData = @{ + CompatibilityLevel = 'Version120' + } + } + + '130' + { + $versionSpecificData = @{ + CompatibilityLevel = 'Version120' + } + } + } + $ConfigurationData = @{ AllNodes = @( @{ @@ -32,7 +67,7 @@ else DatabaseName5 = 'Database5' Collation = 'SQL_Latin1_General_Pref_CP850_CI_AS' - CompatibilityLevel = 'Version120' + CompatibilityLevel = $versionSpecificData.CompatibilityLevel RecoveryModel = 'Simple' OwnerName = 'sa' } diff --git a/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 index 73e853960..af71a7fac 100644 --- a/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1 @@ -808,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 'AS,CONN,BC,SDK' + + 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 From b7dba14adfbaa597f0c1986edb62041e0858c70e Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Fri, 25 Nov 2022 11:59:30 +0100 Subject: [PATCH 08/14] Fix integration tests --- tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 index 5bb3b7d21..197812e62 100644 --- a/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 @@ -28,6 +28,8 @@ BeforeAll { -ResourceType 'Mof' ` -TestType 'Integration' + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelpers\CommonTestHelper.psm1') + if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022') { $script:sqlVersion = '160' @@ -51,6 +53,8 @@ BeforeAll { AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment + + Get-Module -Name 'CommonTestHelper' -All | Remove-Module -Force } Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { From 32785ac618c9ba5c2ad3205b55eff06bcf44c13d Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Fri, 25 Nov 2022 13:15:28 +0100 Subject: [PATCH 09/14] Fix integration tests --- .../DSC_SqlDatabase/DSC_SqlDatabase.psm1 | 1 + .../DSC_SqlDatabase.Integration.Tests.ps1 | 21 ----------- tests/Integration/DSC_SqlDatabase.config.ps1 | 37 +------------------ 3 files changed, 2 insertions(+), 57 deletions(-) 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/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 b/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 index 197812e62..accaec5e9 100644 --- a/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1 @@ -28,33 +28,12 @@ BeforeAll { -ResourceType 'Mof' ` -TestType 'Integration' - Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelpers\CommonTestHelper.psm1') - - if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022') - { - $script:sqlVersion = '160' - } - elseif (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2019') - { - $script:sqlVersion = '150' - } - elseif (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2017') - { - $script:sqlVersion = '140' - } - else - { - $script:sqlVersion = '130' - } - $configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" . $configFile } AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment - - Get-Module -Name 'CommonTestHelper' -All | Remove-Module -Force } Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { diff --git a/tests/Integration/DSC_SqlDatabase.config.ps1 b/tests/Integration/DSC_SqlDatabase.config.ps1 index 42f6a0586..77d455b47 100644 --- a/tests/Integration/DSC_SqlDatabase.config.ps1 +++ b/tests/Integration/DSC_SqlDatabase.config.ps1 @@ -13,41 +13,6 @@ if (Test-Path -Path $configFile) } else { - <# - The variable $script:sqlVersion is set in the integration script file, - which is available once this script is dot-sourced. - #> - switch ($script:sqlVersion) - { - '160' - { - $versionSpecificData = @{ - CompatibilityLevel = 'Version150' - } - } - - '150' - { - $versionSpecificData = @{ - CompatibilityLevel = 'Version120' - } - } - - '140' - { - $versionSpecificData = @{ - CompatibilityLevel = 'Version120' - } - } - - '130' - { - $versionSpecificData = @{ - CompatibilityLevel = 'Version120' - } - } - } - $ConfigurationData = @{ AllNodes = @( @{ @@ -67,7 +32,7 @@ else DatabaseName5 = 'Database5' Collation = 'SQL_Latin1_General_Pref_CP850_CI_AS' - CompatibilityLevel = $versionSpecificData.CompatibilityLevel + CompatibilityLevel = 'Version120' RecoveryModel = 'Simple' OwnerName = 'sa' } From da3e98d4e5ea99c3466737e17e5bff3d35bf0a7a Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Fri, 25 Nov 2022 15:25:43 +0100 Subject: [PATCH 10/14] Remove tests for SqlServiceAccount (issue #1800) --- tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1 b/tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1 index f8851aa3e..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', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019' <#, 'Integration_SQL2022' #>) { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } From 0ea19d5cbc0824e7f747e769f73fbbb8332f7ba7 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Fri, 25 Nov 2022 16:36:00 +0100 Subject: [PATCH 11/14] Remove SqlReplication from SQL Server 2022 (issue #1801) --- tests/Integration/DSC_SqlReplication.Integration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/DSC_SqlReplication.Integration.Tests.ps1 b/tests/Integration/DSC_SqlReplication.Integration.Tests.ps1 index 336e768c7..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', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019' <#, 'Integration_SQL2022' #>) { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } From 362fe9f06857612a61cff8ab3c9e2fdc512d3f49 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 26 Nov 2022 08:50:35 +0100 Subject: [PATCH 12/14] Remove SqlProtocol from SQL Server 2022 (issue #1802) --- tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1 b/tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1 index f48805214..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', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019' <#, 'Integration_SQL2022' #>) { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } From 3a6d505d3e0a1755b3ed6830b968e6e97194a70a Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 26 Nov 2022 09:15:35 +0100 Subject: [PATCH 13/14] Fix changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a50de0f7..83d0a8796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 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 From b9249761f2ee53cb46867c44cce3e06c5f10f577 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 26 Nov 2022 10:55:33 +0100 Subject: [PATCH 14/14] Remove SqlProtocolTcpIp from SQL Server 2022 (issue #1805) --- tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 b/tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 index 086552694..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', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019' <#, 'Integration_SQL2022' #>) { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" }