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.
- Added tag
AllowSuppressMessageAttributeto testShould not suppress the required ruleto allow usage ofSuppressMessageAttribute#135.
Localization.builtModule.v5- Add support for overridden keys in class-based resources issue #156.
- The tests now verify that keys used in the code file exist in the strings file, and that strings defined in the file exist in the instantiated class.
- Add support for overridden keys in class-based resources issue #156.
- Add workflow for GitHub Copilot Agent.
ModuleManifest.common.v5.Tests- Added compatibility test for
CmdletsToExportin modules with class-based DSC resources. The test validates that when a module contains class-based resources and hasCmdletsToExportspecified in the manifest, it must be set to '*' for compatibility with PSDesiredStateConfiguration 2.0.7. #165 - Updated the test that verifies that resources are exported in the module manifest to work cross-platform.
- Added a test to verify that the module manifest is valid.
- Added compatibility test for
- Add ability to filter out files in
ExampleFiles.common.v4#120. - Private function
Test-FileContainsClassResource- Refactored to correctly find class-based resources (including parameterized attributes) and to throw detailed parse errors with file and position information.
ExampleFiles.common.*skip if on PowerShell 6+ #169.
- Remove ModuleBuilder patch.
Changelog.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
ExampleFiles.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
- Suppress 'PSAvoidUsingConvertToSecureStringWithPlainText' ScriptAnalyzer rule.
- Remove array addition.
FileFormatting.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
- Remove array addition.
- Remove single use variable.
MarkdownLinks.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
- Remove array addition.
- Remove single use variable.
ModuleScriptFiles.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
- Remove array addition.
- Remove single use variable.
PSSAResource.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
- Remove array addition.
- Remove single use variable.
- Target all source files #163.
PublishExampleFiles.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
- Remove array addition.
- Remove single use variable.
RelativePathLength.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
- Remove array addition.
- Remove single use variable.
ResourceSchema.common.v5.Tests- Suppress 'PSUseDeclaredVarsMoreThanAssignments' ScriptAnalyzer rule.
- Remove array addition in following Public/Private functions.
Get-ClassResourceNameFromFileGet-ModuleScriptResourceNameGet-SuppressedPSSARuleNameListInvoke-DscResourceTestInvoke_HQRM_Tests.build
- Now the Markdown links test works with Pester 4.
ResourceSchema.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
PublishExampleFiles.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
ModuleManifest.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
Localization.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
Localization.builtModule.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
ExampleFiles.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
FileFormatting.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
MarkdownLinks.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
PSSAResource.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
RelativePathLength.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
ModuleScriptFiles.common.v5.Tests- Updated to support that Pester 6 no longer allowing empty arrays in ForEach by default.
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.
- Remove duplicate call to the same command
Resolve-Dependency.psd1- Enable ModuleFast and PSResourceGet.
build.yaml- Add
BuiltModuleSubdirectoryand update task to suit.
- Add
Get-InvalidResultRecord.Tests- Remove test that referenced previous alias
- Project files to latest community versions.
Resolve-Dependency.ps1Required-Modules.psd1GitVersion.ymlbuild.yml
- Migrated Unit/Integration tests to Pester 5.
Get-InvalidArgumentRecord- Add function and test
build.psd1as not required.cspell.jsonSet-PSModulePath- Not required as already in
DscResource.Commonfixes #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-ObjectNotFoundRecordand 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
psm1files 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
KeepNewMachinePSModulePathwas added and only works if the test type isIntegrationorAll. The new parameter will keep any new paths that was added to the machine environment variablePSModulePathafter the commandInitialize-TestEnvironmentwas 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-TestEnvironmentbetween tests.
- A new parameter
- Added private function
Join-PSModulePaththat will concatenate two strings with semi-colon separated paths.
Initialize-TestEnvironment- Now
$script:machineOldPSModulePathis always set when called with the test typeIntegrationorAll. Before it reverted to the paths on the eventOnRemovethat were the current paths whenInitialize-TestEnvironmentwas first called. On subsequent calls any new paths were ignored. - If there are a subsequent call to
Initialize-TestEnvironmentwithout the commandRestore-TestEnvironmentwas called prior the command will now fail with a non-terminating exception asking the user to runRestore-TestEnvironmentto 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-SamplerTaskVariablescript (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
Timeoutto 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
LCMStateproperty has the state'Busy'(issue #101). This will prevent the pipeline to loop indefinitely when an integration test fails and the propertyLCMStateis 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-InvalidResultRecordandGet-InvalidOperationRecord. - Added alias
Get-ObjectNotFoundRecordthat points toGet-InvalidResultRecord. - Added build task
Invoke_HQRM_TestsandFail_Build_If_HQRM_Tests_Failed. - Added meta build task
Invoke_HQRM_Tests_Stop_On_Failthat runs both build tasksInvoke_HQRM_TestsandFail_Build_If_HQRM_Tests_Failedin 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.psm1files), andScriptFiles.common.v4.Tests.ps1(that only checked for BOM on.ps1files). 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
ExcludeTagunder 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-DscResourceTestContainerwhich 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-TextFilesListcan now take an optional parameterFileExtensionto only return those files, e.g.@('.psm1'). This makes the functionGet-Psm1FileListobsolete. 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.yamltask scriptAdd_Aliases_To_Module_Manifestthat update module manifest with a list of aliases that is configured in thebuild.yamlfile 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
WhereModuleFileNotExcludedandWhereSourceFileNotExcluded. - 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.ymlso that it does not execute unless run from thedsccommunityAzure DevOps org (issue #86).
- Fixed error in
Tests/QA/Changelog.common.Tests.ps1when Describing Changelog Management (issue #81).
- Added support for passing alternate trunk branch name through to
Invoke-DscResourceTest.Tests.ps1function (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-DscResourceTestto 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
win1803andvs2015-win2012r2versions 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-TestEnvironmentto 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-TestEnvironmentfunction 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-TestEnvironmentnow 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.ps1to 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