Skip to content

Commit

Permalink
test: add e2e tests for setting kubernetes version (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicks authored Dec 4, 2020
1 parent 6cb903e commit 3d62b3f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/kind-cluster-network/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: Cluster
name: kind-ctlptl-test-cluster
product: kind
registry: ctlptl-test-registry
kubernetesVersion: v1.19.3
kubernetesVersion: v1.18.8
10 changes: 10 additions & 0 deletions test/kind-cluster-network/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@ cat builder.yaml | sed "s/REGISTRY_HOST_PLACEHOLDER/$HOST/" | kubectl apply -f -
kubectl wait --for=condition=complete job/ko-builder --timeout=180s
cat simple-server.yaml | sed "s/REGISTRY_HOST_PLACEHOLDER/$HOST/" | kubectl apply -f -
kubectl wait --for=condition=available deployment/simple-server --timeout=60s

# Check to see we started the right kubernetes version.
k8sVersion=$(ctlptl get cluster kind-ctlptl-test-cluster -o go-template --template='{{.status.kubernetesVersion}}')

ctlptl delete -f cluster.yaml

if [[ "$k8sVersion" != "v1.18.8" ]]; then
echo "Expected kubernetes version v1.18.8 but got $k8sVersion"
exit 1
fi

echo "kind-cluster-network test passed!"
3 changes: 1 addition & 2 deletions test/minikube-cluster-network/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ kind: Cluster
name: minikube-ctlptl-test-cluster
product: minikube
registry: ctlptl-test-registry
kubernetesVersion: v1.19.3

kubernetesVersion: v1.18.8
9 changes: 9 additions & 0 deletions test/minikube-cluster-network/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ cat builder.yaml | sed "s/REGISTRY_HOST_PLACEHOLDER/$HOST/g" | kubectl apply -f
kubectl wait --for=condition=complete job/ko-builder --timeout=180s
cat simple-server.yaml | sed "s/REGISTRY_HOST_PLACEHOLDER/$HOST/g" | kubectl apply -f -
kubectl wait --for=condition=available deployment/simple-server --timeout=60s

# Check to see we started the right kubernetes version.
k8sVersion=$(ctlptl get cluster minikube-ctlptl-test-cluster -o go-template --template='{{.status.kubernetesVersion}}')

ctlptl delete -f cluster.yaml

if [[ "$k8sVersion" != "v1.18.8" ]]; then
echo "Expected kubernetes version v1.18.8 but got $k8sVersion"
exit 1
fi

echo "minikube-cluster-network test passed!"

0 comments on commit 3d62b3f

Please sign in to comment.