-
Notifications
You must be signed in to change notification settings - Fork 82
Complete unit tests for cleanup helpers in kubevirt.go #4633
Copy link
Copy link
Open
Description
Context
As part of PR #4618 (MTV-3353), new cleanup helpers were added to pkg/controller/plan/kubevirt.go to handle plan archival and populator finalizer removal. While some basic tests were added, several cleanup helpers still lack unit test coverage.
Missing Test Coverage
The following helpers need unit tests following the pattern established in pkg/controller/plan/kubevirt_test.go:
DeleteAllPlanConfigMapsDeleteAllPlanJobsDeleteAllPlanPopulatorCRsRemoveAllPlanPVCFinalizersremovePopulatorFinalizerFromPVCDeleteMigrationPodsDeleteMigrationVMsDeleteMigrationDataVolumes
Testing Approach
Tests should follow the existing pattern:
- Use
createKubeVirtWithPlanUIDAndObjectsto set up test fixtures - Create resources with matching and non-matching labels
- Call the cleanup method
- Assert that only the correct resources are deleted/modified
- For finalizer tests, verify finalizers are removed from the correct PVCs
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels