Add progress reporting and make tests verbose
This commit is contained in:
parent
f2b73e0ae6
commit
bfb6b5341d
|
|
@ -21,5 +21,5 @@ kubectl cluster-info
|
||||||
image=$(docker images --filter=reference="registry.opensource.zalan.do/acid/postgres-operator" --format "{{.Repository}}:{{.Tag}}" | head -1)
|
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}
|
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}
|
kind delete cluster --name ${cluster_name}
|
||||||
|
|
@ -4,6 +4,7 @@ import timeout_decorator
|
||||||
import subprocess
|
import subprocess
|
||||||
import warnings
|
import warnings
|
||||||
import docker
|
import docker
|
||||||
|
from halo import Halo
|
||||||
|
|
||||||
from kubernetes import client, config, utils
|
from kubernetes import client, config, utils
|
||||||
|
|
||||||
|
|
@ -113,11 +114,11 @@ class Utils:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def wait_for_pod_start(k8s_api, pod_labels, retry_timeout_sec):
|
def wait_for_pod_start(k8s_api, pod_labels, retry_timeout_sec):
|
||||||
pod_phase = 'No pod running'
|
pod_phase = 'No pod running'
|
||||||
|
with Halo(text="Wait for the pod '{}' to start. Pod phase: {}".format(pod_labels, pod_phase), spinner='dots'):
|
||||||
while pod_phase != 'Running':
|
while pod_phase != 'Running':
|
||||||
pods = k8s_api.core_v1.list_namespaced_pod('default', label_selector=pod_labels).items
|
pods = k8s_api.core_v1.list_namespaced_pod('default', label_selector=pod_labels).items
|
||||||
if pods:
|
if pods:
|
||||||
pod_phase = pods[0].status.phase
|
pod_phase = pods[0].status.phase
|
||||||
print("Wait for the pod '{}' to start. Current pod phase: {}".format(pod_labels, pod_phase))
|
|
||||||
time.sleep(retry_timeout_sec)
|
time.sleep(retry_timeout_sec)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
@ -132,8 +133,8 @@ class Utils:
|
||||||
"v1", "default", "postgresqls", "acid-minimal-cluster", body)
|
"v1", "default", "postgresqls", "acid-minimal-cluster", body)
|
||||||
|
|
||||||
labels = 'version=acid-minimal-cluster'
|
labels = 'version=acid-minimal-cluster'
|
||||||
|
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:
|
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)
|
time.sleep(retry_timeout_sec)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue