Skip to content

Commit

Permalink
Added explicit exit value
Browse files Browse the repository at this point in the history
  • Loading branch information
axsaucedo authored and seldondev committed Mar 20, 2020
1 parent 84b66d9 commit 367d234
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions testing/scripts/kind_test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then
PYTHON_EXIT_VALUE=$?
if [[ $PYTHON_EXIT_VALUE -gt 0 ]]; then
echo "Python build returned errors"
return
return 1
fi
else
echo "SKIPPING PYTHON IMAGE BUILD..."
Expand All @@ -64,7 +64,7 @@ if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then
OPERATOR_EXIT_VALUE=$?
if [[ $OPERATOR_EXIT_VALUE -gt 0 ]]; then
echo "Operator build returned errors"
return
return 1
fi
else
echo "SKIPPING OPERATOR IMAGE BUILD..."
Expand All @@ -77,13 +77,13 @@ if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then
make build_protos
PROTO_EXIT_VALUE=$?
if [[ $PROTO_EXIT_VALUE -gt 0 ]]; then
return
return 1
fi
make kind_build_engine
ENGINE_EXIT_VALUE=$?
if [[ $ENGINE_EXIT_VALUE -gt 0 ]]; then
echo "Engine build returned errors"
return
return 1
fi
else
echo "SKIPPING ENGINE IMAGE BUILD..."
Expand All @@ -97,7 +97,7 @@ if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then
EXECUTOR_EXIT_VALUE=$?
if [[ $EXECUTOR_EXIT_VALUE -gt 0 ]]; then
echo "Executor build returned errors"
return
return 1
fi
else
echo "SKIPPING EXECUTOR IMAGE BUILD..."
Expand All @@ -108,23 +108,23 @@ if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then
KIND_BUILD_EXIT_VALUE=$?
if [[ $KIND_BUILD_EXIT_VALUE -gt 0 ]]; then
echo "Kind build has errors"
return
return 1
fi

# KIND CLUSTER SETUP
make kind_setup
SETUP_EXIT_VALUE=$?
if [[ $SETUP_EXIT_VALUE -gt 0 ]]; then
echo "Kind setup returned errors"
return
return 1
fi

## INSTALL ALL REQUIRED DEPENDENCIES
make -C ../../python install_dev
INSTALL_EXIT_VALUE=$?
if [[ $INSTALL_EXIT_VALUE -gt 0 ]]; then
echo "Dependency installation returned errors"
return
return 1
fi

## RUNNING TESTS AND CAPTURING ERROR
Expand All @@ -138,11 +138,16 @@ if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then
TEST_EXIT_VALUE=$?
if [[ $TEST_EXIT_VALUE -gt 0 ]]; then
echo "Test returned errors"
return
return 1
fi

# If we reach this point return success
return 0
}
# We run the piece above
run_end_to_end_tests
RUN_EXIT_VALUE=$?

else
echo "Existing kind cluster or failure starting - ${KIND_EXIT_VALUE}"
fi
Expand All @@ -159,6 +164,6 @@ set -o errexit
docker ps -aq | xargs -r docker rm -f || true
service docker stop || true

# NOW THAT WE'VE CLEANED WE CAN EXIT ON TEST EXIT VALUE
exit ${TEST_EXIT_VALUE}
# NOW THAT WE'VE CLEANED WE CAN EXIT ON RUN EXIT VALUE
exit ${RUN_EXIT_VALUE}

0 comments on commit 367d234

Please sign in to comment.