diff --git a/tests/integration/tests/test_gateway.py b/tests/integration/tests/test_gateway.py index 2b17667b0..ffade7e15 100644 --- a/tests/integration/tests/test_gateway.py +++ b/tests/integration/tests/test_gateway.py @@ -10,6 +10,7 @@ LOG = logging.getLogger(__name__) + def check_gateway_service_and_port(p): gateway_http_port = None services = json.loads(p.stdout.decode()) @@ -34,6 +35,7 @@ def check_gateway_service_and_port(p): return gateway_http_port return None + def test_gateway(session_instance: harness.Instance): manifest = MANIFESTS_DIR / "gateway-test.yaml" session_instance.exec( @@ -63,9 +65,12 @@ def test_gateway(session_instance: harness.Instance): # Get gateway node port gateway_http_port = None - result = util.stubbornly(retries=7, delay_s=3).on(session_instance).until( - lambda p: check_gateway_service_and_port(p) is not None - ).exec(["k8s", "kubectl", "get", "service", "-o", "json"]) + result = ( + util.stubbornly(retries=7, delay_s=3) + .on(session_instance) + .until(lambda p: check_gateway_service_and_port(p) is not None) + .exec(["k8s", "kubectl", "get", "service", "-o", "json"]) + ) gateway_http_port = check_gateway_service_and_port(result) assert gateway_http_port is not None, "No ingress nodePort found." diff --git a/tests/integration/tests/test_ingress.py b/tests/integration/tests/test_ingress.py index 1138fe48c..e8673cb15 100644 --- a/tests/integration/tests/test_ingress.py +++ b/tests/integration/tests/test_ingress.py @@ -11,6 +11,7 @@ LOG = logging.getLogger(__name__) + def check_ingress_service_and_port(p): ingress_http_port = None services = json.loads(p.stdout.decode()) @@ -33,11 +34,15 @@ def check_ingress_service_and_port(p): return ingress_http_port return None + def test_ingress(session_instance: List[harness.Instance]): - result = util.stubbornly(retries=7, delay_s=3).on(session_instance).until( - lambda p: check_ingress_service_and_port(p) is not None - ).exec(["k8s", "kubectl", "get", "service", "-A", "-o", "json"]) + result = ( + util.stubbornly(retries=7, delay_s=3) + .on(session_instance) + .until(lambda p: check_ingress_service_and_port(p) is not None) + .exec(["k8s", "kubectl", "get", "service", "-A", "-o", "json"]) + ) ingress_http_port = check_ingress_service_and_port(result)