diff --git a/CHANGELOG.md b/CHANGELOG.md index 21a3916..0084f49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated pipeline to use the latest build and pipeline files from Sampler. +### Fixed + +- Now the pipeline will fail if the Pester discovery phase fails. Prior + if discovery failed the pipeline still passed ([issue #112](https://github.com/dsccommunity/DscResource.Test/issues/112)). + ## [0.16.0] - 2021-09-11 ### Added diff --git a/source/tasks/Invoke_HQRM_Tests.build.ps1 b/source/tasks/Invoke_HQRM_Tests.build.ps1 index 2977172..2df3634 100644 --- a/source/tasks/Invoke_HQRM_Tests.build.ps1 +++ b/source/tasks/Invoke_HQRM_Tests.build.ps1 @@ -485,4 +485,13 @@ task Invoke_HQRM_Tests { $DscTestResultObjectCliXml = Join-Path -Path $DscTestOutputFolder -ChildPath "DscTestObject_$DscTestOutputFileFileName" $null = $script:testResults | Export-CliXml -Path $DscTestResultObjectCliXml -Force + + <# + Verify so that all containers (discovery phase) ran and all tests passed, + if not make sure the test pipeline correctly fails. + #> + if ($script:testResults.Result -eq 'Failed') + { + throw 'Pester reported failure. Tests did not pass.' + } }