Skip to content

test(tests): run the k8s tests without kubectl on PATH - #5137

Merged
dan-petty merged 2 commits into
mainfrom
test/5132-k8s-tests-without-kubectl
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
test/5132-k8s-tests-without-kubectl

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The runner image of the roadmap jobs holds no kubectl, and 21 tests needed the real binary, so the implement job for #1878 stopped. The floor now refuses kubectl in each test, its offline renderers included (ADR 0007), so such a test fails on every host. The image-pin, Argo CD gate and deploy-stack tests fake kubectl and its lookup on PATH. The Qdrant Secret check of the committed manifests moves to the k8s row of devops ci.

Closes #5132

Change: openspec/changes/archive/2026-11-12-5132-21-k8s-tests-fail-where-kubectl/

The floor refuses kubectl in each test, its offline renderers included
(ADR 0007). The image-pin, Argo CD gate and deploy-stack tests fake
kubectl and its lookup on PATH. The Qdrant Secret check of the committed
manifests moves to the k8s row of devops ci.
@dan-petty dan-petty added type/test Type test: a new or changed test scope/tests The test suite, its fixtures, fakes and floor labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Evidence for this change (local runs on 2026-11-12, devcontainer).

uv run devops ci fail-to-pass --base origin/main:

0 failed on base (0 failed and 199 passed in tests/commands/k8s/test_k8s.py, tests/commands/k8s/test_k8s_rag_ingest_manifests.py, tests/invariants/test_hermetic_floor.py, tests/k8s/test_image_pins.py, tests/k8s/test_k8s_argocd_gate.py, tests/tools_lock/test_k8s_argo_workflows.py; 0 errored).
k8s gate row: 0 of 110 cases failed on base, 0 of 110 on head (tests/gate/k8s_checks/rag_ingest.py).

The replay runs the tests of the head over the src/ of the base. The defect was in the tests and in the floor (tests/conftest.py), not in src/, so no changed test can fail on the base. For this reason the title is test, not fix. These runs prove the change:

  • Floor test before the floor change: uv run pytest -n 0 -q tests/invariants/test_hermetic_floor.py -k kubectl gave 1 failed (assert (False, False, 2) == (True, True, 0): the inner kubectl kustomize and kubectl patch --local ran). After: 32 passed.
  • Base, kubectl hidden from PATH (a directory with links to each program of /usr/local/bin except kubectl), pytest -n 8 tests: 24 failed, 23949 passed, 2 skipped. 21 failures were kubectl. The other 3 (review_window of test_git_contract.py, test_review_facts) fail with kubectl on PATH too (fix(roadmap): the review_window git transcript does not match the code #4865).
  • Head, the 74 test files that name kubectl: 2356 passed with kubectl on PATH and 2356 passed with kubectl hidden.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree: all pass. uv run devops ci --check --only k8s: 110 cases, 0 failed. A probe that made the new check expect another holder failed the row, so the row runs it.
  • mypy: the gate type-checks src only (TYPECHECK_PATHS), and the change touches no file of src. mypy --strict on the changed test files gives no error other than the untyped-import errors that the files had before.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 16:21
@dan-petty
dan-petty merged commit 1c76f64 into main Nov 12, 2026
23 checks passed
@dan-petty
dan-petty deleted the test/5132-k8s-tests-without-kubectl branch November 12, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/tests The test suite, its fixtures, fakes and floor type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tests): 21 k8s tests fail where kubectl is not on PATH

1 participant