Finding
tests/service_catalog/shared/kube.py provides six helper functions used by every homelab test suite (homelab_access, homelab_backup, homelab_storage, homelab_substrate):
run_kubectl(*args) — subprocess wrapper
require_kubectl(*args) — asserting subprocess wrapper
get_pods_json() — JSON pod list fetcher
restart_workload() — deployment restart + rollout wait
first_pod_name() — pod name resolver
http_get() — in-cluster HTTP probe
None of these have unit tests. A bug in any helper silently breaks multiple test suites and may mask real environment failures.
Additional note: test_k8s_lifecycle.py duplicates run_kubectl and write_artifact locally instead of importing from kube.py, meaning the shared module is not exercised by that suite.
Recommendation
- Add
tests/service_catalog/shared/test_kube.py with mocked subprocess.run for all six functions.
- Add a
unit-tests.yml CI workflow that runs pytest on every PR.
- Refactor
test_k8s_lifecycle.py to import from kube.py.
Priority
Filed by quality agent (hold-gated mode)
Finding
tests/service_catalog/shared/kube.pyprovides six helper functions used by every homelab test suite (homelab_access,homelab_backup,homelab_storage,homelab_substrate):run_kubectl(*args)— subprocess wrapperrequire_kubectl(*args)— asserting subprocess wrapperget_pods_json()— JSON pod list fetcherrestart_workload()— deployment restart + rollout waitfirst_pod_name()— pod name resolverhttp_get()— in-cluster HTTP probeNone of these have unit tests. A bug in any helper silently breaks multiple test suites and may mask real environment failures.
Additional note:
test_k8s_lifecycle.pyduplicatesrun_kubectlandwrite_artifactlocally instead of importing fromkube.py, meaning the shared module is not exercised by that suite.Recommendation
tests/service_catalog/shared/test_kube.pywith mockedsubprocess.runfor all six functions.unit-tests.ymlCI workflow that runspyteston every PR.test_k8s_lifecycle.pyto import fromkube.py.Priority
Filed by quality agent (hold-gated mode)