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

BREAKING CHANGE: SqlServerDsc: Support Pester 5 #1550

Merged
merged 179 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
179 commits
Select commit Hold shift + click to select a range
067afa6
Converted to Pester 5
johlju May 16, 2020
99497de
Finished SqlProtocol
johlju Dec 18, 2020
ac330b6
Finished SqlProtocolTcpIp
johlju Dec 19, 2020
ebc15cd
Finished SqlAgentAlert
johlju Dec 20, 2020
8b98635
Finished SqlAgentFailsafe
johlju Dec 22, 2020
66326a4
Add helper function
johlju Dec 25, 2020
83300e2
Update CHANGELOG.md
johlju Dec 25, 2020
3b12b51
Finished SqlServerDsc.Common
johlju Dec 25, 2020
c191354
Remove $env:COMPUTERNAME
johlju Dec 26, 2020
afac571
Fix SqlAgentFailsafe
johlju Dec 27, 2020
01726d0
Finished SqlAgentOperator
johlju Dec 27, 2020
12d5246
Fix test for Update-AvailabilityGroupReplica
johlju Dec 30, 2020
8d90c6d
Finished SqlDatabaseMail
johlju Dec 31, 2020
67a21f2
Finished all integration tests
johlju Jan 3, 2021
24b0f4d
Fix integration tests
johlju Jan 3, 2021
d8ce6fc
Update build.yaml for new build task
johlju Jan 5, 2021
a93ac44
Fix correct path key in build.yaml
johlju Feb 10, 2021
3704511
Fix unit test module scope
johlju Feb 10, 2021
2bbcd65
Update pipeline
johlju Feb 10, 2021
cae967d
Fix code after rebase
johlju Mar 11, 2021
f4adfe8
Fix advanced Pester build configuration
johlju May 13, 2021
14fd0ce
Fix new VSCode settings
johlju Aug 18, 2021
2f0e779
Fix build yaml for new Pester release
johlju Aug 18, 2021
0cc98cb
Fix to control that build.ps1 has ran
johlju Aug 19, 2021
50ec53f
Add VS Code settings for Pester Test Adapter
johlju Aug 24, 2021
8b2e473
Add recommended VS Code extensions
johlju Aug 24, 2021
1d7990b
Update CHANGELOG.md
johlju Aug 24, 2021
2ede269
Start converting SqlRs unit tests
johlju Sep 4, 2021
9edfa2f
Fix integration tests for SqlRSSetup
johlju Sep 4, 2021
8fbb6d1
Fix integration tests to correctly load CommonTestHelper
johlju Sep 4, 2021
9a881c7
Fix tests for SqlServerDsc.AnalyzerRules
johlju Sep 4, 2021
989c321
Fix integration tests
johlju Sep 5, 2021
1b99ef2
Skip integration tests for SqlAlwaysOnService
johlju Sep 5, 2021
b1c5f37
Fix skip integration tests
johlju Sep 6, 2021
df9d2b6
Fix skip in integration tests
johlju Sep 6, 2021
ee2fd85
Fix skip test SqlRSSetup on SQL2016
johlju Sep 6, 2021
5ca0804
Use tag to run integration tests
johlju Sep 7, 2021
6ee4771
Fix pipline brown-out
johlju Sep 7, 2021
a345b38
Revert to ubuntu 16.04
johlju Sep 8, 2021
903d442
Switch to ubuntu-latest for deploy
johlju Sep 8, 2021
a9c121f
Update azure-pipelines.yml
johlju Sep 8, 2021
4523562
Fix default branch in places where variables are not working
johlju Sep 9, 2021
4d502df
Fix SqlRS unit test
johlju Sep 11, 2021
b5784ba
Remove unneccesary test code in SqlRS
johlju Sep 11, 2021
bd7ebf4
Update CHANGELOG.md
johlju Feb 18, 2022
f687d1e
Fix azure-pipelines.yml
johlju Feb 18, 2022
c6474c4
Remove debug file
johlju Feb 18, 2022
2182e0f
Fix style in SqlRS tests
johlju Feb 19, 2022
c67801d
Finish unit test for SqlRSSetup
johlju Feb 19, 2022
f4ea465
Fix codacy issue in tests for SqlRSSetup
johlju Feb 19, 2022
07d0734
Use ForEach for testcases in SqlRSSetup tests
johlju Feb 20, 2022
fe4cba1
SqlAlias: passes strict mode during unit testing
johlju Feb 20, 2022
c7f3d66
Fix unit tests for SqlAlias Get-function
johlju Feb 20, 2022
380db81
Fix slash in analyzersettings.psd1 for xplat
johlju Feb 20, 2022
d94174f
Suppress script analyzer rules in unit test for SqlRSSetup
johlju Feb 20, 2022
d294cb0
Include additonal rule settings for Script Analyzer
johlju Feb 20, 2022
57c15d2
Add known word for cSpell
johlju Feb 20, 2022
baf459a
Turn off legacy Pester code lens
johlju Feb 20, 2022
5e0d3ea
Fix a bug in Test-TargetResource using UseDynamicTcpPort
johlju Feb 21, 2022
e8d6808
Fix unit tests for SqlAlias Test-function
johlju Feb 21, 2022
4b23538
Fix ScriptAnalyzer rules in unit tests
johlju Feb 22, 2022
3ae76ad
Fix unit test for SqlAlias
johlju Feb 22, 2022
3964369
Fix unit test for SqlAlwaysOnService
johlju Feb 22, 2022
eadc6ab
Fix unit test for SqlConfiguration
johlju Feb 22, 2022
5e2e94b
Remove Pester 4 tests from the discovery until they are converted
johlju Feb 22, 2022
044b0be
Fix bug for SqlAgentOperator to get correct code coverage
johlju Feb 22, 2022
9c5bdd0
Improved the verification of an empty description in SqlDatabaseMail
johlju Feb 22, 2022
9dd63b7
Improved code coverage in SqlConfiguration and SqlDatabaseMail
johlju Feb 22, 2022
fec4f2d
Remove commented code
johlju Feb 23, 2022
e560074
Fix unit tests for SqlDatabase
johlju Feb 23, 2022
e209f15
Fix style in tests for SqlDatabase
johlju Feb 25, 2022
86035da
Fix unit tests for SqlDatabaseDefaultLocation
johlju Feb 25, 2022
3bb7b00
Fix unit tests for SqlDatabaseObjectPermission
johlju Feb 25, 2022
8cfec84
Fix Get- and Test-function unit tests for SqlDatabasePermission
johlju Feb 25, 2022
41dda41
Fix unit test for SqlDatabasePermission
johlju Feb 26, 2022
eae6c78
Fix initialization of variables
johlju Feb 26, 2022
efae2c8
Fix unit tests for Get-function for SqlDatabaseRole
johlju Feb 26, 2022
032f297
Finish unit tests for SqlDatabaseRole
johlju Feb 27, 2022
135152a
Fix unit tests for SqlDatabaserUser
johlju Mar 5, 2022
8fdb71c
Fix Test in unit test for SqlEndpoint
johlju Mar 7, 2022
e495d3b
Fix unit test for SqlEndpoint
johlju Mar 9, 2022
89f0a2b
Fix settings.json
johlju Mar 9, 2022
b42516c
Fix variable naming in test
johlju Mar 10, 2022
ef1ff71
Fix CommonTestHelper
johlju Mar 12, 2022
ff7c088
Remove extra blank rows
johlju Mar 12, 2022
da207fa
Fix verbose messages and style
johlju Mar 12, 2022
1e43a94
Fix unit tests for SqlEndpointPermission
johlju Mar 12, 2022
f5f79f2
No longer evaluates optional parameter LoginType
johlju Mar 13, 2022
a9162ef
Started with unit test SqlLogin (waiting on pending PR)
johlju Mar 13, 2022
56b6fc5
Update SqlServerDsc analyzer rules test
johlju Mar 13, 2022
66f36c2
SqlLogin: Only enforces optional parameters when in configuration
johlju Mar 14, 2022
37a69ca
VS Code extension Pester Test Adapter should not run in new process
johlju Mar 14, 2022
1bef3a1
Add unit tests for Get and Test for SqlLogin
johlju Mar 14, 2022
520584f
Remove mock properties in stub class Login
johlju Mar 19, 2022
d5c84d2
Update correct parameter name in SqlLogin
johlju Mar 19, 2022
daaf3a1
Fix error message string
johlju Mar 19, 2022
b1f57a0
Fix unit tests for SqlLogin
johlju Mar 19, 2022
2d22d6a
Add SQL login integration test for resource SqlLogin
johlju Mar 19, 2022
1744d83
Fix SqlLogin integraiton tests
johlju Mar 19, 2022
837c832
Fix SqlLogin integration tests
johlju Mar 19, 2022
489bc4c
Fix integration tests SqlLogin
johlju Mar 19, 2022
44ca8a5
Add more integration tests SqlLogin
johlju Mar 20, 2022
cca9094
Fix integration tests SqlLogin
johlju Mar 20, 2022
785da90
Update README for SqlLogin
johlju Mar 20, 2022
5eb36a0
Add integration tests SqlLogin
johlju Mar 20, 2022
aafe0e4
Fix SqlLogin to correctly enforce parameters
johlju Mar 20, 2022
083b2b0
Fix integration tests SqlLogin
johlju Mar 21, 2022
9506a71
SqlMaxDop: Initialize variables in Get-funcion
johlju Mar 21, 2022
7a20484
Fix BeforeDiscovery block
johlju Mar 24, 2022
23e5043
Fix context-block descriptions
johlju Mar 24, 2022
cbeabd8
Fix comment
johlju Mar 24, 2022
e58bdfe
Fix bugs in SqlMaxDop
johlju Mar 25, 2022
5c047bb
Add setting for using relative path to Pester module
johlju Mar 25, 2022
9a1a79f
Fix unit tests for Test in SqlMaxDop
johlju Mar 25, 2022
e41549a
Fix unit test for SqlMaxDop
johlju Mar 26, 2022
86d6a7e
Remove commented code
johlju Mar 26, 2022
8f4d554
Fix unit tests SqlMaxDop
johlju Mar 26, 2022
b329296
Fix SqlMemory bugs
johlju Mar 26, 2022
a846a90
Fix unit tests for Get and Test for SqlMemory
johlju Mar 26, 2022
3d8fe02
Fix unit test for SqlMemory
johlju Mar 27, 2022
0268eda
Fix Set-function so it possible to just sset MinMemory
johlju Mar 27, 2022
d449dbd
Add additional unit tests for SqlMemory
johlju Mar 27, 2022
116d657
Fix unit test SqlPermission
johlju Mar 27, 2022
3a24d6f
Add unit test for SqlReplication
johlju Mar 27, 2022
20d4627
Fix unit test SqlRole
johlju Mar 29, 2022
292b117
Fix SqlLogin after rebase
johlju Mar 31, 2022
a65f08d
Fix azure-pipelines
johlju Mar 31, 2022
10af6c0
Fix integration tests SqlLogin
johlju Mar 31, 2022
2ec24e6
Fix integration tests SqlLogin
johlju Apr 1, 2022
f5e6bf7
Add path for test results for the HQRM tests
johlju Apr 1, 2022
0bd7632
Fix unit test for SqlScript
johlju Apr 1, 2022
612d637
Fix unit test for SqlScriptQuery
johlju Apr 1, 2022
cb464b7
BREAKING CHANGE: Fix SqlSecureConnection return 'Empty'
johlju Apr 2, 2022
2bbf3cb
Fix unit test SqlSecureConnection
johlju Apr 2, 2022
01f6869
Fix path settings.json
johlju Apr 5, 2022
600ce7f
Fix pipeline so code coverage is published on fail
johlju Apr 5, 2022
461950d
Fix azure pipelines
johlju Apr 5, 2022
275c1ff
Fix unit test for SqlServiceAccount
johlju Apr 7, 2022
08d9b9f
Fix VSCode settings for Pester Test Adapter
johlju Apr 7, 2022
5aad48e
Fix artifact name
johlju Apr 7, 2022
e5d6e1e
Fix azure pipelines
johlju Apr 7, 2022
361e644
Fix azure-pipelines
johlju Apr 7, 2022
8d1be1d
Fix unit test for Get for SqlTraceFlag
johlju Apr 7, 2022
70726aa
Fix unit test SqlTraceFlag
johlju Apr 9, 2022
b87239f
Fix unit test for SqlWaitForAG
johlju Apr 10, 2022
ba851a0
Fix SqlWindowsFirewall
johlju Apr 11, 2022
9ca41e5
Fix Get in unit test for SqlWindowsFirewall
johlju Apr 11, 2022
ebc2c34
Fix verbose message in SqlWIndowsFirewall
johlju Apr 13, 2022
673c4e7
Remove unnecessary logic in SqlWindowsFirewall
johlju Apr 13, 2022
cc8dae2
Fix unit test SqlWindowsFirewall
johlju Apr 13, 2022
a240d92
Made path ISO image available in environment variable
johlju Apr 14, 2022
b92d577
Add integration tests SqlWindowsFirewall
johlju Apr 14, 2022
4bc544a
Fix integration test SqlWindowsFirewall
johlju Apr 14, 2022
b185c72
Fix integration test SqlWindowsFirewall
johlju Apr 14, 2022
052776f
Fix integration tests SqlWindowsFirewall
johlju Apr 14, 2022
fcefdd5
Fix integration test SqlWindowsFirewall
johlju Apr 14, 2022
d83d6db
Fix SqlRS to restart service (issue #1721)
johlju Apr 14, 2022
4e870a3
Fix unit test for SqlRS
johlju Apr 14, 2022
02f587d
Remove commented code taht was missed
johlju Apr 16, 2022
4aa6b2c
Update Home wikpage to remove deprecated resources
johlju Apr 23, 2022
5ddd0d8
Fix Get in unit tests for SqlSetup
johlju Apr 24, 2022
053567c
Fix unit tests for SqlSetup
johlju Apr 25, 2022
8061d34
Fix SqlSetup to handle strict mode
johlju Apr 28, 2022
b1c00be
Fix unit test SqlSetup
johlju Apr 28, 2022
5582699
Adding meta task for pester run times until task i merged i Sampler
johlju Apr 28, 2022
31ab729
Started fixing unit test for SqlAGListener
johlju May 6, 2022
f00b7d7
FIx unit test SqlAGListener
johlju May 6, 2022
2a4b567
Fick unit tests for Test-TargetResurce for SqlAGListener
johlju May 6, 2022
644d0e5
Adding verbose messages to SqlRS
johlju May 7, 2022
984ccab
Fix code in SqlAGListener
johlju May 7, 2022
f280c45
Fix unit test SqlAGListener
johlju May 7, 2022
471de3b
Fix task Pester Run Times
johlju May 7, 2022
3967b42
Remove localized string
johlju May 14, 2022
97a400a
Removing metatask since it has been merged into Sampler
johlju May 14, 2022
ba68692
Fix unit test
johlju Jun 6, 2022
86b2c23
Fix unit test after rebase
johlju Jun 6, 2022
72762f2
Fix cross-plattform tests (#17)
johlju Jun 6, 2022
a9776e4
update changelog
johlju Jun 6, 2022
794887c
Fix comment
johlju Jun 6, 2022
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
8 changes: 4 additions & 4 deletions .vscode/analyzersettings.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@{
CustomRulePath = @(
'.\output\RequiredModules\DscResource.AnalyzerRules'
'.\tests\QA\AnalyzerRules\SqlServerDsc.AnalyzerRules.psm1'
'./output/RequiredModules/DscResource.AnalyzerRules'
'./tests/QA/AnalyzerRules/SqlServerDsc.AnalyzerRules.psm1'
)
IncludeDefaultRules = $true
IncludeRules = @(
Expand Down Expand Up @@ -55,14 +55,14 @@
Rules = @{
PSUseConsistentWhitespace = @{
Enable = $true
CheckOpenBrace = $false
CheckOpenBrace = $true
CheckInnerBrace = $true
CheckOpenParen = $true
CheckOperator = $false
CheckSeparator = $true
CheckPipe = $true
CheckPipeForRedundantWhitespace = $true
CheckParameter = $false
CheckParameter = $true
}

PSPlaceOpenBrace = @{
Expand Down
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"davidanson.vscode-markdownlint",
"pspester.pester-test",
"ms-vscode.powershell"
]
}
14 changes: 12 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

{
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterOpenBrace": true,
Expand Down Expand Up @@ -33,10 +34,19 @@
"keepachangelog",
"notin",
"pscmdlet",
"steppable"
"steppable",
"SSRS"
],
"[markdown]": {
"files.trimTrailingWhitespace": true,
"files.encoding": "utf8"
}
},
"powershell.pester.useLegacyCodeLens": false,
"pester.testFilePath": [
"[tT]ests/[uU]nit/*.[tT]ests.[pP][sS]1"
],
"pester.runTestsInNewProcess": false,
"pester.pesterModulePath": "./output/RequiredModules/Pester",
"powershell.pester.codeLens": true,
"pester.suppressCodeLensNotice": true
}
150 changes: 140 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Changes to SqlAGDatabase
- Added StatementTimeout optional parameter with default value of 600 seconds (10 mins) to SqlAGDatabase to fix Issue#1743
Users will be able to specify the backup and restore timeout with it.
- Changes to SqlDatabaseUser
- `Test-TargetResource` returns true if the `IsUpdateable` property of the database is `$false` to resolve Issue#1748.
- Changes to SqlDatabaseRole
- `Test-TargetResource` returns true if the `IsUpdateable` property of the database is `$false` to resolve Issue#1750.

### Removed

- The deprecated DSC resource SqlDatabaseOwner have been removed _(and replaced_
Expand All @@ -28,24 +20,112 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
_[**SqlProtocol**](https://github.com/dsccommunity/SqlServerDsc/wiki/sqlprotocol)_
_and [**SqlProtocolTcpIp**](https://github.com/dsccommunity/SqlServerDsc/wiki/sqlprotocoltcpip))_
([issue #1725](https://github.com/dsccommunity/SqlServerDsc/issues/1725)).
- CommonTestHelper
- Remove the helper function `Wait-ForIdleLcm` since it has been moved
to the module _DscResource.Test_.
- Remove the helper function `Get-InvalidOperationRecord` since it has
been moved to the module _DscResource.Test_.
- Remove the helper function `Get-InvalidResultRecord` since it has been
moved to the module _DscResource.Test_.

### Added

- SqlServerDsc
- Added recommended VS Code extensions.
- Added settings for VS Code extension _Pester Test Adapter_.
- CommonTestHelper
- `Import-SqlModuleStub`
- Added the optional parameter **PasThru** that, if used, will return the
name of the stub module.
- When removing stub modules from the session that is not supposed to
be loaded, it uses `Get-Module -All` to look for previously loaded
stub modules.
- `Remove-SqlModuleStub`
- Added a new helper function `Remove-SqlModuleStub` for tests to remove
the PowerShell SqlServer stub module when a test has run.
- SqlWindowsFirewall
- Added integration tests for SqlWindowsFirewall ([issue #747](https://github.com/dsccommunity/SqlServerDsc/issues/747)).

### Changed

- SqlServerDsc
- Updated pipeline to use the build worker image 'ubuntu-latest'.
- Switch to installing GitVersion using 'dotnet tool install' ([issue #1732](https://github.com/dsccommunity/SqlServerDsc/issues/1732)).
- Bumped Stale task to v5 in the GitHub workflow.
- Make it possible to publish code coverage on failed test runs, and
when re-run a fail job.
- Wiki
- add introduction and links to DSC technology
- SqlLogin
- BREAKING CHANGE: `LoginMustChangePassword`, `LoginPasswordExpirationEnabled` and `LoginPasswordPolicyEnforced`
parameters no longer enforce default values ([issue #1669](https://github.com/dsccommunity/SqlServerDsc/issues/1669)).
- BREAKING CHANGE: The parameters `LoginMustChangePassword`, `LoginPasswordExpirationEnabled`,
and `LoginPasswordPolicyEnforced` no longer have a default value of `$true`.
This means that when creating a new login, and not specifically setting
these parameters to `$true` in the configuration, the login that is created
will have these properties set to `$false`.
- BREAKING CHANGE: `LoginMustChangePassword`, `LoginPasswordExpirationEnabled`,
and `LoginPasswordPolicyEnforced` parameters no longer enforce default
values ([issue #1669](https://github.com/dsccommunity/SqlServerDsc/issues/1669)).
- SqlServerDsc
- All tests have been converted to run in Pester 5 (Pester 4 can no
longer be supported) ([issue #1654](https://github.com/dsccommunity/SqlServerDsc/issues/1654)).
- Pipeline build and deploy now runs on Ubuntu 18.04, see more information
in https://github.com/actions/virtual-environments/issues/3287.
- Update the pipeline file _azure-pipelines.yml_ to use the latest version
from the Sampler project.
- SqlRs
- BREAKING CHANGE: Now the Reporting Services is always restarted after
the call to CIM method `SetDatabaseConnection` when setting up the
Reporting Services. This so to try to finish the initialization of
Reporting Services. This was prior only done for _SQL Server Reporting_
_Services 2019_ ([issue #1721](https://github.com/dsccommunity/SqlServerDsc/issues/1721)).
- Added some verbose messages to better indicate which CIM methods are run
and when they are run.
- Minor refactor to support running unit test with strict mode enabled.
- SqlLogin
- Only enforces optional parameter `LoginType` when it is specified in the
configuration.
- Only enforces optional parameters `LoginPasswordExpirationEnabled` and
`LoginPasswordPolicyEnforced` for a SQL login when the parameters are
specified in the configuration.
- A localized string for an error message was updated to correctly reflect
the code that says that to use a SQL login the authentication mode must
be either Mixed or Normal, prio it just stated Mixed.
- SqlSecureConnection
- BREAKING CHANGE: Now `Get-TargetResource` returns the value `'Empty'`
for the property thumbprint if there is no thumbprint set in the current
state. Returning the value `'Empty'` was always intended, but it due to
a bug it was never returned, but instead it returned an empty string
or `$null` value.
- SqlWindowsFirewall
- Now the property Features always return the features in the order
'SQLENGINE', 'RS', 'AS', and 'IS' if they are installed.
- SqlAGListener
- Removed unnecessary exception that is very unlikely to be thrown in
`Set-TargetResource` and `Test-TargetResource`.
- Simplified the logic that checks if the properties are in desired state
as the new unit tests did not pass with the previous logic.
- Updated the verbose message when the listener does not exist to write
out the name of the listener that is meant to be updated, added, or
dropped.
- Only update values for the properties that are actually enforced by the
configuration.
- SqlAGDatabase
- Added StatementTimeout optional parameter with default value of 600 seconds (10 mins) to SqlAGDatabase to fix Issue#1743
Users will be able to specify the backup and restore timeout with it.
- SqlDatabaseUser
- `Test-TargetResource` returns true if the `IsUpdateable` property of the database is `$false` to resolve Issue#1748.
- SqlDatabaseRole
- `Test-TargetResource` returns true if the `IsUpdateable` property of the database is `$false` to resolve Issue#1750.

### Fixed

- SqlServerDsc
- URLs the referenced TechNet in the documentation has been update to link to
new pages at docs.microsoft.com.
- Fix pipeline so code coverage is published on fail.
- CommonTestHelper
- The test helper function `Import-SqlModuleStub` was using wrong casing for
one of the stub modules which failed test when running cross plattform.
- SqlDatabaseObjectPermission
- Fix for issue ([issue #1724](https://github.com/dsccommunity/SqlServerDsc/issues/1724)).
- BREAKING CHANGE: Updated class DSC_DatabaseObjectPermission.
Expand All @@ -55,6 +135,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SqlProtocolTcpIp
- Output verbose information in integration tests so it is shown what NICs
are available and what IP address the tests will use.
- SqlAlias
- Now the code passes strict mode during unit testing.
- When an existing alias existed with a static TCP port but the desired
state was to have a dynamic port, the function `Test-TargetResource` did
not correctly return `$false`. Same for an alias that existed with a
dynamic port but the desired state was to have a static port. Now the
function `Test-TargetResource` returns `$false` in both these scenarios.
- SqlAgentOperator
- In a certain case the `Test-TargetResource` function returned the wrong
verbose message. If passing an e-mail address and the operator did not
exist it would wrongly say operator exist but had wrong e-mail address.
Truth was that the operator did not exist at all.
- SqlDatabaseMail
- Improved the verification of an empty description so that it can handle
both empty string and `$null`.
- SqlDatabaseRole
- Some variables where not initialized correctly which was discovered when
running the unit tests using strict mode. Now the variables are initialized
and should not cause any issues in the object returned from the function
`Get-TargetResource`.
- SqlEndpointPermission
- Verbose messages did not use the correct variable name, so the messages
did not contain the correct information.
- Minor style guideline changes.
- SqlMaxDop
- The function `Get-TargetResource` did not initialize some of the variables
correctly which was discovered when running the unit tests using strict
mode.
- The function `Test-TargetResource` did not correctly evaluate if the
node was the active node..
- SqlMemory
- Now it possible to just set the minimum memory without it throwing because
the maximum memory is not specified.
- In a certain scenario the maximum memory would be enforced even if it was
not specified in the configuration.
- SqlWindowsFirewall
- Now the variables in `Get-TargetResource` are correctly initialized so
they pass the new unit test that use strict mode.
- The verbose message in `Test-TargetResource` did not use the correct
variable name, so the message did not contain the correct information.
- Removed unnecessary logic in `Set-TargetResource` that did just evaluated
the same thing that the call to function `Get-TargetResource` already
does.
- SqlSetup
- Now the variables in `Set-TargetResource` are correctly initialized so
they pass the new unit test that use strict mode.
- Some verbose messages in `Get-TargetResource` wrongly reference a variable
that was not available.
- The loop that evaluates what features are installed did an unnecessary
step for each iteration. A line of code was moved outside of the loop.

## [15.2.0] - 2021-09-01

Expand Down
2 changes: 1 addition & 1 deletion RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
Pester = '4.10.1'
Pester = 'latest'
Plaster = 'latest'
ModuleBuilder = 'latest'
ChangelogManagement = 'latest'
Expand Down
29 changes: 20 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ trigger:
- "v*"
exclude:
- "*-*"

variables:
buildFolderName: output
buildArtifactName: output
testResultFolderName: testResults
testArtifactName: testResults
testArtifactName: 'testResults_$(System.JobAttempt)'
sourceFolderName: source
defaultBranch: main

stages:
- stage: Build
Expand Down Expand Up @@ -69,7 +71,13 @@ stages:
- pwsh: |
# Workaround for issue https://github.com/dsccommunity/DscResource.Test/issues/100
./build.ps1 -Task noop
Invoke-Pester -Script .\tests\QA -EnableExit
$pesterConfig = New-PesterConfiguration
$pesterConfig.Run.Path = '.\tests\QA'
$pesterConfig.Run.Throw = $true
$pesterConfig.Output.Verbosity = 'Detailed'
Invoke-Pester -Configuration $pesterConfig
name: qualitytest
displayName: 'Run SqlServerDsc QA Test'
- task: PowerShell@2
Expand All @@ -84,7 +92,7 @@ stages:
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'HQRM'

- job: Test_Unit
Expand All @@ -104,7 +112,7 @@ stages:
displayName: 'Run Unit Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Unit'"
arguments: "-Tasks test -PesterPath 'tests/Unit'"
pwsh: true
- task: PublishTestResults@2
displayName: 'Publish Test Results'
Expand All @@ -115,6 +123,7 @@ stages:
testRunTitle: 'Unit (Windows Server 2019)'
- task: PublishPipelineArtifact@1
displayName: 'Publish Test Artifact'
condition: succeededOrFailed()
inputs:
targetPath: '$(buildFolderName)/$(testResultFolderName)/'
artifactName: $(testArtifactName)
Expand Down Expand Up @@ -165,7 +174,7 @@ stages:
script: 'winrm quickconfig -quiet'
pwsh: false
- powershell: |
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterScript @(
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
# Run the integration tests in a specific group order.
# Group 1
'tests/Integration/DSC_SqlSetup.Integration.Tests.ps1'
Expand All @@ -189,6 +198,7 @@ stages:
# Group 4
'tests/Integration/DSC_SqlScript.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1'
'tests/Integration/DSC_SqlWindowsFirewall.Integration.Tests.ps1'
# Group 5
'tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1'
'tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1'
Expand All @@ -210,6 +220,7 @@ stages:
- job: Code_Coverage
displayName: 'Publish Code Coverage'
dependsOn: Test_Unit
condition: succeededOrFailed()
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 0
Expand Down Expand Up @@ -275,8 +286,8 @@ stages:
env:
GitHubToken: $(GitHubToken)
GalleryApiToken: $(GalleryApiToken)
ReleaseBranch: main
MainGitBranch: main
ReleaseBranch: $(defaultBranch)
MainGitBranch: $(defaultBranch)
- task: PowerShell@2
name: sendChangelogPR
displayName: 'Send Changelog PR'
Expand All @@ -286,5 +297,5 @@ stages:
pwsh: true
env:
GitHubToken: $(GitHubToken)
ReleaseBranch: main
MainGitBranch: main
ReleaseBranch: $(defaultBranch)
MainGitBranch: $(defaultBranch)
Loading