You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have many tests still using mockery mocks, but never calling AssertExpectations(t) on the mock.
It means these tests pass, although the mocks are often plain wrong, and calling AssertExpectations(t) makes the whole test fail.
Since Mockery v2.12.x, there is now a mock constructor NewMockXXX generated per mock which registers AssertExpectations(t) in the testing t.Cleanup function, hence ensuring the mock is checked at the end of the test.
As of this writing, we use Mockery v2.14.x but we still don't use the new constructors. @qdm12 has been working on replacing all previous new(MockXXX) and &MockXXX to use the newer constructor in #2500 but that makes pretty much a lot of tests fail.
And no, replacing these mockery mocks with gomock mocks won't solve the problem either since the original mock configuration code is wrong. We could replace mockery with gomock mocks as we fix mock configs, but I'd say it would be easier to fix the mockery mocks config first then migrate.
The text was updated successfully, but these errors were encountered:
We have many tests still using mockery mocks, but never calling
AssertExpectations(t)
on the mock.It means these tests pass, although the mocks are often plain wrong, and calling
AssertExpectations(t)
makes the whole test fail.Since Mockery v2.12.x, there is now a mock constructor
NewMockXXX
generated per mock which registersAssertExpectations(t)
in the testingt.Cleanup
function, hence ensuring the mock is checked at the end of the test.As of this writing, we use Mockery v2.14.x but we still don't use the new constructors. @qdm12 has been working on replacing all previous
new(MockXXX)
and&MockXXX
to use the newer constructor in #2500 but that makes pretty much a lot of tests fail.And no, replacing these mockery mocks with gomock mocks won't solve the problem either since the original mock configuration code is wrong. We could replace mockery with gomock mocks as we fix mock configs, but I'd say it would be easier to fix the mockery mocks config first then migrate.
The text was updated successfully, but these errors were encountered: