Skip to content

Commit 17a73d9

Browse files
authored
Add lifecycle commands for Reporting Service and BI Report Server (#2067)
- Public commands: - `Install-SqlDscReportingServices` - `Install-SqlDscBIReportServer` - `Repair-SqlDscReportingServices` - `Repair-SqlDscBIReportServer` - `Uninstall-SqlDscReportingServices` - `Uninstall-SqlDscBIReportServer`
1 parent 2246dcd commit 17a73d9

27 files changed

+2343
-199
lines changed

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
### Added
99

10+
- Public commands:
11+
- `Install-SqlDscReportingService`
12+
- `Install-SqlDscBIReportServer`
13+
- `Repair-SqlDscReportingService`
14+
- `Repair-SqlDscBIReportServer`
15+
- `Uninstall-SqlDscReportingService`
16+
- `Uninstall-SqlDscBIReportServer`
1017
- Private function:
1118
- `Invoke-ReportServerSetupAction`
1219

@@ -17,6 +24,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1724
now been moved to the WikiSource folder. The examples are published to
1825
the repository Wiki. The README has been updated to link to the new
1926
location ([issue #2051](https://github.com/dsccommunity/SqlServerDsc/issues/2051)).
27+
- Integration test stages has been modified to split the testing into
28+
several different areas. The tests are dependent on this order:
29+
- Quality_Test_and_Unit_Test
30+
- Integration_Test_Commands_SqlServer
31+
- Integration_Test_Commands_ReportingServices
32+
- Integration_Test_Commands_BIReportServer
33+
- Integration_Test_Resources_SqlServer
34+
- Integration_Test_Resources_SqlServer_dbatools
35+
- Integration_Test_Resources_ReportingServices
36+
- Integration_Test_Resources_ReportingServices_dbatools
2037
- SqlSetup
2138
- Fixed issue with AddNode where cluster IP information was not being passed to
2239
setup.exe ([issue #1171](https://github.com/dsccommunity/SqlServerDsc/issues/1171)).
@@ -31,10 +48,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3148
- Fix localization strings in `Assert` method.
3249
- `Save-SqlDscSqlServerMediaFile`
3350
- Fix localizations strings that used wrong keys.
34-
- Fix unit tests so the work cross-platform.
51+
- Fix unit tests so they work cross-platform.
3552
- `Install-SqlDscServer` and private function `Invoke-SetupAction`
3653
- Fix localization string keys naming.
3754
- Fix unit tests to use correct localization string names.
55+
- Remove redundant unit tests.
3856
- `SqlConfiguration`
3957
- Change the alias command to real command name, to pass HQRM tests.
4058
- `SqlDatabaseUser`
@@ -55,7 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5573
### Added
5674

5775
- SqlSetup
58-
- Added new parameter ProductCoveredbySA which is introduced in SQL 2022.
76+
- Added new parameter ProductCoveredBySA which is introduced in SQL 2022.
5977

6078
### Added
6179

azure-pipelines.yml

Lines changed: 161 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ stages:
119119
testResultsFormat: 'NUnit'
120120
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
121121
testRunTitle: 'HQRM'
122-
123122
- job: Test_Unit
124123
displayName: 'Unit'
125124
pool:
@@ -156,7 +155,6 @@ stages:
156155
targetPath: '$(buildFolderName)/$(testResultFolderName)/'
157156
artifactName: $(testArtifactName)
158157
parallel: true
159-
160158
- job: Code_Coverage
161159
displayName: 'Publish Code Coverage'
162160
dependsOn: Test_Unit
@@ -193,9 +191,9 @@ stages:
193191
bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml" -F unit
194192
displayName: 'Publish Code Coverage to Codecov.io'
195193
196-
- stage: Integration_Test_Commands
197-
displayName: 'Integration Test Commands'
198-
dependsOn: Build
194+
- stage: Integration_Test_Commands_SqlServer
195+
displayName: 'Integration Test Commands - SQL Server'
196+
dependsOn: Quality_Test_and_Unit_Test
199197
jobs:
200198
- job: Test_Integration
201199
displayName: 'Commands'
@@ -269,9 +267,139 @@ stages:
269267
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
270268
testRunTitle: 'Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
271269

272-
- stage: Integration_Test_Resources
273-
displayName: 'Integration Test Resources'
274-
dependsOn: Build
270+
- stage: Integration_Test_Commands_ReportingServices
271+
displayName: 'Integration Test Commands - Reporting Services'
272+
dependsOn: Integration_Test_Commands_SqlServer
273+
jobs:
274+
- job: Test_Integration
275+
displayName: 'Commands'
276+
strategy:
277+
matrix:
278+
SQL2017_WIN2019:
279+
JOB_VMIMAGE: 'windows-2019'
280+
TEST_CONFIGURATION: 'Integration_SQL2017'
281+
SQL2017_WIN2022:
282+
JOB_VMIMAGE: 'windows-2022'
283+
TEST_CONFIGURATION: 'Integration_SQL2017'
284+
SQL2019_WIN2019:
285+
JOB_VMIMAGE: 'windows-2019'
286+
TEST_CONFIGURATION: 'Integration_SQL2019'
287+
SQL2019_WIN2022:
288+
JOB_VMIMAGE: 'windows-2022'
289+
TEST_CONFIGURATION: 'Integration_SQL2019'
290+
SQL2022_WIN2019:
291+
JOB_VMIMAGE: 'windows-2019'
292+
TEST_CONFIGURATION: 'Integration_SQL2022'
293+
SQL2022_WIN2022:
294+
JOB_VMIMAGE: 'windows-2022'
295+
TEST_CONFIGURATION: 'Integration_SQL2022'
296+
pool:
297+
vmImage: $(JOB_VMIMAGE)
298+
timeoutInMinutes: 0
299+
steps:
300+
- task: DownloadPipelineArtifact@2
301+
displayName: 'Download Build Artifact'
302+
inputs:
303+
buildType: 'current'
304+
artifactName: $(buildArtifactName)
305+
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
306+
- task: PowerShell@2
307+
name: configureWinRM
308+
displayName: 'Configure WinRM'
309+
inputs:
310+
targetType: 'inline'
311+
script: 'winrm quickconfig -quiet'
312+
pwsh: false
313+
- powershell: |
314+
Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
315+
Remove-PowerShellModuleFromCI -Name @('SqlServer', 'SQLPS')
316+
Remove-Module -Name CommonTestHelper
317+
name: cleanCIWorker
318+
displayName: 'Clean CI worker'
319+
- powershell: |
320+
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
321+
# Run the integration tests in a specific group order.
322+
# Group 0
323+
'tests/Integration/Commands/Prerequisites.Integration.Tests.ps1'
324+
# Group 1
325+
'tests/Integration/Commands/Install-SqlDscReportingService.Integration.Tests.ps1'
326+
# Group 8
327+
'tests/Integration/Commands/Repair-SqlDscReportingService.Integration.Tests.ps1'
328+
# Group 9
329+
'tests/Integration/Commands/Uninstall-SqlDscReportingService.Integration.Tests.ps1'
330+
)
331+
name: test
332+
displayName: 'Run Integration Test'
333+
- task: PublishTestResults@2
334+
displayName: 'Publish Test Results'
335+
condition: succeededOrFailed()
336+
inputs:
337+
testResultsFormat: 'NUnit'
338+
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
339+
testRunTitle: 'Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
340+
341+
- stage: Integration_Test_Commands_BIReportServer
342+
displayName: 'Integration Test Commands - BI Report Server'
343+
dependsOn: Integration_Test_Commands_SqlServer
344+
jobs:
345+
- job: Test_Integration
346+
displayName: 'Commands'
347+
strategy:
348+
matrix:
349+
SQL2022_WIN2019:
350+
JOB_VMIMAGE: 'windows-2019'
351+
TEST_CONFIGURATION: 'Integration_PowerBI'
352+
SQL2022_WIN2022:
353+
JOB_VMIMAGE: 'windows-2022'
354+
TEST_CONFIGURATION: 'Integration_PowerBI'
355+
pool:
356+
vmImage: $(JOB_VMIMAGE)
357+
timeoutInMinutes: 0
358+
steps:
359+
- task: DownloadPipelineArtifact@2
360+
displayName: 'Download Build Artifact'
361+
inputs:
362+
buildType: 'current'
363+
artifactName: $(buildArtifactName)
364+
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
365+
- task: PowerShell@2
366+
name: configureWinRM
367+
displayName: 'Configure WinRM'
368+
inputs:
369+
targetType: 'inline'
370+
script: 'winrm quickconfig -quiet'
371+
pwsh: false
372+
- powershell: |
373+
Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
374+
Remove-PowerShellModuleFromCI -Name @('SqlServer', 'SQLPS')
375+
Remove-Module -Name CommonTestHelper
376+
name: cleanCIWorker
377+
displayName: 'Clean CI worker'
378+
- powershell: |
379+
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
380+
# Run the integration tests in a specific group order.
381+
# Group 0
382+
'tests/Integration/Commands/Prerequisites.Integration.Tests.ps1'
383+
# Group 1
384+
'tests/Integration/Commands/Install-SqlDscBIReportServer.Integration.Tests.ps1'
385+
# Group 8
386+
'tests/Integration/Commands/Repair-SqlDscBIReportServer.Integration.Tests.ps1'
387+
# Group 9
388+
'tests/Integration/Commands/Uninstall-SqlDscBIReportServer.Integration.Tests.ps1'
389+
)
390+
name: test
391+
displayName: 'Run Integration Test'
392+
- task: PublishTestResults@2
393+
displayName: 'Publish Test Results'
394+
condition: succeededOrFailed()
395+
inputs:
396+
testResultsFormat: 'NUnit'
397+
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
398+
testRunTitle: 'Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
399+
400+
- stage: Integration_Test_Resources_SqlServer
401+
displayName: 'Integration Test Resources - SQL Server'
402+
dependsOn: Quality_Test_and_Unit_Test
275403
jobs:
276404
- job: Test_Integration
277405
displayName: 'Integration'
@@ -371,9 +499,12 @@ stages:
371499
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
372500
testRunTitle: 'Integration Resources ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
373501

374-
- job: Test_Integration_dbatools
375-
displayName: 'Integration (dbatools)'
376-
dependsOn: Test_Integration
502+
- stage: Integration_Test_Resources_SqlServer_dbatools
503+
displayName: 'Integration Test Resources - SQL Server (dbatools)'
504+
dependsOn: Integration_Test_Resources_SqlServer
505+
jobs:
506+
- job: Test_Integration
507+
displayName: 'Integration'
377508
strategy:
378509
matrix:
379510
SQL2016_WIN2022:
@@ -461,8 +592,12 @@ stages:
461592
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
462593
testRunTitle: 'Integration (dbatools) ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
463594

464-
- job: Test_Integration_RS
465-
displayName: 'Integration Reporting Services'
595+
- stage: Integration_Test_Resources_ReportingServices
596+
displayName: 'Integration Test Resources - Reporting Services'
597+
dependsOn: Integration_Test_Resources_SqlServer
598+
jobs:
599+
- job: Test_Integration
600+
displayName: 'Integration'
466601
strategy:
467602
matrix:
468603
SQL2016_WIN2019:
@@ -537,9 +672,12 @@ stages:
537672
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
538673
testRunTitle: 'Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
539674

540-
- job: Test_Integration_RS_dbatools
541-
displayName: 'Integration Reporting Services (dbatools)'
542-
dependsOn: Test_Integration_RS
675+
- stage: Integration_Test_Resources_ReportingServices_dbatools
676+
displayName: 'Integration Test Resources - Reporting Services (dbatools)'
677+
dependsOn: Integration_Test_Resources_SqlServer
678+
jobs:
679+
- job: Test_Integration
680+
displayName: 'Integration'
543681
strategy:
544682
matrix:
545683
SQL2016_WIN2022:
@@ -599,8 +737,13 @@ stages:
599737
- stage: Deploy
600738
dependsOn:
601739
- Quality_Test_and_Unit_Test
602-
- Integration_Test_Commands
603-
- Integration_Test_Resources
740+
- Integration_Test_Commands_SqlServer
741+
- Integration_Test_Commands_ReportingServices
742+
- Integration_Test_Commands_BIReportServer
743+
- Integration_Test_Resources_SqlServer
744+
- Integration_Test_Resources_SqlServer_dbatools
745+
- Integration_Test_Resources_ReportingServices
746+
- Integration_Test_Resources_ReportingServices_dbatools
604747
condition: |
605748
and(
606749
succeeded(),

source/Private/Invoke-ReportServerSetupAction.ps1

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function Invoke-ReportServerSetupAction
147147

148148
[Parameter(ParameterSetName = 'Install')]
149149
[Parameter(ParameterSetName = 'Repair')]
150-
[ValidateSet('Development', 'Evaluation', 'ExpressAdvanced')]
150+
[ValidateSet('Developer', 'Evaluation', 'ExpressAdvanced')]
151151
[System.String]
152152
$Edition,
153153

@@ -213,6 +213,9 @@ function Invoke-ReportServerSetupAction
213213

214214
Assert-BoundParameter @assertBoundParameters
215215

216+
# Sensitive values.
217+
$sensitiveValue = @()
218+
216219
# Default action is install or upgrade.
217220
$setupArgument = '/quiet /IAcceptLicenseTerms'
218221

@@ -228,6 +231,10 @@ function Invoke-ReportServerSetupAction
228231
if ($ProductKey)
229232
{
230233
$setupArgument += ' /PID={0}' -f $ProductKey
234+
235+
$sensitiveValue += @(
236+
$ProductKey
237+
)
231238
}
232239

233240
if ($EditionUpgrade.IsPresent)
@@ -237,7 +244,13 @@ function Invoke-ReportServerSetupAction
237244

238245
if ($Edition)
239246
{
240-
$setupArgument += ' /Edition={0}' -f $Edition
247+
$editionMap = @{
248+
Developer = 'Dev'
249+
Evaluation = 'Eval'
250+
ExpressAdvanced = 'ExprAdv'
251+
}
252+
253+
$setupArgument += ' /Edition={0}' -f $editionMap.$Edition
241254
}
242255

243256
if ($LogPath)
@@ -257,11 +270,6 @@ function Invoke-ReportServerSetupAction
257270

258271
$verboseSetupArgument = $setupArgument
259272

260-
# Sensitive values.
261-
$sensitiveValue = @(
262-
$ProductKey
263-
)
264-
265273
# Obfuscate sensitive values.
266274
foreach ($currentSensitiveValue in $sensitiveValue)
267275
{

0 commit comments

Comments
 (0)