From 372b5663668a4b8d372147c2be34108173c077ea Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 24 Jul 2020 18:10:02 +0100 Subject: [PATCH 1/2] Make CI fail if tests fail --- tools/appveyor.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 6b60ad326..c38877643 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -124,6 +124,7 @@ function Invoke-AppveyorTest { $configuration = [PesterConfiguration]::Default $configuration.CodeCoverage.Enabled = $false $configuration.Output.Verbosity = 'Normal' + $configuration.Run.Exit = $true $configuration.Run.PassThru = $true $configuration.Run.Path = $testScripts $configuration.TestResult.Enabled = $true From 6348d9097d04ae56ff3022c5a99eec2216841fe7 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 24 Jul 2020 18:23:37 +0100 Subject: [PATCH 2/2] Fix failing tests by making them Pester v5 compatible --- ...AvoidUsingDoubleQuotesForConstantString.tests.ps1 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Tests/Rules/AvoidUsingDoubleQuotesForConstantString.tests.ps1 b/Tests/Rules/AvoidUsingDoubleQuotesForConstantString.tests.ps1 index 558c67441..fcfab21bc 100644 --- a/Tests/Rules/AvoidUsingDoubleQuotesForConstantString.tests.ps1 +++ b/Tests/Rules/AvoidUsingDoubleQuotesForConstantString.tests.ps1 @@ -1,8 +1,10 @@ -$settings = @{ - IncludeRules = @('PSAvoidUsingDoubleQuotesForConstantString') - Rules = @{ - PSAvoidUsingDoubleQuotesForConstantString = @{ - Enable = $true +BeforeAll { + $settings = @{ + IncludeRules = @('PSAvoidUsingDoubleQuotesForConstantString') + Rules = @{ + PSAvoidUsingDoubleQuotesForConstantString = @{ + Enable = $true + } } } }