forked from kubeflow/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] update bash scripts for E2E tests run to propagate failures (#433)
* [Fix] update bash scripts for E2E tests run to propagate failures We haven't been propagating the test failures in our E2E CI jobs because we weren't checking for the return codes of the commands run in the bash scripts. Also, this fixes setup* targets in Makefile so that expected images are deployed to the testing cluster. * asdf
- Loading branch information
Showing
3 changed files
with
77 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 36 additions & 15 deletions
51
components/odh-notebook-controller/run-e2e-test-service-mesh.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
set -Eeuxo pipefail | ||
|
||
echo "Running the ${0} setup" | ||
|
||
TEST_NAMESPACE="odh-notebook-controller-system" | ||
|
||
# setup and deploy the controller | ||
oc new-project $TEST_NAMESPACE -n $TEST_NAMESPACE --skip-config-write | ||
# Following variables are optional - if not set, the default values in relevant params.env | ||
# will be used for both images. As such, if you want to run tests against your custom changes, | ||
# be sure to perform a docker build and set these variables accordingly! | ||
ODH_NOTEBOOK_CONTROLLER_IMAGE="${ODH_NOTEBOOK_CONTROLLER_IMAGE:-}" | ||
KF_NOTEBOOK_CONTROLLER="${KF_NOTEBOOK_CONTROLLER:-}" | ||
|
||
IFS=':' read -r -a CTRL_IMG <<< "${ODH_NOTEBOOK_CONTROLLER_IMAGE}" | ||
export IMG="${CTRL_IMG[0]}" | ||
export TAG="${CTRL_IMG[1]}" | ||
IFS=':' read -r -a KF_NBC_IMG <<< "${KF_NOTEBOOK_CONTROLLER}" | ||
export KF_IMG="${KF_NBC_IMG[0]}" | ||
export KF_TAG="${KF_NBC_IMG[1]}" | ||
export K8S_NAMESPACE=$TEST_NAMESPACE | ||
|
||
make deploy-service-mesh deploy-with-mesh | ||
if test -n "${ODH_NOTEBOOK_CONTROLLER_IMAGE}"; then | ||
IFS=':' read -r -a CTRL_IMG <<< "${ODH_NOTEBOOK_CONTROLLER_IMAGE}" | ||
export IMG="${CTRL_IMG[0]}" | ||
export TAG="${CTRL_IMG[1]}" | ||
fi | ||
|
||
# run e2e tests | ||
make e2e-test-service-mesh | ||
if test -n "${KF_NOTEBOOK_CONTROLLER}"; then | ||
IFS=':' read -r -a KF_NBC_IMG <<< "${KF_NOTEBOOK_CONTROLLER}" | ||
export KF_IMG="${KF_NBC_IMG[0]}" | ||
export KF_TAG="${KF_NBC_IMG[1]}" | ||
fi | ||
|
||
export K8S_NAMESPACE="${TEST_NAMESPACE}" | ||
|
||
# cleanup deployment | ||
make undeploy-with-mesh undeploy-service-mesh | ||
oc delete project $TEST_NAMESPACE -n $TEST_NAMESPACE | ||
# From now on we want to be sure that undeploy and testing project deletion are called | ||
|
||
function cleanup() { | ||
echo "Performing deployment cleanup of the ${0}" | ||
make undeploy-with-mesh undeploy-service-mesh && oc delete project "${TEST_NAMESPACE}" | ||
} | ||
trap cleanup EXIT | ||
|
||
# setup and deploy the controller | ||
oc new-project "${TEST_NAMESPACE}" --skip-config-write | ||
|
||
# deploy and run e2e tests | ||
make deploy-service-mesh deploy-with-mesh | ||
make e2e-test-service-mesh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
set -Eeuxo pipefail | ||
|
||
echo "Running the ${0} setup" | ||
|
||
TEST_NAMESPACE="odh-notebook-controller-system" | ||
|
||
# setup and deploy the controller | ||
oc new-project $TEST_NAMESPACE -n $TEST_NAMESPACE --skip-config-write | ||
# Following variables are optional - if not set, the default values in relevant params.env | ||
# will be used for both images. As such, if you want to run tests against your custom changes, | ||
# be sure to perform a docker build and set these variables accordingly! | ||
ODH_NOTEBOOK_CONTROLLER_IMAGE="${ODH_NOTEBOOK_CONTROLLER_IMAGE:-}" | ||
KF_NOTEBOOK_CONTROLLER="${KF_NOTEBOOK_CONTROLLER:-}" | ||
|
||
IFS=':' read -r -a CTRL_IMG <<< "${ODH_NOTEBOOK_CONTROLLER_IMAGE}" | ||
export IMG="${CTRL_IMG[0]}" | ||
export TAG="${CTRL_IMG[1]}" | ||
IFS=':' read -r -a KF_NBC_IMG <<< "${KF_NOTEBOOK_CONTROLLER}" | ||
export KF_IMG="${KF_NBC_IMG[0]}" | ||
export KF_TAG="${KF_NBC_IMG[1]}" | ||
export K8S_NAMESPACE=$TEST_NAMESPACE | ||
|
||
make deploy | ||
if test -n "${ODH_NOTEBOOK_CONTROLLER_IMAGE}"; then | ||
IFS=':' read -r -a CTRL_IMG <<< "${ODH_NOTEBOOK_CONTROLLER_IMAGE}" | ||
export IMG="${CTRL_IMG[0]}" | ||
export TAG="${CTRL_IMG[1]}" | ||
fi | ||
|
||
# run e2e tests | ||
make e2e-test | ||
if test -n "${KF_NOTEBOOK_CONTROLLER}"; then | ||
IFS=':' read -r -a KF_NBC_IMG <<< "${KF_NOTEBOOK_CONTROLLER}" | ||
export KF_IMG="${KF_NBC_IMG[0]}" | ||
export KF_TAG="${KF_NBC_IMG[1]}" | ||
fi | ||
|
||
export K8S_NAMESPACE="${TEST_NAMESPACE}" | ||
|
||
# cleanup deployment | ||
make undeploy | ||
oc delete project $TEST_NAMESPACE -n $TEST_NAMESPACE | ||
# From now on we want to be sure that undeploy and testing project deletion are called | ||
|
||
function cleanup() { | ||
echo "Performing deployment cleanup of the ${0}" | ||
make undeploy && oc delete project "${TEST_NAMESPACE}" | ||
} | ||
trap cleanup EXIT | ||
|
||
# setup and deploy the controller | ||
oc new-project "${TEST_NAMESPACE}" | ||
|
||
# deploy and run e2e tests | ||
make deploy | ||
make e2e-test |