Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlMaxDop Fix for #396 #1644

Merged
merged 3 commits into from
Dec 10, 2020
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- SqlMaxDop
- Fixes ([issue #396](https://github.com/dsccommunity/SqlServerDsc/issues/396)).
Added three return values in Get-Target resource.

## [15.0.0] - 2020-12-06

### Added
Expand Down
12 changes: 7 additions & 5 deletions source/DSCResources/DSC_SqlMaxDop/DSC_SqlMaxDop.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ function Get-TargetResource
}

$returnValue = @{
InstanceName = $InstanceName
ServerName = $ServerName
MaxDop = $currentMaxDop
IsActiveNode = $isActiveNode
InstanceName = $InstanceName
ServerName = $ServerName
MaxDop = $currentMaxDop
IsActiveNode = $isActiveNode
ProcessOnlyOnActiveNode = $null
Ensure = $null
DynamicAlloc = $null
}

$returnValue
Expand Down Expand Up @@ -358,4 +361,3 @@ function Get-SqlDscDynamicMaxDop
$dynamicMaxDop
}

Export-ModuleMember -Function *-TargetResource
6 changes: 6 additions & 0 deletions tests/Unit/DSC_SqlMaxDop.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ try
$result.InstanceName | Should -Be $testParameters.InstanceName
}

It 'Should return $null for the remaining parameters' {
$result.ProcessOnlyOnActiveNode | Should -BeNullOrEmpty
$result.Ensure | Should -BeNullOrEmpty
$result.DynamicAlloc | Should -BeNullOrEmpty
}

It 'Should call the mock function Connect-SQL' {
Assert-MockCalled -CommandName Connect-SQL -Exactly -Times 1 -Scope Context
}
Expand Down