Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
louiseschmidtgen committed Jun 13, 2024
1 parent 04f6c71 commit 057adc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 0 additions & 4 deletions build-scripts/patches/moonray/apply
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ git config user.name k8s-bot
rm "${DIR}/../../../tests/integration/tests/test_cilium_e2e.py"
## TODO: restore when loadbalancer is implemented
rm "${DIR}/../../../tests/integration/tests/test_loadbalancer.py"
## TODO: restore when gateway is implemented
rm "${DIR}/../../../tests/integration/tests/test_gateway.py"
## TODO: restore when ingress is implemented
rm "${DIR}/../../../tests/integration/tests/test_ingress.py"
## TODO: restore when cleanup is implemented
rm "${DIR}/../../../tests/integration/tests/test_cleanup.py"
## TODO: restore when network test is fixed
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_gateway(session_instance: harness.Instance):
if "my-gateway" in svc["metadata"]["name"]:
LOG.info(f"Found service {svc['metadata']['name']}")
for port in svc["spec"]["ports"]:
if port["name"] == "port-80":
if port["port"] == 80:
gateway_http_port = port["nodePort"]
break
if gateway_http_port:
Expand Down
8 changes: 5 additions & 3 deletions tests/integration/tests/test_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ def test_ingress(session_instance: List[harness.Instance]):
if "ingress" in svc["metadata"]["name"]:
LOG.info(f"Found service {svc['metadata']['name']}")
for port in svc["spec"]["ports"]:
if port["name"] == "port-80":
ingress_http_port = port["nodePort"]
if port["port"] == 80:
ingress_http_port = port.get("nodePort")
break
if ingress_http_port:
break

assert ingress_http_port is not None, "No ingress nodePort found."
LOG.info(f"Found ingress nodePort: {ingress_http_port}")

manifest = MANIFESTS_DIR / "ingress-test.yaml"
session_instance.exec(
["k8s", "kubectl", "apply", "-f", "-"],
Expand All @@ -68,7 +71,6 @@ def test_ingress(session_instance: List[harness.Instance]):
"180s",
]
)
assert ingress_http_port is not None, "No ingress nodePort found."

util.stubbornly(retries=5, delay_s=5).on(session_instance).until(
lambda p: "Welcome to nginx!" in p.stdout.decode()
Expand Down

0 comments on commit 057adc4

Please sign in to comment.