Skip to content

Commit

Permalink
Merge pull request #532 from jakobmoellerdev/micro-lvms-fix-unit-tests
Browse files Browse the repository at this point in the history
chore: merge with upstream
  • Loading branch information
jakobmoellerdev authored Dec 14, 2023
2 parents c3f468d + dd65bd0 commit c72c249
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/controllers/vgmanager/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,6 @@ func testReconcileFailure(ctx context.Context) {
instances.LSBLK.EXPECT().ListBlockDevices().Once().Return([]lsblk.BlockDevice{
{Name: "/dev/sda", KName: "/dev/sda", FSType: "xfs", PartLabel: "reserved"},
}, nil)
instances.LVM.EXPECT().ListVGs().Once().Return(nil, nil)
instances.LVM.EXPECT().ListPVs("").Once().Return(nil, nil)
instances.LSBLK.EXPECT().BlockDeviceInfos(mock.Anything).Once().Return(lsblk.BlockDeviceInfos{
"/dev/sda": {
Expand Down Expand Up @@ -813,9 +812,10 @@ func testReconcileFailure(ctx context.Context) {
IsUsableLoopDev: false,
},
}, nil)
instances.LVM.EXPECT().ListLVs("vg1").Once().Return(nil, fmt.Errorf("mocked error"))
expectedError := fmt.Errorf("mocked error")
instances.LVM.EXPECT().ListLVs("vg1").Once().Return(nil, expectedError)
_, err := instances.Reconciler.Reconcile(ctx, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(vg)})
Expect(err).To(HaveOccurred())
Expect(err).To(MatchError(expectedError))
})
}

Expand Down

0 comments on commit c72c249

Please sign in to comment.