Skip to content

Commit 71f4c98

Browse files
authored
Refactor Reporting Services Integration Tests (#2405)
1 parent 4eae9db commit 71f4c98

18 files changed

+1144
-868
lines changed

.vscode/analyzersettings.psd1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@
6666
'AvoidProcessWithoutPipeline'
6767
'AvoidSmartQuotes'
6868
'AvoidThrowOutsideOfTry'
69-
'AvoidWriteErrorStop'
69+
<#
70+
'AvoidWriteErrorStop' rule is disabled because it conflicts with
71+
the use of 'Write-Error -ErrorAction Stop' pattern used in the module.
72+
There are edge case issues with $PSCmdlet.ThrowTerminatingError that
73+
being investigated in Pull Request https://github.com/dsccommunity/SqlServerDsc/pull/2364.
74+
#>
75+
#'AvoidWriteErrorStop'
7076
'AvoidWriteOutput'
7177
'UseSyntacticallyCorrectExamples'
7278
)

CHANGELOG.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8989
Services configuration instances with consistent error handling. This function
9090
is used by `Enable-SqlDscRsSecureConnection`, `Disable-SqlDscRsSecureConnection`,
9191
and the `SqlRS` resource.
92-
- Added private function `Get-HResultMessage` to translate common Windows HRESULT
93-
error codes into human-readable messages. Used by `Invoke-RsCimMethod` to
94-
provide actionable error messages when Reporting Services CIM methods fail
95-
without detailed error information.
92+
- Added parameters `RetryCount`, `RetryDelaySeconds`, and `SkipRetry` to provide
93+
configurable retry behavior for transient CIM method failures. By default,
94+
retries up to 3 times with 30-second delays. Handles both HRESULT failures
95+
and exceptions from `Invoke-CimMethod`. Collects unique errors across retry
96+
attempts with attempt number prefixes for comprehensive error reporting.
9697
- `Invoke-ReportServerSetupAction`
9798
- Now uses `Format-Path` with `-ExpandEnvironmentVariable` to expand environment
9899
variables in all path parameters (`MediaPath`, `LogPath`, `InstallFolder`)
@@ -248,6 +249,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
248249
### Changed
249250

250251
- SqlServerDsc
252+
- Consolidated Reporting Services post-service-account-change integration tests
253+
into three version-specific test files: `Post.ServiceAccountChange.SQL2017.RS`,
254+
`Post.ServiceAccountChange.SQL2019-2022.RS`, and `Post.ServiceAccountChange.PowerBI.RS`.
255+
SQL Server 2017 uses a workaround with `Remove-SqlDscRSEncryptedInformation`
256+
and `Set-SqlDscRSDatabaseConnection` because the encryption key commands
257+
fail with "Keyset does not exist" errors on SQL Server 2017.
251258
- Split the `Test_HQRM` pipeline job into two parallel jobs (`Test_QA` and
252259
`Test_HQRM`) to reduce overall pipeline execution time by approximately
253260
15 minutes.

azure-pipelines.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -589,17 +589,13 @@ stages:
589589
# Group 6 - Service account change
590590
'tests/Integration/Commands/Set-SqlDscRSServiceAccount.Integration.Tests.ps1'
591591
'tests/Integration/Commands/Get-SqlDscRSServiceAccount.Integration.Tests.ps1'
592-
'tests/Integration/Commands/Post.DatabaseRights.RS.Integration.Tests.ps1'
593-
'tests/Integration/Commands/Post.EncryptedInformation.RS.Integration.Tests.ps1'
594-
'tests/Integration/Commands/Post.DatabaseConnection.RS.Integration.Tests.ps1'
595-
'tests/Integration/Commands/Remove-SqlDscRSEncryptionKey.Integration.Tests.ps1'
596-
'tests/Integration/Commands/New-SqlDscRSEncryptionKey.Integration.Tests.ps1'
597-
'tests/Integration/Commands/Post.UrlReservationRecreate.RS.Integration.Tests.ps1'
598-
'tests/Integration/Commands/Post.Reinitialize.RS.Integration.Tests.ps1'
599-
'tests/Integration/Commands/Post.ServiceAccountChange.RS.Integration.Tests.ps1'
592+
'tests/Integration/Commands/Post.ServiceAccountChange.SQL2017.RS.Integration.Tests.ps1'
593+
'tests/Integration/Commands/Post.ServiceAccountChange.SQL2019-2022.RS.Integration.Tests.ps1'
600594
# Group 8
601595
'tests/Integration/Commands/Repair-SqlDscReportingService.Integration.Tests.ps1'
602596
'tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1'
597+
'tests/Integration/Commands/Remove-SqlDscRSEncryptionKey.Integration.Tests.ps1'
598+
'tests/Integration/Commands/New-SqlDscRSEncryptionKey.Integration.Tests.ps1'
603599
'tests/Integration/Commands/Remove-SqlDscRSEncryptedInformation.Integration.Tests.ps1'
604600
# Group 9
605601
'tests/Integration/Commands/Uninstall-SqlDscReportingService.Integration.Tests.ps1'
@@ -690,15 +686,12 @@ stages:
690686
# Group 6 - Service account change
691687
'tests/Integration/Commands/Set-SqlDscRSServiceAccount.Integration.Tests.ps1'
692688
'tests/Integration/Commands/Get-SqlDscRSServiceAccount.Integration.Tests.ps1'
693-
'tests/Integration/Commands/Post.DatabaseRights.RS.Integration.Tests.ps1'
694-
'tests/Integration/Commands/Remove-SqlDscRSEncryptionKey.Integration.Tests.ps1'
695-
'tests/Integration/Commands/New-SqlDscRSEncryptionKey.Integration.Tests.ps1'
696-
'tests/Integration/Commands/Post.UrlReservationRecreate.RS.Integration.Tests.ps1'
697-
'tests/Integration/Commands/Post.Reinitialize.RS.Integration.Tests.ps1'
698-
'tests/Integration/Commands/Post.ServiceAccountChange.RS.Integration.Tests.ps1'
689+
'tests/Integration/Commands/Post.ServiceAccountChange.PowerBI.RS.Integration.Tests.ps1'
699690
# Group 8
700691
'tests/Integration/Commands/Repair-SqlDscPowerBIReportServer.Integration.Tests.ps1'
701692
'tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1'
693+
'tests/Integration/Commands/Remove-SqlDscRSEncryptionKey.Integration.Tests.ps1'
694+
'tests/Integration/Commands/New-SqlDscRSEncryptionKey.Integration.Tests.ps1'
702695
'tests/Integration/Commands/Remove-SqlDscRSEncryptedInformation.Integration.Tests.ps1'
703696
# Group 9
704697
'tests/Integration/Commands/Uninstall-SqlDscPowerBIReportServer.Integration.Tests.ps1'

source/Private/Get-HResultMessage.ps1

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)