Skip to content

Commit

Permalink
SqlServerDsc: Enabled PSSA rule violations to fail build (dsccommunit…
Browse files Browse the repository at this point in the history
…y#1102)

- Changes to SqlServerDsc
  - Enabled PSSA rule violations to fail build in the CI environment.
- Changes to SqlSetup
  - Fixed Script Analyzer rule error.
- Changes to SqlServerDatabaseMail
  - Fixed Script Analyzer rule error.
  • Loading branch information
johlju authored Apr 22, 2018
1 parent 4c84907 commit 794ea7c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .MetaTestOptIn.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"Common Tests - Validate Markdown Files",
"Common Tests - Validate Module Files",
"Common Tests - Validate Script Files",
"Common Tests - Validate Example Files"
]
"Common Tests - Validate Example Files",
"Common Tests - Required Script Analyzer Rules",
"Common Tests - New Error-Level Script Analyzer Rules",
"Common Tests - Custom Script Analyzer Rules"
]
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- **Remove-IntegrationLoopbackAdapter:** Removes a new network loopback adapter.
- **Get-NetIPAddressNetwork:** Returns the IP network address from an IPv4 address
and prefix length.
- Enabled PSSA rule violations to fail build in the CI environment.
- Changes to Unit Tests
- [Michael Fyffe (@TraGicCode)](https://github.com/TraGicCode): Updated
the following resources unit test template to version 1.2.1
Expand All @@ -23,6 +24,7 @@
- Updated the integration tests to stop some services after each integration test.
This is to save memory on the AppVeyor build worker.
- Updated the integration tests to use a SQL Server 2016 Service Pack 1.
- Fixed Script Analyzer rule error.
- Changes to SqlRS
- Updated the integration tests to stop the Reporting Services service after
the integration test. This is to save memory on the AppVeyor build worker.
Expand All @@ -31,6 +33,8 @@
- Changes to SqlServiceAccount
- Updated the integration tests to stop some services after each integration test.
This is to save memory on the AppVeyor build worker.
- Changes to SqlServerDatabaseMail
- Fixed Script Analyzer rule error.

## 11.1.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ function Set-TargetResource
{
if ($Ensure -eq 'Present')
{

$databaseMailEnabledRunValue = $sqlServerObject.Configuration.DatabaseMailEnabled.RunValue
if ($databaseMailEnabledRunValue -eq 1)
{
Expand Down
4 changes: 2 additions & 2 deletions DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,6 @@ function Set-TargetResource

if ($Features.Contains('SQLENGINE'))
{

if ($PSBoundParameters.ContainsKey('SQLSvcAccount'))
{
$setupArguments += (Get-ServiceAccountParameters -ServiceAccount $SQLSvcAccount -ServiceType 'SQL')
Expand Down Expand Up @@ -1842,7 +1841,8 @@ function Test-TargetResource
$boundParameters.Keys | Where-Object {$_ -imatch "^FailoverCluster"} | ForEach-Object {
$variableName = $_

if ($getTargetResourceResult.$variableName -ne $boundParameters[$variableName]) {
if ($getTargetResourceResult.$variableName -ne $boundParameters[$variableName])
{
Write-Verbose -Message ($script:localizedData.ClusterParameterIsNotInDesiredState -f $variableName, $($boundParameters[$variableName]))
$result = $false
}
Expand Down

0 comments on commit 794ea7c

Please sign in to comment.