Skip to content

Add comprehensive tests for kube reconciler functions#330

Merged
Starttoaster merged 1 commit into
mainfrom
add-reconciler-tests
Mar 17, 2026
Merged

Add comprehensive tests for kube reconciler functions#330
Starttoaster merged 1 commit into
mainfrom
add-reconciler-tests

Conversation

@Starttoaster

@Starttoaster Starttoaster commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add envtest integration tests for all reconciler functions: ReconcileService, ReconcileDeployment, ReconcileStatefulset, ReconcilePersistentVolumeClaim, ReconcileConfigMap, and ReconcileIngress
  • Cover create, update, and delete/noop scenarios for each reconciler, including edge cases like selector label changes triggering Deployment/StatefulSet recreation, stale container removal, and stale container field clearing
  • Add pure unit tests for filterStaleContainers and filterStaleContainerFields helper functions
  • Expand the test suite from 2 to 32 specs

Made with Cursor


Note

Low Risk
Test-only changes that expand coverage of Kubernetes reconciler behavior; production reconciliation code is unchanged, but failures could affect CI reliability due to additional envtest scenarios.

Overview
Adds a large set of new Ginkgo specs in reconcilers_test.go, expanding from basic serverSideApply coverage to envtest integration tests for ReconcileConfigMap, ReconcileService, ReconcilePersistentVolumeClaim, ReconcileIngress, ReconcileDeployment, and ReconcileStatefulset across create/update and disabled delete/no-op paths.

Also introduces pure unit tests for filterStaleContainers and filterStaleContainerFields, including cases for selector immutability-triggered Deployment/StatefulSet recreation, stale container removal, and clearing stale optional container fields.

Written by Cursor Bugbot for commit 33fb01e. This will update automatically on new commits. Configure here.

Cover all reconciler functions (Service, Deployment, StatefulSet, PVC,
ConfigMap, Ingress) with envtest integration tests for create, update,
and delete scenarios, plus pure unit tests for filterStaleContainers
and filterStaleContainerFields helpers.

Made-with: Cursor
@Starttoaster
Starttoaster enabled auto-merge (squash) March 17, 2026 19:51
@Starttoaster
Starttoaster merged commit 71c737a into main Mar 17, 2026
16 checks passed
@Starttoaster
Starttoaster deleted the add-reconciler-tests branch March 17, 2026 20:07
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.

2 participants