Skip to content

Commit

Permalink
angry linter
Browse files Browse the repository at this point in the history
  • Loading branch information
louiseschmidtgen committed Jul 4, 2024
1 parent 1610dd6 commit b4055b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions tests/integration/tests/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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(
Expand Down Expand Up @@ -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."
Expand Down
11 changes: 8 additions & 3 deletions tests/integration/tests/test_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)

Expand Down

0 comments on commit b4055b6

Please sign in to comment.