Problem
We currently only have unit tests. To test controller behavior against a real Kubernetes API, we deploy to an internal staging cluster. This is slow and risky for iterative development.
Proposed Solution
Implement a two-tier local integration testing strategy:
Tier 1: envtest (fast, API-only)
- Purpose: Test controller reconciliation logic against a real K8s API server (no kubelet)
- Speed: Seconds
- What it tests: Controllers create correct K8s resources (Deployments, Services, ConfigMaps, Secrets) when CRs are applied
- Note: Scaffolding exists in
internal/controller/core/suite_test.go but is currently skipped
Tier 2: kind cluster (realistic, full stack)
- Purpose: Test full product deployment with real containers
- Speed: Minutes
- What it tests: Products actually start, health checks pass, ingress works
- Includes: Deploy controller to kind, apply Site CR, verify pods come up healthy
Scope
Success Criteria
make test runs envtest-based controller tests (fast)
make test-kind runs full integration tests against kind (thorough)
- CI runs both on PRs
- Live staging cluster used only for final validation
Notes
- envtest already partially scaffolded in
suite_test.go
- Consider using chainsaw or similar for declarative e2e tests
- May need mock/stub external dependencies (AWS Secrets Manager, etc.)
Problem
We currently only have unit tests. To test controller behavior against a real Kubernetes API, we deploy to an internal staging cluster. This is slow and risky for iterative development.
Proposed Solution
Implement a two-tier local integration testing strategy:
Tier 1: envtest (fast, API-only)
internal/controller/core/suite_test.gobut is currently skippedTier 2: kind cluster (realistic, full stack)
Scope
Skip(), fix binary path issues, write initial controller reconciliation testsmake test-kindthat spins up cluster, deploys operator, runs e2e testsSuccess Criteria
make testruns envtest-based controller tests (fast)make test-kindruns full integration tests against kind (thorough)Notes
suite_test.go