From 3c8a03bd5ef6e5d96cfffd871be0fdf17f18d8ab Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Sun, 29 Mar 2020 22:45:26 +1100 Subject: [PATCH] Properly fail pipeline when Pester tests fail. [skip ci] --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 734bcef..0bc5543 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,8 +77,8 @@ stages: Set-Location -Path '$(Pipeline.Workspace)' Invoke-Pester -EnableExit -OutputFile "$(System.DefaultWorkingDirectory)/Test-Pester-Mac.xml" -OutputFormat NUnitXML displayName: Pester - continueOnError: true - task: PublishTestResults@2 + condition: succeededOrFailed() inputs: testResultsFormat: 'NUnit' testResultsFiles: 'Test-Pester-Mac.xml' @@ -106,8 +106,8 @@ stages: Set-Location -Path '$(Pipeline.Workspace)' Invoke-Pester -EnableExit -OutputFile "$(System.DefaultWorkingDirectory)/Test-Pester-Ubuntu.xml" -OutputFormat NUnitXML displayName: Pester - continueOnError: true - task: PublishTestResults@2 + condition: succeededOrFailed() inputs: testResultsFormat: 'NUnit' testResultsFiles: 'Test-Pester-Ubuntu.xml' @@ -135,8 +135,8 @@ stages: Set-Location -Path '$(Pipeline.Workspace)' Invoke-Pester -EnableExit -OutputFile "$(System.DefaultWorkingDirectory)/Test-Pester-Win2019.xml" -OutputFormat NUnitXML displayName: Pester - continueOnError: true - task: PublishTestResults@2 + condition: succeededOrFailed() inputs: testResultsFormat: 'NUnit' testResultsFiles: 'Test-Pester-Win2019.xml' @@ -164,8 +164,8 @@ stages: Set-Location -Path '$(Pipeline.Workspace)' Invoke-Pester -EnableExit -OutputFile "$(System.DefaultWorkingDirectory)/Test-Pester-Win2016.xml" -OutputFormat NUnitXML displayName: Pester - continueOnError: true - task: PublishTestResults@2 + condition: succeededOrFailed() inputs: testResultsFormat: 'NUnit' testResultsFiles: 'Test-Pester-Win2016.xml'