Skip to content

fix: close GUARDIAN-BL-ENVTEST-FAIL -- all integration suites green#6

Merged
ontave merged 1 commit into
mainfrom
session/6-integration-envtest-gaps
May 2, 2026
Merged

fix: close GUARDIAN-BL-ENVTEST-FAIL -- all integration suites green#6
ontave merged 1 commit into
mainfrom
session/6-integration-envtest-gaps

Conversation

@ontave
Copy link
Copy Markdown
Contributor

@ontave ontave commented Apr 20, 2026

Summary

  • Fixed 4 root causes for the pre-existing guardian integration envtest failures tracked as GUARDIAN-BL-ENVTEST-FAIL
  • All guardian integration suites now pass: controller (50s), epg (7s), lineage (6s), webhook (5s)

Root causes

  1. rbacpolicy_controller.go: Finalizer addition returned ctrl.Result{}, nil. GenerationChangedPredicate filtered the subsequent metadata-only Update event (finalizer does not bump generation), so the reconcile that sets status conditions never ran. Fixed: ctrl.Result{Requeue: true}.

  2. controller TestMain: IdentityProviderReconciler registered without HTTPClient field. Real OIDC HTTP calls to https://accounts.example.com/.well-known/openid-configuration blocked for oidcReachabilityTimeout (10s), expiring before deferred status patch fired. Fixed: injected alwaysReachableHTTPDoer{} test double.

  3. epg TestMain: EPGReconciler registered without OperatorNamespace. All SSA patches targeted namespace "", causing "server could not find the requested resource". Fixed: OperatorNamespace: testNamespace.

  4. lineage TestMain: probe PermissionSet in waitForLineageWebhookActive was missing required spec.permissions, causing a CRD validation rejection before the webhook was reached. Fixed: added a minimal PermissionRule.

Test plan

  • KUBEBUILDER_ASSETS=/tmp/envtest-bins/k8s/1.35.0-linux-amd64 go test ./test/integration/... -timeout 180s passes all 4 packages
  • No regressions in unit tests: go test ./...

🤖 Generated with Claude Code

@ontave ontave force-pushed the session/6-integration-envtest-gaps branch from 4f15ac1 to b3a4620 Compare May 2, 2026 08:30
Four root causes fixed:

1. RBACPolicyReconciler: finalizer addition returned ctrl.Result{}, nil
   causing GenerationChangedPredicate to filter the subsequent metadata-only
   Update event. Changed to ctrl.Result{Requeue: true} so status conditions
   are set on the same cycle. rbacpolicy_controller.go.

2. IdentityProviderReconciler in controller TestMain registered without
   HTTPClient, causing 10s OIDC network timeout in envtest. Added
   alwaysReachableHTTPDoer test double. rbacpolicy_controller_test.go.

3. EPGReconciler in epg TestMain registered without OperatorNamespace,
   defaulting to "". SSA patches targeted namespace "" causing "server could
   not find the requested resource". Set OperatorNamespace: testNamespace.

4. lineage integration probe PermissionSet missing required spec.permissions.
   Added a minimal PermissionRule to the probe object.

All four suites pass: controller, epg, lineage, webhook.
@ontave ontave force-pushed the session/6-integration-envtest-gaps branch from d0aa261 to d88e6c3 Compare May 2, 2026 09:23
@ontave ontave merged commit ade8873 into main May 2, 2026
2 checks passed
@ontave ontave deleted the session/6-integration-envtest-gaps branch May 2, 2026 09:27
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.

1 participant