-
Notifications
You must be signed in to change notification settings - Fork 6.5k
chore: use Mock Constructors from mockery #24940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
3f804ae to
777b5a9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #24940 +/- ##
==========================================
- Coverage 60.79% 60.79% -0.01%
==========================================
Files 351 351
Lines 60439 60439
==========================================
- Hits 36745 36744 -1
Misses 20772 20772
- Partials 2922 2923 +1 ☔ View full report in Codecov by Sentry. |
6f78959 to
fafd0e7
Compare
6940093 to
a984284
Compare
f7ad349 to
9897e99
Compare
|
The TestAppRevisionsMultiSource is failing. Does the order matter here ? Any suggestion on the way to adress this ? |
4c8190e to
6d42cdd
Compare
abcf7ab to
eeefdc5
Compare
| ) | ||
| db := &dbmocks.ArgoDB{} | ||
| db.On("GetApplicationControllerReplicas").Return(1) | ||
| db := dbmocks.NewArgoDB(t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason this change is making the test fail.
| db := dbmocks.NewArgoDB(t) | |
| db := &dbmocks.ArgoDB{} |
099686c to
20a6825
Compare
e1d49f3 to
4fff3cb
Compare
|
@mmorel-35 my 2 cents on having mock constructors checking and expecting all the calls is that this will be quite obnoxious - most of the time when we write tests we want stubs (basically "if this method is called return this value" and nothing else), and we do this in bulk in some places, because we just want some arbitrary values for being able to run the tests. My general feeling is that we'll now be adding a bunch of actual mocks (every expectation that gets setup will get verified by mockery), and that this change will be a bit too intrusive for the dev/test workflow. |
Signed-off-by: Matthieu MOREL <[email protected]>
4fff3cb to
c2ab6e5
Compare
|
Ok, let's drop this ! |
|
@mmorel-35 I think the expector struct thing is a good thing though, so if you could do that and stick with using |
|
I'll try again on this part |
Description
Mock Constructors from mockery allows to replace
factory := &mocks.Factory{}withmocks.NewFactory(t)Checklist: