Skip to content

feat: Ginkgo/Gomega envtest integration test suite for all three operator reconcilers - #146

Merged
dzungtr merged 1 commit into
mainfrom
feat/34-envtest-suite
Jun 8, 2026
Merged

dzungtr merged 1 commit into
mainfrom
feat/34-envtest-suite

Conversation

@dzungtr

@dzungtr dzungtr commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds operator/test/integration/ — 16 Ginkgo/Gomega specs running SchemaReconciler, ToolReconciler, and HandlerReconciler against a live kube-apiserver + etcd via envtest
  • Each test runs in its own isolated namespace with DeferCleanup teardown; all async assertions use gomega.Eventually with ≥10s timeout and 500ms poll
  • KEDA ScaledObject calls are stubbed (noopScaledObjectAdapter) since KEDA CRDs are not in the envtest cluster
  • Fixes operator/controller/watches_envtest_test.go: updated to current NewHandlerReconciler 12-param signature, corrected KapeConfig field names, added missing Properties to KapeSchema, added LastTransitionTime to status conditions, and wired the skill into Spec.Skills so the rollout-hash actually changes on skill update
  • Adds make test-integration target (uses setup-envtest to download k8s 1.32.0 binaries)
  • Adds .github/workflows/integration-test.yml CI job running on PRs touching operator/ or crds/

Test coverage

Reconciler Scenarios
SchemaReconciler valid schema → Ready=True + schemaHash; required field not in properties → InvalidSchema; deletion blocked by live handler; schemaHash changes on spec update
ToolReconciler event-publish valid type → Ready=True; mcp skipProbe=true → ProbeSkipped; mcp unreachable → MCPEndpointUnreachable; memory → StatefulSet created, QdrantNotReady
HandlerReconciler dependency gate (missing schema); happy-path object graph (Deployment + ConfigMap + SA); label propagation; rollout-hash change on schema update; scaling validation; gate clearing (schema created after handler); KEDA stub path

Test plan

  • make test-integration passes locally (KUBEBUILDER_ASSETS required)
  • go test ./operator/... (no envtest tag) still passes — no regressions
  • CI integration-test job runs on this PR

Closes #34

🤖 Generated with Claude Code

…operator reconcilers

Implements the full envtest integration test suite requested in #34:

- operator/test/integration/ — 16 Ginkgo/Gomega specs covering SchemaReconciler,
  ToolReconciler, and HandlerReconciler against a live kube-apiserver + etcd
- Uses noopScaledObjectAdapter since KEDA CRDs are not installed in envtest
- Each spec runs in its own isolated namespace with DeferCleanup teardown
- All async assertions use gomega.Eventually with 10–50s timeout / 500ms poll
- Makefile: adds test-integration target using setup-envtest for k8s 1.32.0
- CI: adds .github/workflows/integration-test.yml job running on PRs to operator/
- Fixes watches_envtest_test.go: updated to current NewHandlerReconciler signature
  (added skills/kapeproxy/skillConfigMap params), corrected KapeConfig fields,
  added missing Properties to KapeSchema and LastTransitionTime to status conditions,
  and ensured the skill is in Spec.Skills so the rollout-hash changes on update

Closes #34

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dzungtr
dzungtr merged commit 54f125b into main Jun 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(operator): add envtest integration test suite as behavior conformance tests

1 participant