diff --git a/e2e/run.sh b/e2e/run.sh index 63e482954..6d612a0cd 100755 --- a/e2e/run.sh +++ b/e2e/run.sh @@ -21,5 +21,5 @@ kubectl cluster-info image=$(docker images --filter=reference="registry.opensource.zalan.do/acid/postgres-operator" --format "{{.Repository}}:{{.Tag}}" | head -1) kind load docker-image ${image} --name ${cluster_name} -python3 -m unittest discover --start-directory e2e/tests/ && +python3 -m unittest discover --start-directory e2e/tests/ -v && kind delete cluster --name ${cluster_name} \ No newline at end of file diff --git a/e2e/tests/test_smoke.py b/e2e/tests/test_smoke.py index e4fef0ad2..bb3b5f5b0 100755 --- a/e2e/tests/test_smoke.py +++ b/e2e/tests/test_smoke.py @@ -4,6 +4,7 @@ import timeout_decorator import subprocess import warnings import docker +from halo import Halo from kubernetes import client, config, utils @@ -113,11 +114,11 @@ class Utils: @staticmethod def wait_for_pod_start(k8s_api, pod_labels, retry_timeout_sec): pod_phase = 'No pod running' - while pod_phase != 'Running': - pods = k8s_api.core_v1.list_namespaced_pod('default', label_selector=pod_labels).items - if pods: - pod_phase = pods[0].status.phase - print("Wait for the pod '{}' to start. Current pod phase: {}".format(pod_labels, pod_phase)) + with Halo(text="Wait for the pod '{}' to start. Pod phase: {}".format(pod_labels, pod_phase), spinner='dots'): + while pod_phase != 'Running': + pods = k8s_api.core_v1.list_namespaced_pod('default', label_selector=pod_labels).items + if pods: + pod_phase = pods[0].status.phase time.sleep(retry_timeout_sec) @staticmethod @@ -132,9 +133,9 @@ class Utils: "v1", "default", "postgresqls", "acid-minimal-cluster", body) labels = 'version=acid-minimal-cluster' - while Utils.count_pods_with_label(k8s_api, labels) != number_of_instances: - print("Waiting for the cluster to scale to {} pods.".format(number_of_instances)) - time.sleep(retry_timeout_sec) + with Halo(text="Waiting for the cluster to scale to {} pods.".format(number_of_instances), spinner='dots'): + while Utils.count_pods_with_label(k8s_api, labels) != number_of_instances: + time.sleep(retry_timeout_sec) @staticmethod def count_pods_with_label(k8s_api, labels):