Claude Code test-standards for Kubernetes controller test levels
Choose Go unit tests, envtest integration, or real infrastructure tests based on the behavior, with failure messages that show what went wrong.
中文Install in Claude Code
Open Cluster CAPI Operator in Claude Code with a Go test environment. Use the project’s envtest setup for controller API status changes.
- Review `.claude/skills/test-standards/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.claude/skills/test-standards/` in your project and save the reviewed file as `.claude/skills/test-standards/SKILL.md`.
- Start Claude Code from that project's root, then select `/test-standards` in the slash menu.
Example task
Case reconcile-17 exercises reconciliation. The object in a local test API enters processing and must transition to Ready once its condition is satisfied. The expected state is {phase: 'Ready'}.What to check
Use envtest and wait for {phase: 'Ready'} as an observable condition. The failure message identifies the controller and expected phase.
Original SKILL.md on GitHub · Updated
Frequently asked question
Which cases fit a plain unit test?
Use unit tests for pure calculations or error handling without real API state. Use integration tests when Kubernetes behavior such as status updates matters.