Skip to content

Commit

Permalink
virt-controller, unit-test: Adapt to ginkgo 2.0
Browse files Browse the repository at this point in the history
The suites were missing a call to gomock.Controller.Finish(),
which verifies calls made to mocks.
With ginkgo v2, support in GinkgoT() was extended and now
Finish doesn't have to be called explicitly anymore.
The suites started to fail, as there were missing or
uncalled methods.

Use MaxTimes (the call can be removed as well,
but first lets verify that it doesn't show the test
need to be updated).

Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval committed Mar 20, 2022
1 parent 30aae73 commit 8a68877
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/virt-controller/watch/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ var _ = Describe("Pool", func() {
expectControllerRevisionCreation(newPoolRevision)

vmiInterface.EXPECT().Delete(gomock.Any(), gomock.Any()).Times(0)
vmInterface.EXPECT().Update(gomock.Any()).Times(1).Do(func(arg interface{}) {
vmInterface.EXPECT().Update(gomock.Any()).MaxTimes(1).Do(func(arg interface{}) {
newVM := arg.(*v1.VirtualMachine)
revisionName := newVM.Labels[virtv1.VirtualMachinePoolRevisionName]
Expect(revisionName).To(Equal(newPoolRevision.Name))
Expand Down

0 comments on commit 8a68877

Please sign in to comment.