diff --git a/test/scripts/integration.sh b/test/scripts/integration.sh index 2deccb6d05..e56015d2b9 100644 --- a/test/scripts/integration.sh +++ b/test/scripts/integration.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -exu # Packages to exclude PKGS=`go list github.com/hyperledger/fabric-sdk-go/test/... 2> /dev/null | \ @@ -11,5 +11,13 @@ echo "Running integration tests..." cd ../../ gocov test -ldflags "$GO_LDFLAGS" $PKGS -p 1 -timeout=10m | gocov-xml > integration-report.xml -echo "Cleaning up..." -cd ./test/fixtures && docker-compose down +if [ $? -eq 0 ] +then + echo "Integration tests passed. Cleaning up..." + cd ./test/fixtures && docker-compose down + exit 0 +else + echo "Integration tests failed. Cleaning up..." + cd ./test/fixtures && docker-compose down + exit 1 +fi