Isolated tests that need no cluster — type/JSON binding, registry metadata, retry
logic, kubeconfig parsing, query/option builders, watch/informer structure, the K8s
1.36 field additions, 1.37 GA kinds, etc. Each tests/<name>_test.zig is wired in build.zig.
zig build test # run the whole unit suite
zig build test-retry # a single suite (see build.zig for names)
zig build test-json-binding # e.g. the type/continue field-binding regressiontests/migration_probe_test.zig force-compiles the public API surface — including
every streaming method body — so lazy-compilation breakage fails here rather than in
a downstream consumer.
Standalone executables that exercise the client against a real cluster. Because
the direct TLS path has a known std.crypto.tls limitation (no
certificate_request handshake handling; not caused by self-signed certs),
they connect through kubectl proxy:
kubectl proxy --port=8080 --reject-paths='^$' & # --reject-paths needed for exec/attach
zig build build-integration-tests # compile them all (also run in CI)
zig build test-via-proxy # pods / namespaces / nodes + pod CRUD
zig build test-pod-exec # pod exec over WebSocket (needs a running pod)
zig build test-mutating-admission-policy # K8s >= 1.36 MutatingAdmissionPolicy CRUD
zig build test-k8s-137-crud # K8s >= 1.37 DeviceTaintRule / ClusterTrustBundle / StorageVersionMigration v1For test-pod-exec, create a target pod first:
kubectl run zig-klient-exec-test --image=busybox:1.36 --restart=Never --command -- sleep 3600
kubectl wait --for=condition=Ready pod/zig-klient-exec-testLarger scenarios (e.g. high-volume list pagination) that require a cluster — see that directory's README.
- A running cluster (Rancher Desktop, kind, minikube). Live CRUD verified against
Kubernetes 1.37.0 (
zig build test-k8s-137-crud) and 1.36.1 (test-mutating-admission-policy).PodCertificateRequestremains schema-only (zig build test-k8s-137). kubectl proxyfor the integration entrypoints (see above).
- CI runs the unit suite on Linux + macOS with Zig 0.17.0, a
zig fmt --checkgate, and a Protobuf schema drift check. Integration entrypoints are compiled in CI; the kind workflow runs them nightly and on demand.