All notable changes to this project will be documented in this file.
The format is based on and uses the types of changes according to Keep a Changelog, and this project adheres to Semantic Versioning.
PSSAResource.common.v4.Tests
- Only target source files.
PSSAResource.common.v5.Tests
- Only target source files.
MarkdownLinks.common.v4.Tests
- Only target source files and moduleroot.
MarkdownLinks.common.v5.Tests
- Only target source files and moduleroot.
Resolve-Dependency.psd1
- Enable ModuleFast and PSResourceGet.
build.yaml
- Add
BuiltModuleSubdirectory
and update task to suit.
- Add
Get-InvalidResultRecord.Tests
- Remove test that referenced previous alias
- Project files to latest community versions.
Resolve-Dependency.ps1
Required-Modules.psd1
GitVersion.yml
build.yml
- Migrated Unit/Integration tests to Pester 5.
Get-InvalidArgumentRecord
- Add function and test
build.psd1
as not required.cspell.json
Set-PSModulePath
- Not required as already in
DscResource.Common
fixes #145.
- Not required as already in
Get-SystemExceptionRecord
- Added private command fixes ([Issue #126]).
- Public command
Get-ObjectNotFoundRecord
- Use private function
Get-SystemExceptionRecord
.
- Use private function
QA/Localization.builtModule.v5.Tests
- Added new test for checking the localization strings are correct in the resource and strings.psd1 within the built module.
Get-ClassDefinitionAst
- Added helper function to get all class definition AST from a file.
Get-InvalidOperationRecord
- Use private function
Get-SystemExceptionRecord
.
- Use private function
Get-InvalidResultRecord
- Removed alias
Get-ObjectNotFoundRecord
and added as it's own public command.
- Removed alias
PSSAResource.common.v4.Tests
- Fixed rule suppression by using correct variable.
Test-FileContainsClassResource
- Add additional check for files that may only have a DscProperty within.
Test-FileContainsClassResource.Tests
- Update tests to check the class property declarations are matched.
QA/Localization.common.v5.Tests
- Just check remaining
psm1
files in the built module not covered byQA/Localization.builtModule.v5.Tests
.
- Just check remaining
azure-pipelines
- Pin gitversion to V5.
Restore-TestEnvironment
- A new parameter
KeepNewMachinePSModulePath
was added and only works if the test type isIntegration
orAll
. The new parameter will keep any new paths that was added to the machine environment variablePSModulePath
after the commandInitialize-TestEnvironment
was called. This is helpful if a a path is added by an integration test and is needed by a second integration test and there is a need to runRestore-TestEnvironment
between tests.
- A new parameter
- Added private function
Join-PSModulePath
that will concatenate two strings with semi-colon separated paths.
Initialize-TestEnvironment
- Now
$script:machineOldPSModulePath
is always set when called with the test typeIntegration
orAll
. Before it reverted to the paths on the eventOnRemove
that were the current paths whenInitialize-TestEnvironment
was first called. On subsequent calls any new paths were ignored. - If there are a subsequent call to
Initialize-TestEnvironment
without the commandRestore-TestEnvironment
was called prior the command will now fail with a non-terminating exception asking the user to runRestore-TestEnvironment
to avoid the previously saved paths ($script:machineOldPSModulePath
) to be overwritten.
- Now
- Updated pipeline to use the latest build and pipeline files from Sampler.
- Now the pipeline will fail if the Pester discovery phase fails. Prior if discovery failed the pipeline still passed (issue #112).
- Added support for examples for LCM Meta Configurations to
Test-ConfigurationName
(issue #116).
- Refactoring all tasks to initialise variable with
Set-SamplerTaskVariable
script (issue #110). - Now the data for the Pester containers are cloned to not hit the issue Using same data with two or more containers fail.
Wait-ForIdleLcm
- Added new parameter
Timeout
to be able to return after the specified elapsed time (issue #101).
- Added new parameter
- DscResource.Test
- Rename the default branch to
main
(issue #104). - Updated pipeline files, using the latest Sampler deploy tasks.
- Rename the default branch to
Wait-ForIdleLcm
- Updated to wait as long as the
LCMState
property has the state'Busy'
(issue #101). This will prevent the pipeline to loop indefinitely when an integration test fails and the propertyLCMState
is set toPendingConfiguration
.
- Updated to wait as long as the
Invoke_HQRM_Tests
- Fixed the task so it runs together with latest PowerShell module Sampler.
Fail_Build_If_HQRM_Tests_Failed
- Fixed the task so it runs together with latest PowerShell module Sampler.
- Added test helper functions
Get-InvalidResultRecord
andGet-InvalidOperationRecord
. - Added alias
Get-ObjectNotFoundRecord
that points toGet-InvalidResultRecord
. - Added build task
Invoke_HQRM_Tests
andFail_Build_If_HQRM_Tests_Failed
. - Added meta build task
Invoke_HQRM_Tests_Stop_On_Fail
that runs both build tasksInvoke_HQRM_Tests
andFail_Build_If_HQRM_Tests_Failed
in correct order. - New QA (HQRM) tests for Pester 5 was added that will only run if Pester 5.1 is used by the test pipeline.
- Added (converted) HQRM test for Pester 5
- Added
Changelog.common.v5.Tests.ps1
- Added
ExampleFiles.common.v5.Tests.ps1
- Added
FileFormatting.common.v5.Tests.ps1
- The individual test for checking BOM on markdown files was remove
and replaced by a test that checks for BOM on all text files (code,
configuration, and markdown). That also replaced the Pester 4 tests
ModuleFiles.common.v4.Tests.ps1
(that only checked for BOM on.psm1
files), andScriptFiles.common.v4.Tests.ps1
(that only checked for BOM on.ps1
files). No changes were made to the Pester 4 tests, just the Pester 5 tests.
- The individual test for checking BOM on markdown files was remove
and replaced by a test that checks for BOM on all text files (code,
configuration, and markdown). That also replaced the Pester 4 tests
- Added
MarkdownLinks.common.v5.Tests.ps1
- Added
ModuleManifest.common.v5.Tests.ps1
- Added
ModuleScriptFiles.common.v5.Tests.ps1
- Contain the converted Pester 4 tests from
Psm1Parsing.common.v4.Tests.ps1
.
- Contain the converted Pester 4 tests from
- Added
PSSAResource.common.v5.Tests.ps1
- Any test that is excluded by using Pester
ExcludeTag
under the keyDscTest:
will now be silently excluded due to how Pester does Discovery.
- Any test that is excluded by using Pester
- Added
PublishExampleFiles.v5.Tests.ps1
- Added
ResourceSchema.common.v5.Tests.ps1
- Added
- Added public function
Get-DscResourceTestContainer
which returns a Pester container for each available Pester 5 HQRM test.
- Renamed all existing QA (HQRM) tests to
*.v4.Tests.ps1*
and made them not run if test pipeline is using Pester 5. - The function
Get-TextFilesList
can now take an optional parameterFileExtension
to only return those files, e.g.@('.psm1')
. This makes the functionGet-Psm1FileList
obsolete. Get-DscResourceTestContainer
- Changed to support the new Pester 5 HQRM tests, and code for an older Pester 5 Beta iteration was removed.
- Added a
build.yaml
task scriptAdd_Aliases_To_Module_Manifest
that update module manifest with a list of aliases that is configured in thebuild.yaml
file under the keyAliasesToExport:
. This is quick fix for the issue Export alias create with Set-Alias and New-Alias.
- Fix issue with running pester 4 HQRM test after preview release
v0.15.0-preview0002
.
- Fix issue where the use of ScriptsToProcess causes the Initialize-TestEnvironment function to fail (issue #97).
- Now the path separators are handled correctly in the filter functions
WhereModuleFileNotExcluded
andWhereSourceFileNotExcluded
. - Updated cmdlet documentation in README.md.
- Fix Remove Test Manifest has Class based resource in nested modules - Fixes #85
- Fix deploy condition in
azure-pipelines.yml
so that it does not execute unless run from thedsccommunity
Azure DevOps org (issue #86).
- Fixed error in
Tests/QA/Changelog.common.Tests.ps1
when Describing Changelog Management (issue #81).
- Added support for passing alternate trunk branch name through to
Invoke-DscResourceTest.Tests.ps1
function (issue #82).
- Added logic to support Pester 4.
- Update build.yaml to support latest ModuleBuilder.
- Pinned required module Pester to 4.10.1.
- Update CONTRIBUTING.md.
- The cmdlet Invoke-DscResourceTest support running test in Pester 5.
- Fixed #71. Updated
Invoke-DscResourceTest
to handle multiple PSModuleInfo objects
- Added a test to check for the correct formatting of the Unreleased section in the Changelog.
- Updated the Azure DevOps Pipeline build agents to the supported versions
because the older
win1803
andvs2015-win2012r2
versions have been deprecated (issue #68).
- Fixed #66. Tests in 'ModuleManifest.common.Tests.ps1' in context 'Requirements for manifest of module with class-based resources' always fail.
- Update the cmdlet
Initialize-TestEnvironment
to allow setting up the environment when run in PowerShell 5.0. - Update the pipeline so the module will be tested on PowerShell 5.0 (Microsoft-hosted agent running Windows Server 2012 R2).
- Required PowerShell version was lowered to v5.0 in the module manifest.
- Azure Pipelines will no longer trigger on changes to just the CHANGELOG.md.
- Moved init code into Describe Block for PSSAResource and ResourceSchema Tests
- Updated QA tests to follow style guideline.
- Added new QA ExampleFiles test.
- Added new QA MarkdownLinks test.
- Added check on changelog when invoking by project path.
- Added a new test type,
All
, to theInitialize-TestEnvironment
function that initializes the DSC LCM and imports the module for testing (issue #48).
- Added an integration test to regression test integration tests failing
with
Security Error
(issue #38).
- The
Initialize-TestEnvironment
now takes two new parameters that sets the execution policy for machine and process. If these are not set then the execution policy will not be changed. - Updated
build.ps1
to the latest in the template. - Added LICENSE (fixes Issue #41).
- Added standard badges to README.MD (fixes Issue #43).
- Fixing the Relative path to make sure it calculates from it's ModuleBase.
- Used the right code of conduct for DSC Community.
- Fixed integration tests failing with the error
Security Error
(issue #38).
- Changed module manifest to include Tags, ProjectUri, LicenseUri, Logo and changed AliasesToExport to empty (fixes Issue #42).
- Changed Clear-DscLcmConfiguration to a public function so it can be called directly by resource modules (fixes Issue #40).
- Removed Deploy.PSDeploy.ps1 because it is not used (fixes Issue #44).
- Removed commented out code from DscResource.Test.psm1 file (fixes Issue #45).
- Added new QA Localization test, supporting excludes.
- Added new QA PublishExampleFiles test.
- Invoking the tests by ProjectPath (as well as per module).
- Fixed the Get-ChildItem -Depth 3 on Windows PS (needed -Name or it does not work).
- Re-added the check for Initialize-TestEnvironment to check if session elevated & OS.
- Added new QA Localization test.
- Temporarily remove Admin-check in
Initialize-TestEnvironment
. - Suppress output from function
Initialize-DscTestLcm
.
- Correctly detect Windows PowerShell in
Initialize-TestEnvironment
.
- Now skipping isAdmin on non-windows (because creds works differently)
- Moving spellcheck out of the tests
- Updating ScriptFiles tests to get different module base when from module or from project path
- Allow most test to optionally target Source files (under Project/SourceFolder)
- Enable excluding file by path relative to either ModuleBase (when specifying a module) or Source Path
- Added Public functions Initialize-TestEnvironment, New-DscSelfSignedCertificate, Restore-TestEnvironment
- Added Private functions Set-EnvironmentVariable, Set-PSModulePath, Clear-DscLcmConfiguration
- Added PSPKI as ExternalModuleDependencies when creating self signed certs on older OSes
- Created module from DscResource.Tests repository.
- Function Invoke-DscResourceTest is proxy to Invoke-Pester, with Sugar coating for the built-in tests.
- Added Secret Variables for releases and using DSC Bot account