diff --git a/avm_scripts/test-example.sh b/avm_scripts/test-example.sh index 98813c7..18a346d 100644 --- a/avm_scripts/test-example.sh +++ b/avm_scripts/test-example.sh @@ -28,7 +28,8 @@ fi echo "==> go test" echo $TEST_TIMEOUT terraform version -go test -v -timeout=$TEST_TIMEOUT -run TestExample -- +test_failed=false +go test -v -timeout=$TEST_TIMEOUT -run TestExample || test_failed=true # change dir back into the example and run post.sh if it exists cd "$AVM_MOD_PATH/examples/$AVM_EXAMPLE" @@ -37,3 +38,8 @@ if [ -f post.sh ]; then chmod +x ./post.sh ./post.sh fi + +if [ "$test_failed" = true ]; then + echo "==> Test failed" + exit 1 +fi \ No newline at end of file