diff --git a/CHANGELOG.md b/CHANGELOG.md index 99332db0c..3bd294027 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- SqlServerDsc + - Refactor integration tests for _SQL Server Reporting Services_ and _Power BI_ + _Report Server_ ([issue #2431](https://github.com/dsccommunity/SqlServerDsc/issues/2431)). + ## [17.4.0] - 2026-01-19 ### Added diff --git a/tests/Integration/Commands/Add-SqlDscRSUrlReservation.Integration.Tests.ps1 b/tests/Integration/Commands/Add-SqlDscRSUrlReservation.Integration.Tests.ps1 index 0036d428b..2bcaf0d5a 100644 --- a/tests/Integration/Commands/Add-SqlDscRSUrlReservation.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Add-SqlDscRSUrlReservation.Integration.Tests.ps1 @@ -36,9 +36,6 @@ Describe 'Add-SqlDscRSUrlReservation' { BeforeAll { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - # Store original URL reservations to restore later - $script:originalReservations = $script:configuration | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' - # Use a unique port for testing to avoid conflicts $script:testPort = 18080 $script:testUrl = "http://+:$script:testPort" diff --git a/tests/Integration/Commands/Disable-SqlDscRsSecureConnection.Integration.Tests.ps1 b/tests/Integration/Commands/Disable-SqlDscRsSecureConnection.Integration.Tests.ps1 index 29096b03f..447c592c6 100644 --- a/tests/Integration/Commands/Disable-SqlDscRsSecureConnection.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Disable-SqlDscRsSecureConnection.Integration.Tests.ps1 @@ -33,28 +33,7 @@ BeforeAll { Describe 'Disable-SqlDscRsSecureConnection' { Context 'When disabling secure connection for SQL Server Reporting Services' -Tag @('Integration_SQL2017_RS') { - BeforeAll { - $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $script:originalLevel = $script:configuration.SecureConnectionLevel - } - - AfterAll { - # Restore the original secure connection level - $restoreConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - if ($script:originalLevel -eq 0) - { - $restoreConfig | Disable-SqlDscRsSecureConnection -Force - } - else - { - $restoreConfig | Enable-SqlDscRsSecureConnection -Force - } - } - It 'Should disable secure connection using pipeline' { - # First ensure secure connection is enabled - $script:configuration | Enable-SqlDscRsSecureConnection -Force - # Disable secure connection $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $config | Disable-SqlDscRsSecureConnection -Force @@ -63,44 +42,10 @@ Describe 'Disable-SqlDscRsSecureConnection' { $verifyConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $verifyConfig.SecureConnectionLevel | Should -Be 0 } - - It 'Should return configuration when using PassThru' { - # First enable TLS - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Enable-SqlDscRsSecureConnection -Force - - # Disable with PassThru - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Disable-SqlDscRsSecureConnection -Force -PassThru - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When disabling secure connection for SQL Server Reporting Services' -Tag @('Integration_SQL2019_RS') { - BeforeAll { - $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $script:originalLevel = $script:configuration.SecureConnectionLevel - } - - AfterAll { - # Restore the original secure connection level - $restoreConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - if ($script:originalLevel -eq 0) - { - $restoreConfig | Disable-SqlDscRsSecureConnection -Force - } - else - { - $restoreConfig | Enable-SqlDscRsSecureConnection -Force - } - } - It 'Should disable secure connection using pipeline' { - # First ensure secure connection is enabled - $script:configuration | Enable-SqlDscRsSecureConnection -Force - # Disable secure connection $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $config | Disable-SqlDscRsSecureConnection -Force @@ -109,44 +54,10 @@ Describe 'Disable-SqlDscRsSecureConnection' { $verifyConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $verifyConfig.SecureConnectionLevel | Should -Be 0 } - - It 'Should return configuration when using PassThru' { - # First enable TLS - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Enable-SqlDscRsSecureConnection -Force - - # Disable with PassThru - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Disable-SqlDscRsSecureConnection -Force -PassThru - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When disabling secure connection for SQL Server Reporting Services' -Tag @('Integration_SQL2022_RS') { - BeforeAll { - $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $script:originalLevel = $script:configuration.SecureConnectionLevel - } - - AfterAll { - # Restore the original secure connection level - $restoreConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - if ($script:originalLevel -eq 0) - { - $restoreConfig | Disable-SqlDscRsSecureConnection -Force - } - else - { - $restoreConfig | Enable-SqlDscRsSecureConnection -Force - } - } - It 'Should disable secure connection using pipeline' { - # First ensure secure connection is enabled - $script:configuration | Enable-SqlDscRsSecureConnection -Force - # Disable secure connection $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $config | Disable-SqlDscRsSecureConnection -Force @@ -155,44 +66,10 @@ Describe 'Disable-SqlDscRsSecureConnection' { $verifyConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $verifyConfig.SecureConnectionLevel | Should -Be 0 } - - It 'Should return configuration when using PassThru' { - # First enable TLS - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Enable-SqlDscRsSecureConnection -Force - - # Disable with PassThru - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Disable-SqlDscRsSecureConnection -Force -PassThru - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When disabling secure connection for Power BI Report Server' -Tag @('Integration_PowerBI') { - BeforeAll { - $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - $script:originalLevel = $script:configuration.SecureConnectionLevel - } - - AfterAll { - # Restore the original secure connection level - $restoreConfig = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - if ($script:originalLevel -eq 0) - { - $restoreConfig | Disable-SqlDscRsSecureConnection -Force - } - else - { - $restoreConfig | Enable-SqlDscRsSecureConnection -Force - } - } - It 'Should disable secure connection for PBIRS using pipeline' { - # First ensure secure connection is enabled - $script:configuration | Enable-SqlDscRsSecureConnection -Force - # Disable secure connection $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' $config | Disable-SqlDscRsSecureConnection -Force @@ -201,18 +78,5 @@ Describe 'Disable-SqlDscRsSecureConnection' { $verifyConfig = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' $verifyConfig.SecureConnectionLevel | Should -Be 0 } - - It 'Should return configuration when using PassThru' { - # First enable TLS - $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - $config | Enable-SqlDscRsSecureConnection -Force - - # Disable with PassThru - $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - $result = $config | Disable-SqlDscRsSecureConnection -Force -PassThru - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'PBIRS' - } } } diff --git a/tests/Integration/Commands/Enable-SqlDscRsSecureConnection.Integration.Tests.ps1 b/tests/Integration/Commands/Enable-SqlDscRsSecureConnection.Integration.Tests.ps1 index 6bcd47cca..43134c326 100644 --- a/tests/Integration/Commands/Enable-SqlDscRsSecureConnection.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Enable-SqlDscRsSecureConnection.Integration.Tests.ps1 @@ -33,28 +33,7 @@ BeforeAll { Describe 'Enable-SqlDscRsSecureConnection' { Context 'When enabling secure connection for SQL Server Reporting Services' -Tag @('Integration_SQL2017_RS') { - BeforeAll { - $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $script:originalLevel = $script:configuration.SecureConnectionLevel - } - - AfterAll { - # Restore the original secure connection level - $restoreConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - if ($script:originalLevel -eq 0) - { - $restoreConfig | Disable-SqlDscRsSecureConnection -Force - } - else - { - $restoreConfig | Enable-SqlDscRsSecureConnection -Force - } - } - It 'Should enable secure connection using pipeline' { - # First ensure secure connection is disabled - $script:configuration | Disable-SqlDscRsSecureConnection -Force - # Enable secure connection $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $config | Enable-SqlDscRsSecureConnection -Force @@ -63,39 +42,10 @@ Describe 'Enable-SqlDscRsSecureConnection' { $verifyConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $verifyConfig.SecureConnectionLevel | Should -BeGreaterOrEqual 1 } - - It 'Should return configuration when using PassThru' { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Enable-SqlDscRsSecureConnection -Force -PassThru - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When enabling secure connection for SQL Server Reporting Services' -Tag @('Integration_SQL2019_RS') { - BeforeAll { - $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $script:originalLevel = $script:configuration.SecureConnectionLevel - } - - AfterAll { - # Restore the original secure connection level - $restoreConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - if ($script:originalLevel -eq 0) - { - $restoreConfig | Disable-SqlDscRsSecureConnection -Force - } - else - { - $restoreConfig | Enable-SqlDscRsSecureConnection -Force - } - } - It 'Should enable secure connection using pipeline' { - # First ensure secure connection is disabled - $script:configuration | Disable-SqlDscRsSecureConnection -Force - # Enable secure connection $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $config | Enable-SqlDscRsSecureConnection -Force @@ -104,39 +54,10 @@ Describe 'Enable-SqlDscRsSecureConnection' { $verifyConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $verifyConfig.SecureConnectionLevel | Should -BeGreaterOrEqual 1 } - - It 'Should return configuration when using PassThru' { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Enable-SqlDscRsSecureConnection -Force -PassThru - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When enabling secure connection for SQL Server Reporting Services' -Tag @('Integration_SQL2022_RS') { - BeforeAll { - $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $script:originalLevel = $script:configuration.SecureConnectionLevel - } - - AfterAll { - # Restore the original secure connection level - $restoreConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - if ($script:originalLevel -eq 0) - { - $restoreConfig | Disable-SqlDscRsSecureConnection -Force - } - else - { - $restoreConfig | Enable-SqlDscRsSecureConnection -Force - } - } - It 'Should enable secure connection using pipeline' { - # First ensure secure connection is disabled - $script:configuration | Disable-SqlDscRsSecureConnection -Force - # Enable secure connection $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $config | Enable-SqlDscRsSecureConnection -Force @@ -145,39 +66,10 @@ Describe 'Enable-SqlDscRsSecureConnection' { $verifyConfig = Get-SqlDscRSConfiguration -InstanceName 'SSRS' $verifyConfig.SecureConnectionLevel | Should -BeGreaterOrEqual 1 } - - It 'Should return configuration when using PassThru' { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Enable-SqlDscRsSecureConnection -Force -PassThru - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When enabling secure connection for Power BI Report Server' -Tag @('Integration_PowerBI') { - BeforeAll { - $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - $script:originalLevel = $script:configuration.SecureConnectionLevel - } - - AfterAll { - # Restore the original secure connection level - $restoreConfig = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - if ($script:originalLevel -eq 0) - { - $restoreConfig | Disable-SqlDscRsSecureConnection -Force - } - else - { - $restoreConfig | Enable-SqlDscRsSecureConnection -Force - } - } - It 'Should enable secure connection for PBIRS using pipeline' { - # First ensure secure connection is disabled - $script:configuration | Disable-SqlDscRsSecureConnection -Force - # Enable secure connection $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' $config | Enable-SqlDscRsSecureConnection -Force @@ -186,13 +78,5 @@ Describe 'Enable-SqlDscRsSecureConnection' { $verifyConfig = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' $verifyConfig.SecureConnectionLevel | Should -BeGreaterOrEqual 1 } - - It 'Should return configuration when using PassThru' { - $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - $result = $config | Enable-SqlDscRsSecureConnection -Force -PassThru - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'PBIRS' - } } } diff --git a/tests/Integration/Commands/Initialize-SqlDscRS.Integration.Tests.ps1 b/tests/Integration/Commands/Initialize-SqlDscRS.Integration.Tests.ps1 index ba9b326c2..70d840375 100644 --- a/tests/Integration/Commands/Initialize-SqlDscRS.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Initialize-SqlDscRS.Integration.Tests.ps1 @@ -56,14 +56,6 @@ Describe 'Initialize-SqlDscRS' { $script:configuration | Initialize-SqlDscRS -Force -ErrorAction 'Stop' } - It 'Should return configuration when using PassThru on initialized instance' { - # Initialize with PassThru (should be idempotent - succeeds whether already initialized or not) - $result = $script:configuration | Initialize-SqlDscRS -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } - It 'Should restart the service to ensure initialization is complete' { <# After initialization, the Reporting Services service must be restarted @@ -93,14 +85,6 @@ Describe 'Initialize-SqlDscRS' { $script:configuration | Initialize-SqlDscRS -Force -ErrorAction 'Stop' } - It 'Should return configuration when using PassThru on initialized instance' { - # Initialize with PassThru (should be idempotent - succeeds whether already initialized or not) - $result = $script:configuration | Initialize-SqlDscRS -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } - It 'Should restart the service to ensure initialization is complete' { <# After initialization, the Reporting Services service must be restarted @@ -130,14 +114,6 @@ Describe 'Initialize-SqlDscRS' { $script:configuration | Initialize-SqlDscRS -Force -ErrorAction 'Stop' } - It 'Should return configuration when using PassThru on initialized instance' { - # Initialize with PassThru (should be idempotent - succeeds whether already initialized or not) - $result = $script:configuration | Initialize-SqlDscRS -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } - It 'Should restart the service to ensure initialization is complete' { <# After initialization, the Reporting Services service must be restarted @@ -167,14 +143,6 @@ Describe 'Initialize-SqlDscRS' { $script:configuration | Initialize-SqlDscRS -Force -ErrorAction 'Stop' } - It 'Should return configuration when using PassThru on initialized instance' { - # Initialize with PassThru (should be idempotent - succeeds whether already initialized or not) - $result = $script:configuration | Initialize-SqlDscRS -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'PBIRS' - } - It 'Should restart the service to ensure initialization is complete' { <# After initialization, the Reporting Services service must be restarted diff --git a/tests/Integration/Commands/Install-SqlDscPowerBIReportServer.Integration.Tests.ps1 b/tests/Integration/Commands/Install-SqlDscPowerBIReportServer.Integration.Tests.ps1 index 8885e0f4c..6fb1cc949 100644 --- a/tests/Integration/Commands/Install-SqlDscPowerBIReportServer.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Install-SqlDscPowerBIReportServer.Integration.Tests.ps1 @@ -65,14 +65,5 @@ Describe 'Install-SqlDscPowerBIReportServer' -Tag @('Integration_PowerBI') { $reportServerService | Should -Not -BeNullOrEmpty $reportServerService.Status | Should -Be 'Running' } - - It 'Should stop the Power BI Report Server service' { - # Stop the Power BI Report Server service to save memory on the build worker - $stopServiceResult = Stop-Service -Name 'PowerBIReportServer' -Force -PassThru -Verbose -ErrorAction 'Stop' - - write-verbose -Message ($stopServiceResult | Out-String) -Verbose - - $stopServiceResult.Status | Should -Be 'Stopped' - } } } diff --git a/tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1 b/tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1 index 73fbd5d60..74a7e55f9 100644 --- a/tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1 @@ -37,24 +37,8 @@ Describe 'Remove-SqlDscRSUrlReservation' { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' # Use a unique port for testing to avoid conflicts - $script:testPort = 18081 + $script:testPort = 18080 $script:testUrl = "http://+:$script:testPort" - - # Add a test URL reservation to remove - $script:configuration | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'Stop' - } - - AfterAll { - # Clean up: ensure the test URL reservation is removed - try - { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'SilentlyContinue' - } - catch - { - # Ignore errors during cleanup - } } It 'Should remove URL reservation using pipeline' { @@ -66,18 +50,6 @@ Describe 'Remove-SqlDscRSUrlReservation' { $reservations.UrlReservations | Should -Not -Contain $script:testUrl } - - It 'Should return configuration when using PassThru' { - # First add the test URL back - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'Stop' - - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When removing URL reservation for SQL Server Reporting Services' -Tag @('Integration_SQL2019_RS') { @@ -85,24 +57,8 @@ Describe 'Remove-SqlDscRSUrlReservation' { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' # Use a unique port for testing to avoid conflicts - $script:testPort = 18081 + $script:testPort = 18080 $script:testUrl = "http://+:$script:testPort" - - # Add a test URL reservation to remove - $script:configuration | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'Stop' - } - - AfterAll { - # Clean up: ensure the test URL reservation is removed - try - { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'SilentlyContinue' - } - catch - { - # Ignore errors during cleanup - } } It 'Should remove URL reservation using pipeline' { @@ -114,18 +70,6 @@ Describe 'Remove-SqlDscRSUrlReservation' { $reservations.UrlReservations | Should -Not -Contain $script:testUrl } - - It 'Should return configuration when using PassThru' { - # First add the test URL back - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'Stop' - - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When removing URL reservation for SQL Server Reporting Services' -Tag @('Integration_SQL2022_RS') { @@ -133,24 +77,8 @@ Describe 'Remove-SqlDscRSUrlReservation' { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' # Use a unique port for testing to avoid conflicts - $script:testPort = 18081 + $script:testPort = 18080 $script:testUrl = "http://+:$script:testPort" - - # Add a test URL reservation to remove - $script:configuration | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'Stop' - } - - AfterAll { - # Clean up: ensure the test URL reservation is removed - try - { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'SilentlyContinue' - } - catch - { - # Ignore errors during cleanup - } } It 'Should remove URL reservation using pipeline' { @@ -162,18 +90,6 @@ Describe 'Remove-SqlDscRSUrlReservation' { $reservations.UrlReservations | Should -Not -Contain $script:testUrl } - - It 'Should return configuration when using PassThru' { - # First add the test URL back - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $config | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'Stop' - - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' - $result = $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When removing URL reservation for Power BI Report Server' -Tag @('Integration_PowerBI') { @@ -181,24 +97,8 @@ Describe 'Remove-SqlDscRSUrlReservation' { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' # Use a unique port for testing to avoid conflicts - $script:testPort = 18081 + $script:testPort = 18080 $script:testUrl = "http://+:$script:testPort" - - # Add a test URL reservation to remove - $script:configuration | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'Stop' - } - - AfterAll { - # Clean up: ensure the test URL reservation is removed - try - { - $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'SilentlyContinue' - } - catch - { - # Ignore errors during cleanup - } } It 'Should remove URL reservation for PBIRS using pipeline' { @@ -210,17 +110,5 @@ Describe 'Remove-SqlDscRSUrlReservation' { $reservations.UrlReservations | Should -Not -Contain $script:testUrl } - - It 'Should return configuration when using PassThru' { - # First add the test URL back - $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - $config | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -ErrorAction 'Stop' - - $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' - $result = $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'PBIRS' - } } } diff --git a/tests/Integration/Commands/Set-SqlDscRSDatabaseConnection.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscRSDatabaseConnection.Integration.Tests.ps1 index f41375e11..03a2e778c 100644 --- a/tests/Integration/Commands/Set-SqlDscRSDatabaseConnection.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscRSDatabaseConnection.Integration.Tests.ps1 @@ -65,13 +65,6 @@ Describe 'Set-SqlDscRSDatabaseConnection' { It 'Should set the database connection' { $script:configuration | Set-SqlDscRSDatabaseConnection -ServerName 'localhost' -InstanceName 'RSDB' -DatabaseName 'ReportServer' -Force -ErrorAction 'Stop' } - - It 'Should return the configuration when using PassThru' { - $result = $script:configuration | Set-SqlDscRSDatabaseConnection -ServerName 'localhost' -InstanceName 'RSDB' -DatabaseName 'ReportServer' -PassThru -Force -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When setting database connection for SQL Server 2019 Reporting Services' -Tag @('Integration_SQL2019_RS') { @@ -95,13 +88,6 @@ Describe 'Set-SqlDscRSDatabaseConnection' { It 'Should set the database connection' { $script:configuration | Set-SqlDscRSDatabaseConnection -ServerName 'localhost' -InstanceName 'RSDB' -DatabaseName 'ReportServer' -Force -ErrorAction 'Stop' } - - It 'Should return the configuration when using PassThru' { - $result = $script:configuration | Set-SqlDscRSDatabaseConnection -ServerName 'localhost' -InstanceName 'RSDB' -DatabaseName 'ReportServer' -PassThru -Force -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When setting database connection for SQL Server 2022 Reporting Services' -Tag @('Integration_SQL2022_RS') { @@ -125,13 +111,6 @@ Describe 'Set-SqlDscRSDatabaseConnection' { It 'Should set the database connection' { $script:configuration | Set-SqlDscRSDatabaseConnection -ServerName 'localhost' -InstanceName 'RSDB' -DatabaseName 'ReportServer' -Force -ErrorAction 'Stop' } - - It 'Should return the configuration when using PassThru' { - $result = $script:configuration | Set-SqlDscRSDatabaseConnection -ServerName 'localhost' -InstanceName 'RSDB' -DatabaseName 'ReportServer' -PassThru -Force -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When setting database connection for Power BI Report Server' -Tag @('Integration_PowerBI') { @@ -155,12 +134,5 @@ Describe 'Set-SqlDscRSDatabaseConnection' { It 'Should set the database connection' { $script:configuration | Set-SqlDscRSDatabaseConnection -ServerName 'localhost' -InstanceName 'RSDB' -DatabaseName 'ReportServer' -Force -ErrorAction 'Stop' } - - It 'Should return the configuration when using PassThru' { - $result = $script:configuration | Set-SqlDscRSDatabaseConnection -ServerName 'localhost' -InstanceName 'RSDB' -DatabaseName 'ReportServer' -PassThru -Force -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'PBIRS' - } } } diff --git a/tests/Integration/Commands/Set-SqlDscRSUrlReservation.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscRSUrlReservation.Integration.Tests.ps1 index ee57dd98d..7e5237508 100644 --- a/tests/Integration/Commands/Set-SqlDscRSUrlReservation.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscRSUrlReservation.Integration.Tests.ps1 @@ -36,54 +36,14 @@ Describe 'Set-SqlDscRSUrlReservation' { BeforeAll { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - # Store original URL reservations to restore later - $script:originalReservations = $script:configuration | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' - - # Get current URLs for ReportServerWebService to restore later - $script:originalWebServiceUrls = @() - - if ($null -ne $script:originalReservations.Application) - { - for ($i = 0; $i -lt $script:originalReservations.Application.Count; $i++) - { - if ($script:originalReservations.Application[$i] -eq 'ReportServerWebService') - { - $script:originalWebServiceUrls += $script:originalReservations.UrlString[$i] - } - } - } - - # Use unique ports for testing to avoid conflicts - $script:testUrl1 = 'http://+:18081' - $script:testUrl2 = 'http://+:18082' - } - - AfterAll { - # Clean up: restore original URL reservations - try - { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - - # Remove test URLs if they exist - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'SilentlyContinue' - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl2 -Force -ErrorAction 'SilentlyContinue' - - # Restore original URLs - foreach ($url in $script:originalWebServiceUrls) - { - $config | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $url -Force -ErrorAction 'SilentlyContinue' - } - } - catch - { - # Ignore errors during cleanup - } + $script:testUrl1 = 'http://+:18080' + $script:testUrl2 = 'http://+:18081' } - It 'Should set URL reservations using pipeline' { - $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'Stop' + It 'Should add multiple URLs and remove existing ones' { + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' - # Verify the URLs are set correctly + # Verify both URLs are set $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' $reservations = $config | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' @@ -99,12 +59,13 @@ Describe 'Set-SqlDscRSUrlReservation' { } $currentUrls | Should -Contain $script:testUrl1 + $currentUrls | Should -Contain $script:testUrl2 } - It 'Should add multiple URLs and remove existing ones' { - $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' + It 'Should set URL reservations using pipeline' { + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'Stop' - # Verify both URLs are set + # Verify the URLs are set correctly $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' $reservations = $config | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' @@ -120,15 +81,6 @@ Describe 'Set-SqlDscRSUrlReservation' { } $currentUrls | Should -Contain $script:testUrl1 - $currentUrls | Should -Contain $script:testUrl2 - } - - It 'Should return configuration when using PassThru' { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - $result = $config | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' } } @@ -136,54 +88,14 @@ Describe 'Set-SqlDscRSUrlReservation' { BeforeAll { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - # Store original URL reservations to restore later - $script:originalReservations = $script:configuration | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' - - # Get current URLs for ReportServerWebService to restore later - $script:originalWebServiceUrls = @() - - if ($null -ne $script:originalReservations.Application) - { - for ($i = 0; $i -lt $script:originalReservations.Application.Count; $i++) - { - if ($script:originalReservations.Application[$i] -eq 'ReportServerWebService') - { - $script:originalWebServiceUrls += $script:originalReservations.UrlString[$i] - } - } - } - - # Use unique ports for testing to avoid conflicts - $script:testUrl1 = 'http://+:18081' - $script:testUrl2 = 'http://+:18082' - } - - AfterAll { - # Clean up: restore original URL reservations - try - { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - - # Remove test URLs if they exist - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'SilentlyContinue' - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl2 -Force -ErrorAction 'SilentlyContinue' - - # Restore original URLs - foreach ($url in $script:originalWebServiceUrls) - { - $config | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $url -Force -ErrorAction 'SilentlyContinue' - } - } - catch - { - # Ignore errors during cleanup - } + $script:testUrl1 = 'http://+:18080' + $script:testUrl2 = 'http://+:18081' } - It 'Should set URL reservations using pipeline' { - $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'Stop' + It 'Should add multiple URLs and remove existing ones' { + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' - # Verify the URLs are set correctly + # Verify both URLs are set $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' $reservations = $config | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' @@ -199,12 +111,13 @@ Describe 'Set-SqlDscRSUrlReservation' { } $currentUrls | Should -Contain $script:testUrl1 + $currentUrls | Should -Contain $script:testUrl2 } - It 'Should add multiple URLs and remove existing ones' { - $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' + It 'Should set URL reservations using pipeline' { + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'Stop' - # Verify both URLs are set + # Verify the URLs are set correctly $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' $reservations = $config | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' @@ -220,15 +133,6 @@ Describe 'Set-SqlDscRSUrlReservation' { } $currentUrls | Should -Contain $script:testUrl1 - $currentUrls | Should -Contain $script:testUrl2 - } - - It 'Should return configuration when using PassThru' { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - $result = $config | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' } } @@ -236,54 +140,14 @@ Describe 'Set-SqlDscRSUrlReservation' { BeforeAll { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - # Store original URL reservations to restore later - $script:originalReservations = $script:configuration | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' - - # Get current URLs for ReportServerWebService to restore later - $script:originalWebServiceUrls = @() - - if ($null -ne $script:originalReservations.Application) - { - for ($i = 0; $i -lt $script:originalReservations.Application.Count; $i++) - { - if ($script:originalReservations.Application[$i] -eq 'ReportServerWebService') - { - $script:originalWebServiceUrls += $script:originalReservations.UrlString[$i] - } - } - } - - # Use unique ports for testing to avoid conflicts - $script:testUrl1 = 'http://+:18081' - $script:testUrl2 = 'http://+:18082' - } - - AfterAll { - # Clean up: restore original URL reservations - try - { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - - # Remove test URLs if they exist - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'SilentlyContinue' - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl2 -Force -ErrorAction 'SilentlyContinue' - - # Restore original URLs - foreach ($url in $script:originalWebServiceUrls) - { - $config | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $url -Force -ErrorAction 'SilentlyContinue' - } - } - catch - { - # Ignore errors during cleanup - } + $script:testUrl1 = 'http://+:18080' + $script:testUrl2 = 'http://+:18081' } - It 'Should set URL reservations using pipeline' { - $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'Stop' + It 'Should add multiple URLs and remove existing ones' { + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' - # Verify the URLs are set correctly + # Verify both URLs are set $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' $reservations = $config | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' @@ -299,12 +163,13 @@ Describe 'Set-SqlDscRSUrlReservation' { } $currentUrls | Should -Contain $script:testUrl1 + $currentUrls | Should -Contain $script:testUrl2 } - It 'Should add multiple URLs and remove existing ones' { - $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' + It 'Should set URL reservations using pipeline' { + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'Stop' - # Verify both URLs are set + # Verify the URLs are set correctly $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' $reservations = $config | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' @@ -320,15 +185,6 @@ Describe 'Set-SqlDscRSUrlReservation' { } $currentUrls | Should -Contain $script:testUrl1 - $currentUrls | Should -Contain $script:testUrl2 - } - - It 'Should return configuration when using PassThru' { - $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' -ErrorAction 'Stop' - $result = $config | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' } } @@ -336,54 +192,15 @@ Describe 'Set-SqlDscRSUrlReservation' { BeforeAll { $script:configuration = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' -ErrorAction 'Stop' - # Store original URL reservations to restore later - $script:originalReservations = $script:configuration | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' - - # Get current URLs for ReportServerWebService to restore later - $script:originalWebServiceUrls = @() - - if ($null -ne $script:originalReservations.Application) - { - for ($i = 0; $i -lt $script:originalReservations.Application.Count; $i++) - { - if ($script:originalReservations.Application[$i] -eq 'ReportServerWebService') - { - $script:originalWebServiceUrls += $script:originalReservations.UrlString[$i] - } - } - } - # Use unique ports for testing to avoid conflicts - $script:testUrl1 = 'http://+:18081' - $script:testUrl2 = 'http://+:18082' + $script:testUrl1 = 'http://+:18080' + $script:testUrl2 = 'http://+:18081' } - AfterAll { - # Clean up: restore original URL reservations - try - { - $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' -ErrorAction 'Stop' - - # Remove test URLs if they exist - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'SilentlyContinue' - $config | Remove-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl2 -Force -ErrorAction 'SilentlyContinue' - - # Restore original URLs - foreach ($url in $script:originalWebServiceUrls) - { - $config | Add-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $url -Force -ErrorAction 'SilentlyContinue' - } - } - catch - { - # Ignore errors during cleanup - } - } - - It 'Should set URL reservations using pipeline' { - $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'Stop' + It 'Should add multiple URLs and remove existing ones' { + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' - # Verify the URLs are set correctly + # Verify both URLs are set $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' -ErrorAction 'Stop' $reservations = $config | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' @@ -399,12 +216,13 @@ Describe 'Set-SqlDscRSUrlReservation' { } $currentUrls | Should -Contain $script:testUrl1 + $currentUrls | Should -Contain $script:testUrl2 } - It 'Should add multiple URLs and remove existing ones' { - $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' + It 'Should set URL reservations using pipeline' { + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -ErrorAction 'Stop' - # Verify both URLs are set + # Verify the URLs are set correctly $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' -ErrorAction 'Stop' $reservations = $config | Get-SqlDscRSUrlReservation -ErrorAction 'Stop' @@ -420,15 +238,6 @@ Describe 'Set-SqlDscRSUrlReservation' { } $currentUrls | Should -Contain $script:testUrl1 - $currentUrls | Should -Contain $script:testUrl2 - } - - It 'Should return configuration when using PassThru' { - $config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS' -ErrorAction 'Stop' - $result = $config | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1 -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'PBIRS' } } } diff --git a/tests/Integration/Commands/Set-SqlDscRSVirtualDirectory.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscRSVirtualDirectory.Integration.Tests.ps1 index fb9715762..7f84dd267 100644 --- a/tests/Integration/Commands/Set-SqlDscRSVirtualDirectory.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscRSVirtualDirectory.Integration.Tests.ps1 @@ -54,13 +54,6 @@ Describe 'Set-SqlDscRSVirtualDirectory' { $config.VirtualDirectoryReportManager | Should -Be 'Reports' } - - It 'Should return configuration when using PassThru' { - $result = $script:configuration | Set-SqlDscRSVirtualDirectory -Application 'ReportServerWebService' -VirtualDirectory 'ReportServer' -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When setting virtual directory for SQL Server Reporting Services' -Tag @('Integration_SQL2019_RS') { @@ -85,13 +78,6 @@ Describe 'Set-SqlDscRSVirtualDirectory' { $config.VirtualDirectoryReportManager | Should -Be 'Reports' } - - It 'Should return configuration when using PassThru' { - $result = $script:configuration | Set-SqlDscRSVirtualDirectory -Application 'ReportServerWebService' -VirtualDirectory 'ReportServer' -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When setting virtual directory for SQL Server Reporting Services' -Tag @('Integration_SQL2022_RS') { @@ -116,13 +102,6 @@ Describe 'Set-SqlDscRSVirtualDirectory' { $config.VirtualDirectoryReportManager | Should -Be 'Reports' } - - It 'Should return configuration when using PassThru' { - $result = $script:configuration | Set-SqlDscRSVirtualDirectory -Application 'ReportServerWebService' -VirtualDirectory 'ReportServer' -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'SSRS' - } } Context 'When setting virtual directory for Power BI Report Server' -Tag @('Integration_PowerBI') { @@ -147,12 +126,5 @@ Describe 'Set-SqlDscRSVirtualDirectory' { $config.VirtualDirectoryReportManager | Should -Be 'Reports' } - - It 'Should return configuration when using PassThru' { - $result = $script:configuration | Set-SqlDscRSVirtualDirectory -Application 'ReportServerWebService' -VirtualDirectory 'ReportServer' -Force -PassThru -ErrorAction 'Stop' - - $result | Should -Not -BeNullOrEmpty - $result.InstanceName | Should -Be 'PBIRS' - } } }