-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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.gobut 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
- Enable envtest suite - Remove
Skip(), fix binary path issues, write initial controller reconciliation tests - Add kind test target -
make test-kindthat spins up cluster, deploys operator, runs e2e tests - CI integration - GitHub Actions workflow that runs both tiers
- Developer docs - How to run locally, prerequisites (Docker, kind)
Success Criteria
make testruns envtest-based controller tests (fast)make test-kindruns 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.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request