Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Public commands:
- `Install-SqlDscReportingService`
- `Install-SqlDscBIReportServer`
- `Repair-SqlDscReportingService`
- `Repair-SqlDscBIReportServer`
- `Uninstall-SqlDscReportingService`
- `Uninstall-SqlDscBIReportServer`
- Private function:
- `Invoke-ReportServerSetupAction`

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

- SqlSetup
- Added new parameter ProductCoveredbySA which is introduced in SQL 2022.
- Added new parameter ProductCoveredBySA which is introduced in SQL 2022.

### Added

Expand Down
179 changes: 161 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ stages:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'HQRM'

- job: Test_Unit
displayName: 'Unit'
pool:
Expand Down Expand Up @@ -156,7 +155,6 @@ stages:
targetPath: '$(buildFolderName)/$(testResultFolderName)/'
artifactName: $(testArtifactName)
parallel: true

- job: Code_Coverage
displayName: 'Publish Code Coverage'
dependsOn: Test_Unit
Expand Down Expand Up @@ -193,9 +191,9 @@ stages:
bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml" -F unit
displayName: 'Publish Code Coverage to Codecov.io'

- stage: Integration_Test_Commands
displayName: 'Integration Test Commands'
dependsOn: Build
- stage: Integration_Test_Commands_SqlServer
displayName: 'Integration Test Commands - SQL Server'
dependsOn: Quality_Test_and_Unit_Test
jobs:
- job: Test_Integration
displayName: 'Commands'
Expand Down Expand Up @@ -269,9 +267,139 @@ stages:
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- stage: Integration_Test_Resources
displayName: 'Integration Test Resources'
dependsOn: Build
- stage: Integration_Test_Commands_ReportingServices
displayName: 'Integration Test Commands - Reporting Services'
dependsOn: Integration_Test_Commands_SqlServer
jobs:
- job: Test_Integration
displayName: 'Commands'
strategy:
matrix:
SQL2017_WIN2019:
JOB_VMIMAGE: 'windows-2019'
TEST_CONFIGURATION: 'Integration_SQL2017'
SQL2017_WIN2022:
JOB_VMIMAGE: 'windows-2022'
TEST_CONFIGURATION: 'Integration_SQL2017'
SQL2019_WIN2019:
JOB_VMIMAGE: 'windows-2019'
TEST_CONFIGURATION: 'Integration_SQL2019'
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
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
- task: PowerShell@2
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
pwsh: false
- powershell: |
Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
Remove-PowerShellModuleFromCI -Name @('SqlServer', 'SQLPS')
Remove-Module -Name CommonTestHelper
name: cleanCIWorker
displayName: 'Clean CI worker'
- powershell: |
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
# Run the integration tests in a specific group order.
# Group 0
'tests/Integration/Commands/Prerequisites.Integration.Tests.ps1'
# Group 1
'tests/Integration/Commands/Install-SqlDscReportingService.Integration.Tests.ps1'
# Group 8
'tests/Integration/Commands/Repair-SqlDscReportingService.Integration.Tests.ps1'
# Group 9
'tests/Integration/Commands/Uninstall-SqlDscReportingService.Integration.Tests.ps1'
)
name: test
displayName: 'Run Integration Test'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- stage: Integration_Test_Commands_BIReportServer
displayName: 'Integration Test Commands - BI Report Server'
dependsOn: Integration_Test_Commands_SqlServer
jobs:
- job: Test_Integration
displayName: 'Commands'
strategy:
matrix:
SQL2022_WIN2019:
JOB_VMIMAGE: 'windows-2019'
TEST_CONFIGURATION: 'Integration_PowerBI'
SQL2022_WIN2022:
JOB_VMIMAGE: 'windows-2022'
TEST_CONFIGURATION: 'Integration_PowerBI'
pool:
vmImage: $(JOB_VMIMAGE)
timeoutInMinutes: 0
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
- task: PowerShell@2
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
pwsh: false
- powershell: |
Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
Remove-PowerShellModuleFromCI -Name @('SqlServer', 'SQLPS')
Remove-Module -Name CommonTestHelper
name: cleanCIWorker
displayName: 'Clean CI worker'
- powershell: |
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
# Run the integration tests in a specific group order.
# Group 0
'tests/Integration/Commands/Prerequisites.Integration.Tests.ps1'
# Group 1
'tests/Integration/Commands/Install-SqlDscBIReportServer.Integration.Tests.ps1'
# Group 8
'tests/Integration/Commands/Repair-SqlDscBIReportServer.Integration.Tests.ps1'
# Group 9
'tests/Integration/Commands/Uninstall-SqlDscBIReportServer.Integration.Tests.ps1'
)
name: test
displayName: 'Run Integration Test'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- stage: Integration_Test_Resources_SqlServer
displayName: 'Integration Test Resources - SQL Server'
dependsOn: Quality_Test_and_Unit_Test
jobs:
- job: Test_Integration
displayName: 'Integration'
Expand Down Expand Up @@ -371,9 +499,12 @@ stages:
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration Resources ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- job: Test_Integration_dbatools
displayName: 'Integration (dbatools)'
dependsOn: Test_Integration
- stage: Integration_Test_Resources_SqlServer_dbatools
displayName: 'Integration Test Resources - SQL Server (dbatools)'
dependsOn: Integration_Test_Resources_SqlServer
jobs:
- job: Test_Integration
displayName: 'Integration'
strategy:
matrix:
SQL2016_WIN2022:
Expand Down Expand Up @@ -461,8 +592,12 @@ stages:
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration (dbatools) ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- job: Test_Integration_RS
displayName: 'Integration Reporting Services'
- stage: Integration_Test_Resources_ReportingServices
displayName: 'Integration Test Resources - Reporting Services'
dependsOn: Integration_Test_Resources_SqlServer
jobs:
- job: Test_Integration
displayName: 'Integration'
strategy:
matrix:
SQL2016_WIN2019:
Expand Down Expand Up @@ -537,9 +672,12 @@ stages:
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- job: Test_Integration_RS_dbatools
displayName: 'Integration Reporting Services (dbatools)'
dependsOn: Test_Integration_RS
- stage: Integration_Test_Resources_ReportingServices_dbatools
displayName: 'Integration Test Resources - Reporting Services (dbatools)'
dependsOn: Integration_Test_Resources_SqlServer
jobs:
- job: Test_Integration
displayName: 'Integration'
strategy:
matrix:
SQL2016_WIN2022:
Expand Down Expand Up @@ -599,8 +737,13 @@ stages:
- stage: Deploy
dependsOn:
- Quality_Test_and_Unit_Test
- Integration_Test_Commands
- Integration_Test_Resources
- Integration_Test_Commands_SqlServer
- Integration_Test_Commands_ReportingServices
- Integration_Test_Commands_BIReportServer
- Integration_Test_Resources_SqlServer
- Integration_Test_Resources_SqlServer_dbatools
- Integration_Test_Resources_ReportingServices
- Integration_Test_Resources_ReportingServices_dbatools
condition: |
and(
succeeded(),
Expand Down
22 changes: 15 additions & 7 deletions source/Private/Invoke-ReportServerSetupAction.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function Invoke-ReportServerSetupAction

[Parameter(ParameterSetName = 'Install')]
[Parameter(ParameterSetName = 'Repair')]
[ValidateSet('Development', 'Evaluation', 'ExpressAdvanced')]
[ValidateSet('Developer', 'Evaluation', 'ExpressAdvanced')]
[System.String]
$Edition,

Expand Down Expand Up @@ -213,6 +213,9 @@ function Invoke-ReportServerSetupAction

Assert-BoundParameter @assertBoundParameters

# Sensitive values.
$sensitiveValue = @()

# Default action is install or upgrade.
$setupArgument = '/quiet /IAcceptLicenseTerms'

Expand All @@ -228,6 +231,10 @@ function Invoke-ReportServerSetupAction
if ($ProductKey)
{
$setupArgument += ' /PID={0}' -f $ProductKey

$sensitiveValue += @(
$ProductKey
)
}

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

if ($Edition)
{
$setupArgument += ' /Edition={0}' -f $Edition
$editionMap = @{
Developer = 'Dev'
Evaluation = 'Eval'
ExpressAdvanced = 'ExprAdv'
}

$setupArgument += ' /Edition={0}' -f $editionMap.$Edition
}

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

$verboseSetupArgument = $setupArgument

# Sensitive values.
$sensitiveValue = @(
$ProductKey
)

# Obfuscate sensitive values.
foreach ($currentSensitiveValue in $sensitiveValue)
{
Expand Down
Loading