Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit test cli in prow script not returning correct exit code #206

Merged
merged 3 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .prow/scripts/install_google_cloud_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ if [[ ${KEY_FILE} ]]; then
gcloud -q container clusters get-credentials ${KUBE_CLUSTER_NAME} --zone ${KUBE_CLUSTER_ZONE} --project ${GOOGLE_PROJECT_ID}
export GOOGLE_APPLICATION_CREDENTIALS=${KEY_FILE}
fi

# Restore bash option
set +e
4 changes: 3 additions & 1 deletion .prow/scripts/run_unit_test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
set -e

# This script will run unit test for a specific Feast component:
# - core, ingestion, serving or cli
Expand Down Expand Up @@ -37,6 +36,9 @@ if [[ ${COMPONENT} == "core" ]] || [[ ${COMPONENT} == "ingestion" ]] || [[ ${COM

elif [[ ${COMPONENT} == "cli" ]]; then

# https://stackoverflow.com/questions/6871859/piping-command-output-to-tee-but-also-save-exit-code-of-command
set -o pipefail

go get -u github.com/jstemmer/go-junit-report
go test -v ./cli/feast/... 2>&1 | tee test_output
TEST_EXIT_CODE=$?
Expand Down