Răsfoiți Sursa

fix(e2e): correctly exit tests if setup fails

Currently, the e2e tests do not exit if the adjacency or curl pods fail
to come up. The tests will continue running for a long time and fail.
These changes cause the tests to exit early.

Signed-off-by: squat <lserven@gmail.com>
squat 2 luni în urmă
părinte
comite
c2db56adaa
4 a modificat fișierele cu 2 adăugiri și 4 ștergeri
  1. 0 1
      e2e/full-mesh.sh
  2. 2 2
      e2e/handlers.sh
  3. 0 1
      e2e/location-mesh.sh
  4. 0 0
      e2e/setup.sh

+ 0 - 1
e2e/full-mesh.sh

@@ -6,7 +6,6 @@ setup_suite() {
 	# shellcheck disable=SC2016
 	_kubectl patch ds -n kube-system kilo -p '{"spec": {"template":{"spec":{"containers":[{"name":"kilo","args":["--hostname=$(NODE_NAME)","--create-interface=false","--kubeconfig=/etc/kubernetes/kubeconfig","--mesh-granularity=full"]}]}}}}'
 	block_until_ready_by_name kube-system kilo-userspace 
-	_kubectl wait pod -l app.kubernetes.io/name=adjacency --for=condition=Ready --timeout 3m
 }
 
 test_full_mesh_connectivity() {

+ 2 - 2
e2e/handlers.sh

@@ -126,13 +126,13 @@ create_cluster() {
 	# Apply Kilo the the cluster.
 	_kubectl apply -f ../manifests/crds.yaml
 	_kubectl apply -f kilo-kind-userspace.yaml
-	block_until_ready_by_name kube-system kilo-userspace
+	if ! block_until_ready_by_name kube-system kilo-userspace; then return 1; fi
 	_kubectl wait nodes --all --for=condition=Ready
 	# Wait for CoreDNS.
 	block_until_ready kube_system k8s-app=kube-dns
 	# Ensure the curl helper is not scheduled on a control-plane node.
 	_kubectl apply -f helper-curl.yaml
-	block_until_ready_by_name default curl
+	block_until_ready_by_name default curl || return 1
 	_kubectl taint node $KIND_CLUSTER-control-plane node-role.kubernetes.io/control-plane:NoSchedule-
 	_kubectl apply -f https://raw.githubusercontent.com/kilo-io/adjacency/main/example.yaml
 	block_until_ready_by_name default adjacency

+ 0 - 1
e2e/location-mesh.sh

@@ -6,7 +6,6 @@ setup_suite() {
 	# shellcheck disable=SC2016
 	_kubectl patch ds -n kube-system kilo -p '{"spec": {"template":{"spec":{"containers":[{"name":"kilo","args":["--hostname=$(NODE_NAME)","--create-interface=false","--kubeconfig=/etc/kubernetes/kubeconfig","--mesh-granularity=location"]}]}}}}'
 	block_until_ready_by_name kube-system kilo-userspace 
-	_kubectl wait pod -l app.kubernetes.io/name=adjacency --for=condition=Ready --timeout 3m
 }
 
 test_location_mesh_connectivity() {

+ 0 - 0
e2e/setup.sh