-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Summary
Follow-up to PR #2 - add comprehensive unit tests for the BackupPlugin functions that require kubernetes client mocking.
Functions needing test coverage
| Function | Requires |
|---|---|
checkVolumePolicies() |
Mock CRClient, CoreClient, volumehelper |
getFirstKubevirtPVC() |
Mock CRClient, CoreClient, volumehelper |
Execute() success path |
Mock dynamic client for DataUpload creation |
Progress() |
Mock dynamic client for DataUpload status |
Cancel() |
Mock dynamic client |
createDataUpload() |
Mock dynamic client |
getDataUploadByOperationID() |
Mock dynamic client |
updateDataUpload() |
Mock dynamic client |
Approach
- Use
k8s.io/client-go/kubernetes/fakefor CoreClient - Use
sigs.k8s.io/controller-runtime/pkg/client/fakefor CRClient - Mock
volumehelper.ShouldPerformSnapshotWithBackupor test with fake configmaps - Use the existing
SetDynamicClientFunchook for dynamic client mocking
Related
- PR Add VirtualMachine BackupItemAction plugin for kubevirt datamover #2: Add VirtualMachine BackupItemAction plugin
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels