Repository navigation
Description
Problem or Motivation
The product contracts of devops-cli are tested against the environment files under k8s/. #5134 step 6 (plan step 17 on #5120) deletes the environment files from devops-cli. After that step, these tests have no input. The tests check product behaviour, so they must stay in devops-cli and must not read the environment tree.
This item was item 4 of #5131. One issue gets one pull request, so it has its own issue now. #5131 builds PR 1 (the environment root and the foreign-source support).
Proposed Solution & Architectural Design
Product contracts stay in devops-cli and test a fixture tree with no private data:
- the Job label (
tests/invariants/test_k8s_mcp_server_policies.py), job_admission_policy.py,runner.pyanddevops_runtime.pyof the gate checks,- the deploy paths of
tests/invariants/test_architectural_invariants.py, render_active_devops_configmapwithk8s/devops/configmap.example.yaml,- the product dashboards and the alert rules that watch the Service (after refactor(k8s): split the product dashboards and rules in place #5292 moves them to
k8s/devops/).
Make each fixture from the devops-cli history only, never from homelab, because homelab holds the real hosts after #5134 step 5b. tests/support/k8s_tree.py takes a root parameter, so a test can read the fixture tree in place of k8s/.
Target Subsystem
Kubernetes & Minikube Automation
Existing Tool Considered
pytest fixtures and the test helpers of tests/support/ cover the need. No new tool is necessary. Cost: about 2M model input to build, 0.2M a quarter to keep, 3 hours.
Acceptance Criteria
- The product-contract tests pass against a fixture tree, with the
k8s/environment folders hidden. - No fixture holds a host, an address or a name from homelab.
-
uv run devops cipasses.
Dependencies
#5131 (PR 1: the environment root and tests/support/k8s_tree.py with a ref name other than $values). #5292 (the product dashboards and rules in k8s/devops/). This item blocks #5134 step 6 (plan step 17).
Source: #5120
Alternatives check of 2026-11-16: not-applicable.
Class: test, no search.
Tool: none found.
Proposed design
Problem statement
The product contracts of devops-cli test the environment files under k8s/. #5134 step 6 deletes those files, so the tests lose their input. This item moves the product-contract tests to a fixture Kubernetes tree with no private data. The tests stay in devops-cli and do not read the environment tree.
Acceptance criteria
Requirement: Product contracts read the fixture tree
The product-contract tests MUST read the fixture Kubernetes tree in place of the k8s/ environment folders.
Scenario: Fixture root replaces the environment tree
- WHEN
uv run pytest tests/invariants/test_k8s_mcp_server_policies.py tests/invariants/test_architectural_invariants.py tests/k8s/test_k8s_configmap.pyruns with thek8s/environment folders hidden - THEN the tests pass and no test reads a path under the hidden
k8s/environment folders
Requirement: Fixture tree holds the product contract inputs
The fixture tree SHALL hold the Job label, the gate-check inputs, the deploy paths, the ConfigMap example and the product dashboards and alert rules.
Scenario: Each product contract reads its fixture input
- WHEN
uv run pytest tests/invariants/test_k8s_mcp_server_policies.py tests/invariants/test_architectural_invariants.py tests/k8s/test_k8s_configmap.pyruns - THEN each test reads its input from
tests/fixtures/k8s/and passes
Requirement: Fixtures hold no homelab data
Each fixture file MUST come from the devops-cli history and MUST NOT contain a host, address or name from homelab.
Scenario: Fixture provenance and private data check
- WHEN
uv run pytest tests/invariants/test_architectural_invariants.py -k fixture_k8s_tree_provenanceruns - THEN the test passes and each fixture file names a devops-cli commit and no homelab host, address or name
Requirement: CI passes
The full CI MUST pass with the fixture-tree tests.
Scenario: CI check passes
- WHEN
uv run devops ciruns - THEN the command exits 0
Existing Tool Considered
pytest with the tests/support/ helpers covers the need. It lacks nothing for this item. The alternatives check is not-applicable for a test item and found no tool. Cost of the fixture tests: about 2M model input to build, 0.2M a quarter to keep, 3 hours.
Key questions
- How should a product-contract test select the fixture Kubernetes tree?: Pass the fixture root to
tests/support/k8s_tree.pyafter refactor(k8s): read the environment tree from the infra repo #5131. Do not use a global setting or copy the fixture overk8s/. (best practice) [sources: tests/support/k8s_tree.py]- Chosen: Root parameter of
tests/support/k8s_tree.py. The helper takes a root, so each test gives its own tree and parallel tests do not interfere. - Rejected: Environment variable. It hides the input from the test and makes parallel tests interfere.
- Rejected: Copy the fixture over
k8s/. It changes the working tree and defeats the check thatk8s/is hidden.
- Chosen: Root parameter of
- Where should the fixture Kubernetes tree live?: Under
tests/fixtures/k8s/, read through theFIXTURESpath intests/support/paths.py. (best practice) [sources: tests/support/paths.py]- Chosen:
tests/fixtures/k8s/.FIXTURESalready points at the test data directory and keeps fixture data apart from test modules. - Rejected:
tests/k8s/fixtures/. It puts test data beside test modules and gives no shared root. - Rejected:
k8s/devops/. That is the product base, not test data, and it holds no environment input.
- Chosen:
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both items concern k8s/ testing, but #1322 removes internal patches in favour of public-interface fakes, while this candidate redirects product-contract tests to a fixture tree so they survive deletion of the environment files.devops-cli-service commentedon Nov 16, 2026
Alternatives check: not-applicable
Class: test. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 73743a2 (see proposed design in issue body).
fix(roadmap): Keep blockers that a sentence opens with other words (#…
dan-petty commentedon Nov 23, 2026
Closing as not planned per AGENTS.md rule 2 (Check the premise first): newer issues and commits replaced this item.
Evidence:
tests/invariants/test_k8s_mcp_server_policies.py: PR fix(k8s): Drop the tests that assert values of manifests and config #6075 (test(k8s): Drop the tests that repeat third-party version pins #6060) and PR fix(k8s): Take the k8s area of the config-read list to zero #6124 (test(k8s): Take the k8s area of the config-read allow list to zero #6119, commit0857ee5fb) dropped all tests that assert values of manifests or config files, and removedtest_k8s_mcp_server_policies.py. Its specification (openspec/specs/mcp-server-network-policies/spec.md) was updated to specify live cluster validator checks. Adding new tests that assert manifest values is forbidden bytests/gate/tree_checks/config_values.py.job_admission_policy.pyandrunner.py: ReadREPO_ROOT / "k8s" / "devops"(the product base), not the environment tree. The product base remains in devops-cli.render_active_devops_configmapreadsk8s/devops/configmap.example.yaml(product base), which remains in devops-cli.k8s/devops/dashboards/.feat(k8s): run the environment checks in homelab CI) moves the environment checks to homelab CI.