fix Python 3.8 type hint in dns_probe + tear down cluster after deploy test
dns_probe.py used 'list[str]' (PEP 585 generic alias for builtins), which only parses on Python 3.9+. CI runs Python 3.8, so any caller of 'deployment restart' (which lazy-imports dns_probe) crashed at module load with 'TypeError: type object is not subscriptable'. Use 'List[str]' from typing to keep 3.8 compatibility, matching the rest of the file's imports. run-deploy-test.sh previously ended with --skip-cluster-management, leaving the Kind cluster running for the next CI step to inherit. Switch the final stop to --perform-cluster-management so subsequent tests (e.g. run-restart-test.sh) start from a clean host, and replace the now-trivial namespace assertion with a real check that the kind cluster is actually gone. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>pull/750/head
parent
93b0d79998
commit
633feba3ea
|
|
@ -6,7 +6,7 @@
|
||||||
import secrets
|
import secrets
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
from typing import Optional
|
from typing import List, Optional
|
||||||
import requests
|
import requests
|
||||||
from kubernetes import client
|
from kubernetes import client
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ def get_server_egress_ip() -> str:
|
||||||
return response.text.strip()
|
return response.text.strip()
|
||||||
|
|
||||||
|
|
||||||
def resolve_hostname(hostname: str) -> list[str]:
|
def resolve_hostname(hostname: str) -> List[str]:
|
||||||
"""Resolve hostname to list of IP addresses."""
|
"""Resolve hostname to list of IP addresses."""
|
||||||
try:
|
try:
|
||||||
_, _, ips = socket.gethostbyname_ex(hostname)
|
_, _, ips = socket.gethostbyname_ex(hostname)
|
||||||
|
|
|
||||||
|
|
@ -413,14 +413,16 @@ if [ "$restored_value" != "$fake_cert_value" ]; then
|
||||||
fi
|
fi
|
||||||
echo "caddy cert restore test: passed"
|
echo "caddy cert restore test: passed"
|
||||||
|
|
||||||
# Final teardown: --delete-namespace nukes the namespace after labeled cleanup.
|
# Final teardown: --delete-namespace nukes the namespace, and
|
||||||
# Verify the namespace is actually gone.
|
# --perform-cluster-management tears down the Kind cluster so the next test
|
||||||
|
# step in this CI workflow (e.g. run-restart-test.sh) starts from a clean
|
||||||
|
# host.
|
||||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir \
|
$TEST_TARGET_SO deployment --dir $test_deployment_dir \
|
||||||
stop --delete-volumes --delete-namespace --skip-cluster-management
|
stop --delete-volumes --delete-namespace --perform-cluster-management
|
||||||
if kubectl get namespace ${deployment_ns} >/dev/null 2>&1; then
|
if kind get clusters 2>/dev/null | grep -q .; then
|
||||||
echo "delete-namespace test: FAILED (namespace still present)"
|
echo "cluster teardown test: FAILED (kind cluster still present)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "delete-namespace test: passed"
|
echo "cluster teardown test: passed"
|
||||||
|
|
||||||
echo "Test passed"
|
echo "Test passed"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue