Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
7f0033d
Add integration test stage for DSCv3
johlju May 2, 2025
662fbb7
Fix pipeline
johlju May 2, 2025
c197394
Test environment scope
johlju May 2, 2025
b5988e9
run stage directly
johlju May 2, 2025
90d4392
Run stage after build
johlju May 2, 2025
c7aa156
Test remembering env variable
johlju May 2, 2025
8cb4655
set process env from user env
johlju May 2, 2025
0991588
Fix pipeline
johlju May 2, 2025
5828c3b
Output SqlServerDsc resources
johlju May 2, 2025
58697fa
Add prereq to test
johlju May 3, 2025
16bf27d
First try running get
johlju May 3, 2025
38ad5b6
try another way
johlju May 3, 2025
e5d0ae9
yet another try
johlju May 3, 2025
b3df1cf
fix trace level
johlju May 3, 2025
6e1b45e
Fix test fails on error
johlju May 3, 2025
3574c03
change trace level
johlju May 3, 2025
d15b654
Use latest preview
johlju May 8, 2025
2836204
Fix running in pwsh
johlju May 8, 2025
01f25d7
Output json files
johlju May 8, 2025
5f8b5d5
fix more debug output
johlju May 8, 2025
10ec276
fix typo
johlju May 8, 2025
9a11e71
Fix test
johlju May 8, 2025
376ad60
Fix test
johlju May 8, 2025
a624f22
Update DSCv3 installation command to include prerelease versions
johlju May 23, 2025
b704eb2
Enhance integration tests by ensuring temporary folder creation and i…
johlju May 23, 2025
37241fb
Add DebugDscEngine resource for testing and debugging purposes with c…
johlju May 23, 2025
1fdd2af
Add integration tests for DebugDscEngine resource to validate configu…
johlju May 23, 2025
fc7696c
Update integration test execution order for DSCv3_DebugDscEngine
johlju May 23, 2025
2459a57
Update integration test tags for DebugDscEngine to include PowerBI
johlju May 23, 2025
c1d7fd5
Add verbose logging for DebugDscEngine resource integration tests
johlju May 24, 2025
3621311
Add PowerShell version verification in BeforeAll block for integratio…
johlju May 24, 2025
04c100a
Fix verbose logging to output complete PowerShell version in integrat…
johlju May 24, 2025
a947d5a
Improve verbose logging to format result output in DebugDscEngine int…
johlju May 24, 2025
c9a16ab
Enhance verbose logging to include environment variables and format P…
johlju May 24, 2025
5cada60
Improve verbose logging to format result output as JSON in DebugDscEn…
johlju May 24, 2025
6c860c7
Enhance verbose logging to include detailed result output in DebugDsc…
johlju May 24, 2025
647a85a
Enhance verbose logging to clarify environment variable output in Deb…
johlju May 24, 2025
eb1bcf8
Remove verbose output of environment variables in Get() method of Deb…
johlju May 24, 2025
1e45875
Refactor Get() method to output sorted environment variables in Debug…
johlju May 24, 2025
bf3b0bc
debug verbose stream
johlju Jun 5, 2025
0728130
Remove verbose output of environment variables in Get() method of Deb…
johlju Jun 5, 2025
33674df
debug integ test
johlju Jun 5, 2025
b09368d
Add Integration Test stage for DSCv3 Resources - DEBUG
johlju Jun 7, 2025
595dbbd
Fix script extension in Reporting Services Integration Test command
johlju Jun 7, 2025
5870a58
Refactor integration tests for DebugDscEngine: remove redundant test …
johlju Jun 7, 2025
9122154
Remove verbose output of environment variables in BeforeAll block of …
johlju Jun 7, 2025
4f17378
Add step to retrieve and display available DSCv3 resources in pipeline
johlju Jun 7, 2025
5e54eb1
DEBUG 1
johlju Jun 7, 2025
1f52482
DEBUG 2
johlju Jun 7, 2025
ecf5681
DEBUG 3
johlju Jun 7, 2025
d9d2de8
DEBUG 4
johlju Jun 7, 2025
6b38132
DEBUG 5
johlju Jun 7, 2025
2997039
DEBUG 6
johlju Jun 7, 2025
1076792
DEBUG 7
johlju Jun 7, 2025
1012fbc
DEBUG 8
johlju Jun 7, 2025
20b2913
Refactor DSCv3 installation script to enable verbose output and resou…
johlju Jul 11, 2025
41206ab
Enhance DSCv3 installation script with detailed resource listing and …
johlju Jul 11, 2025
6d47ddc
Refactor DSCv3 integration tests to streamline result handling and en…
johlju Jul 12, 2025
a5af0f0
Remove DEBUG stage for DSCv3 integration tests to streamline pipeline…
johlju Jul 12, 2025
40f3261
Update integration tests to assert specific error messages for missin…
johlju Jul 12, 2025
6723bb4
Refactor integration tests to improve error handling and output for D…
johlju Jul 12, 2025
35c3a04
Refactor verbose output in integration tests to remove redundant text…
johlju Jul 12, 2025
d72209d
Enhance verbose output in integration tests to include detailed resul…
johlju Jul 12, 2025
9d815fa
Enable PSDscRunAsCredential context in integration tests and define t…
johlju Jul 12, 2025
44dc948
Add TODO comment to remove skip for PSDscRunAsCredential context when…
johlju Jul 12, 2025
6136b80
Add mocked warning message for testing purposes in Get() method of De…
johlju Jul 12, 2025
571b869
Remove mocked warning message from Get() method in DebugDscEngine class
johlju Jul 12, 2025
9349160
Add integration tests and enhance DebugDscEngine properties for impro…
johlju Jan 18, 2026
64337a6
Add DSCv3 integration tests for SqlDatabase resource to verify compat…
johlju Jan 18, 2026
0882eef
Convert KeyProperty value to uppercase in GetCurrentState method
johlju Jan 18, 2026
69d0119
Update integration test stages to include Prerequisites and Install-S…
johlju Jan 18, 2026
332b83e
Update test run title and remove unused matrix configuration for Powe…
johlju Jan 18, 2026
f09e230
Add integration tests for SqlRSSetup resource to validate desired sta…
johlju Jan 18, 2026
51011da
Update integration test execution order to include Install-SqlDscServ…
johlju Jan 18, 2026
3189b57
Refactor verbose message logging in Connect-SQL function
johlju Jan 18, 2026
b40c535
Add integration tests for model database recovery model functionality
johlju Jan 18, 2026
66d3745
Remove DebugDscEngine resource and associated tests from the repository
johlju Jan 18, 2026
a34f41e
Update trace level from 'trace' to 'info' in integration tests for Sq…
johlju Jan 18, 2026
64f3781
Update CHANGELOG.md to include DSCv3 integration tests for SqlDatabas…
johlju Jan 18, 2026
4e9de46
Update CHANGELOG.md and integration tests for SqlDatabase and SqlRSSe…
johlju Jan 18, 2026
134aa84
Fix credential handling and update comments in integration tests for …
johlju Jan 18, 2026
aa93edc
Fix credential handling by wrapping Get-ComputerName in parentheses f…
johlju Jan 18, 2026
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
"HRESULT",
"RSDB",
"RSIP",
"contoso"
"contoso",
"PSDSC"
],
"cSpell.ignorePaths": [
".git"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- SqlRSSetup
- Added DSCv3 integration tests to verify compatibility with DSCv3
([issue #2403](https://github.com/dsccommunity/SqlServerDsc/issues/2403)).
- Added public command `Set-SqlDscRSDatabaseTimeout` to set the database logon
timeout and/or query timeout for SQL Server Reporting Services or Power BI
Report Server. Supports setting `LogonTimeout`, `QueryTimeout`, or both via
Expand Down Expand Up @@ -131,6 +134,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
SQL Server instance. Supports a comprehensive set of database properties
that can be configured with `Set-SqlDscDatabaseProperty`
([issue #2174](https://github.com/dsccommunity/SqlServerDsc/issues/2174)).
- Added DSCv3 integration tests to verify compatibility with DSCv3
([issue #2403](https://github.com/dsccommunity/SqlServerDsc/issues/2403)).
- `Install-SqlDscServer`
- Added parameter `AllowDqRemoval` to the `Upgrade` parameter set
([issue #2155](https://github.com/dsccommunity/SqlServerDsc/issues/2155)).
Expand Down
167 changes: 166 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ stages:
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Unit (Windows Server 2019)'
testRunTitle: 'Unit (Windows Server)'
- task: PublishPipelineArtifact@1
displayName: 'Publish Test Artifact'
condition: succeededOrFailed()
Expand Down Expand Up @@ -1154,6 +1154,171 @@ stages:
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- stage: Integration_Test_DSCv3_Resources_PowerBIReportServer
displayName: 'Integration Test DSCv3 Resources - Power BI Report Server'
#dependsOn: Quality_Test_and_Unit_Test
dependsOn: Build
jobs:
- job: Test_Integration
displayName: 'Integration'
strategy:
matrix:
PowerBI_WIN2022:
JOB_VMIMAGE: 'windows-2022'
TEST_CONFIGURATION: 'Integration_PowerBI'
PowerBI_WIN2025:
JOB_VMIMAGE: 'windows-2025'
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'
- pwsh: |
Install-PSResource -Name 'PSDSC' -Repository 'PSGallery' -TrustRepository -Quiet -Confirm:$false
#Install-DscExe -Force -Verbose
Install-DscExe -IncludePrerelease -Force -Verbose
name: installDSCv3
displayName: 'Install DSCv3'
- pwsh: |
# Install-DscExe installs in the path $env:LOCALAPPDATA\dsc
$env:PATH += '{0}{1}' -f [System.IO.Path]::PathSeparator, (Join-Path -Path $env:LOCALAPPDATA -ChildPath 'dsc')
# Make the built module available to the current session.
./build.ps1 -Tasks noop
Get-Module -Name SqlServerDsc -ListAvailable
# Output DSCv3 version
dsc --version
# Get the list of available resources.
'Native resources:'
dsc resource list
'Resources using adapter Microsoft.Windows/WindowsPowerShell:'
dsc resource list --adapter Microsoft.Windows/WindowsPowerShell

Get-ChildItem -Path (Join-Path -Path $env:LOCALAPPDATA -ChildPath 'dsc') -Recurse -Filter '*.json'
$cacheFile = Join-Path -Path $env:LOCALAPPDATA -ChildPath 'dsc/WindowsPSAdapterCache.json'
$getConfig = Get-Content -Path $cacheFile -Raw | ConvertFrom-Json
Write-Verbose -Message "WindowsPSAdapterCache.json content:`n $($getConfig | ConvertTo-Json -Depth 10)" -Verbose
name: getDSCv3AvailableResources
displayName: 'Get DSCv3 Available Resources'
- pwsh: |
# Install-DscExe installed in the path $env:LOCALAPPDATA\dsc
$env:PATH += '{0}{1}' -f [System.IO.Path]::PathSeparator, (Join-Path -Path $env:LOCALAPPDATA -ChildPath 'dsc')
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
# Run the integration tests in a specific group order.
# Prerequisites
# TODO: Move the prerequisites tests to generic folder than Commands
'tests/Integration/Commands/Prerequisites.Integration.Tests.ps1'
# Group 1
#'tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1'
# Group 2
'tests/Integration/Resources/DSCv3_SqlRSSetup.Integration.Tests.ps1'
# Group 3
#'tests/Integration/Resources/DSC_SqlRS.Integration.Tests.ps1'
)
name: test
displayName: 'Run Reporting Services Integration Test'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- stage: Integration_Test_DSCv3_Resources_SqlServer
displayName: 'Integration Test DSCv3 Resources - SQL Server'
dependsOn: Build
jobs:
- job: Test_Integration
displayName: 'Integration'
strategy:
matrix:
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'
- pwsh: |
Install-PSResource -Name 'PSDSC' -Repository 'PSGallery' -TrustRepository -Quiet -Confirm:$false
Install-DscExe -IncludePrerelease -Force -Verbose
name: installDSCv3
displayName: 'Install DSCv3'
- pwsh: |
# Install-DscExe installs in the path $env:LOCALAPPDATA\dsc
$env:PATH += '{0}{1}' -f [System.IO.Path]::PathSeparator, (Join-Path -Path $env:LOCALAPPDATA -ChildPath 'dsc')
# Make the built module available to the current session.
./build.ps1 -Tasks noop
Get-Module -Name SqlServerDsc -ListAvailable
# Output DSCv3 version
dsc --version
# Get the list of available resources.
'Native resources:'
dsc resource list
'Resources using adapter Microsoft.Windows/WindowsPowerShell:'
dsc resource list --adapter Microsoft.Windows/WindowsPowerShell
name: getDSCv3AvailableResources
displayName: 'Get DSCv3 Available Resources'
- pwsh: |
# Install-DscExe installed in the path $env:LOCALAPPDATA\dsc
$env:PATH += '{0}{1}' -f [System.IO.Path]::PathSeparator, (Join-Path -Path $env:LOCALAPPDATA -ChildPath 'dsc')
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
# Run the integration tests in a specific group order.
# Prerequisites
'tests/Integration/Commands/Prerequisites.Integration.Tests.ps1'
# Group 1
'tests/Integration/Commands/Install-SqlDscServer.Integration.Tests.ps1'
# Group 2
'tests/Integration/Resources/DSCv3_SqlDatabase.Integration.Tests.ps1'
)
name: test
displayName: 'Run DSCv3 SQL Server Integration Test'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration DSCv3 SQL Server ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

- stage: Integration_Test_Resources_ReportingServices_dbatools
displayName: 'Integration Test Resources - Reporting Services (dbatools)'
dependsOn: Integration_Test_Resources_SqlServer
Expand Down
6 changes: 3 additions & 3 deletions source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,15 @@ function Connect-SQL

Write-Verbose -Message (
$script:localizedData.ConnectingUsingIntegrated -f $connectUsername
) -Verbose
)
}
else
{
$connectUserName = $Credential.UserName

Write-Verbose -Message (
$script:localizedData.ConnectingUsingImpersonation -f $connectUsername, $LoginType
) -Verbose
)

if ($LoginType -eq 'SqlLogin')
{
Expand Down Expand Up @@ -513,7 +513,7 @@ function Connect-SQL
{
Write-Verbose -Message (
$script:localizedData.ConnectedToDatabaseEngineInstance -f $databaseEngineInstance
) -Verbose
)

return $sqlServerObject
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ Describe 'Prerequisites' {
It 'Should have the minimum required version of Microsoft.PowerShell.PSResourceGet' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') {
$module = Get-Module -Name 'Microsoft.PowerShell.PSResourceGet' -ListAvailable

$module | Should -HaveCount 1
$module.Version -ge '1.0.4.1' | Should -BeTrue
$module.Count | Should -BeGreaterOrEqual 1
#$module.Version -ge '1.0.4.1' | Should -BeTrue
}

It 'Should have a resource repository PSGallery with correct URI' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') {
Expand Down
Loading