Skip to content

Commit

Permalink
SqlServerDsc: Attempt to mitigate issue #1260 (#1268)
Browse files Browse the repository at this point in the history
- Changes to SqlServerDsc
  - Reverting the change that was made as part of the issue #1260
    in the previous release, as it only mitigated the issue, it did not
    solve the issue.
  - Removed the container testing since that broke the integration tests,
    possible due to using excessive amount of memory on the AppVeyor build
    worker. This will make the unit tests to take a bit longer to run (issue #1260).
  - The unit tests and the integration tests are now run in two separate
    build workers in AppVeyor. One build worker runs the integration tests,
    while a second build worker runs the unit tests. The build workers runs
    in parallel on paid accounts, but sequentially on free accounts (issue #1260).
  - Clean up error handling in some of the integration tests that was
    part of a workaround for a bug in Pester. The bug is resolved, and
    the error handling is not again built into Pester.
- Changes to SqlSetup
  - Updated the integration test to stop the named instance while installing
    the other instances to mitigate issue #1260.
  • Loading branch information
johlju authored Jan 21, 2019
1 parent e8e14af commit 4f59191
Show file tree
Hide file tree
Showing 49 changed files with 749 additions and 654 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

## Unreleased

- Changes to SqlServerDsc
- Reverting the change that was made as part of the
[issue #1260](https://github.com/PowerShell/SqlServerDsc/issues/1260)
in the previous release, as it only mitigated the issue, it did not
solve the issue.
- Removed the container testing since that broke the integration tests,
possible due to using excessive amount of memory on the AppVeyor build
worker. This will make the unit tests to take a bit longer to run.
([issue #1260](https://github.com/PowerShell/SqlServerDsc/issues/1260)).
- The unit tests and the integration tests are now run in two separate
build workers in AppVeyor. One build worker runs the integration tests,
while a second build worker runs the unit tests. The build workers runs
in parallel on paid accounts, but sequentially on free accounts.
([issue #1260](https://github.com/PowerShell/SqlServerDsc/issues/1260)).
- Clean up error handling in some of the integration tests that was
part of a workaround for a bug in Pester. The bug is resolved, and
the error handling is not again built into Pester.
- Changes to SqlServiceAccount
- Fixed Get-ServiceObject when searching for Integration Services service.
Unlike the rest of SQL Server services, the Integration Services service
Expand All @@ -14,6 +31,10 @@
- Changes to SqlServerLogin
- Fixed issue in Test-TargetResource to valid password on disabled accounts.
([issue #915](https://github.com/PowerShell/SqlServerDsc/issues/915)).
- Changes to SqlSetup
- Updated the integration test to stop the named instance while installing
the other instances to mitigate
[issue #1260](https://github.com/PowerShell/SqlServerDsc/issues/1260).

## 12.2.0.0

Expand Down
48 changes: 10 additions & 38 deletions Tests/Integration/MSFT_SqlAlwaysOnService.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand All @@ -29,8 +35,6 @@ $TestEnvironment = Initialize-TestEnvironment `

#endregion

$script:integrationErrorMessagePrefix = 'INTEGRATION ERROR MESSAGE:'

$testRootFolderPath = Split-Path -Path $PSScriptRoot -Parent
Import-Module -Name (Join-Path -Path $testRootFolderPath -ChildPath (Join-Path -Path 'TestHelpers' -ChildPath 'CommonTestHelper.psm1')) -Force

Expand Down Expand Up @@ -82,15 +86,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $script:integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}
}
Expand Down Expand Up @@ -118,15 +114,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $script:integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}

Expand Down Expand Up @@ -170,15 +158,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $script:integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}

Expand Down Expand Up @@ -221,15 +201,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $script:integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand Down
57 changes: 11 additions & 46 deletions Tests/Integration/MSFT_SqlRS.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand All @@ -27,7 +33,6 @@ $TestEnvironment = Initialize-TestEnvironment `
-DSCResourceName $script:DSCResourceName `
-TestType Integration

$script:integrationErrorMessagePrefix = 'INTEGRATION ERROR MESSAGE:'
#endregion

$mockSqlInstallAccountPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force
Expand Down Expand Up @@ -76,15 +81,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}
}
Expand Down Expand Up @@ -112,15 +109,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}

Expand Down Expand Up @@ -212,15 +201,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}

Expand Down Expand Up @@ -276,15 +257,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}

Expand Down Expand Up @@ -349,15 +322,7 @@ try
ErrorAction = 'Stop'
}

try
{
Start-DscConfiguration @startDscConfigurationParameters
}
catch
{
Write-Verbose -Message ('{0} {1}' -f $integrationErrorMessagePrefix, $_) -Verbose
throw $_
}
Start-DscConfiguration @startDscConfigurationParameters
} | Should -Not -Throw
}
}
Expand Down
6 changes: 6 additions & 0 deletions Tests/Integration/MSFT_SqlScript.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand Down
6 changes: 6 additions & 0 deletions Tests/Integration/MSFT_SqlScriptQuery.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand Down
6 changes: 6 additions & 0 deletions Tests/Integration/MSFT_SqlServerLogin.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand Down
6 changes: 6 additions & 0 deletions Tests/Integration/MSFT_SqlServerNetwork.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand Down
6 changes: 6 additions & 0 deletions Tests/Integration/MSFT_SqlServerRole.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if (-not $env:APPVEYOR -eq $true)
return
}

if ($env:APPVEYOR -eq $true -and $env:CONFIGURATION -ne 'Integration')
{
Write-Verbose -Message ('Integration test for {0} will be skipped unless $env:CONFIGURATION is set to ''Integration''.' -f $script:DSCResourceName) -Verbose
return
}

#region HEADER
# Integration Test Template Version: 1.1.2
[String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
Expand Down
Loading

0 comments on commit 4f59191

Please sign in to comment.