From d25beccbb6bd2f019850153fda3dbbe5620a2636 Mon Sep 17 00:00:00 2001 From: Matt Fellows Date: Fri, 6 Mar 2020 15:31:47 +1100 Subject: [PATCH] build(windows): fail build if commands fail, because, Windows --- scripts/pact.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/pact.ps1 b/scripts/pact.ps1 index abe21e64a..5dc92dc1f 100644 --- a/scripts/pact.ps1 +++ b/scripts/pact.ps1 @@ -68,9 +68,19 @@ foreach ($package in $packages) { # Run integration tests Write-Host "--> Testing E2E examples" - +Write-Host "Running consumer tests" go test -tags=consumer -count=1 github.com/pact-foundation/pact-go/examples/... -run TestExample +if ($LastExitCode -ne 0) { + Write-Host "ERROR: Test failed, logging failure" + $exitCode=1 +} + +Write-Host "Running provider tests" go test -tags=provider -count=1 github.com/pact-foundation/pact-go/examples/... -run TestExample +if ($LastExitCode -ne 0) { + Write-Host "ERROR: Test failed, logging failure" + $exitCode=1 +} # Shutdown Write-Host "Shutting down any remaining pact processes :)"