-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Update module github.com/vektra/mockery/v2 to v3 #7042
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
Signed-off-by: anmol7344 <anmol7344@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
❌ Your project status has failed because the head coverage (50.75%) is below the target coverage (95.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## main #7042 +/- ##
===========================================
- Coverage 96.01% 50.75% -45.27%
===========================================
Files 349 176 -173
Lines 20677 10701 -9976
===========================================
- Hits 19854 5431 -14423
- Misses 620 4868 +4248
- Partials 203 402 +199
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@yurishkuro what failed in Lint Checks i did not quite get them. |
it seems lots of test files are being generated for mocks now
I am not sure what value these tests provide, as we don't test codegen files and exclude them from code coverage calculations. Can we tell mockery not to generate the test files? |
I did not get any config option to disable the test files generation. |
Turns out these are not test files, it's where mockery now generates the mocks. So your change builds fine in the CI because you did not delete any of the old files (which are used to compile code) and did not check-in the new files (which would not compile because they are used from other packages, and I don't think |
So old files are to be replaced with new mock files? |
If there's no way to keep the old style files then you need to delete them and commit the new ones. I think it would also be good to do the deletion automatically by looping through all dirs in mockery config and running rm $dir/*.go before regenerating. This will ensure we don't have stale files. |
I have removed all the old files but the issue is |
Change the file name to mocks.go, there is a config option guy for that. |
Some of the generated mocks are failing unit tests. It is hard to pinpoint the reason. It seems there might be mismatch between mocks and actual function but i am not sure how to fix this. |
I don't see any failures of tests in the CI |
Signed-off-by: anmol7344 <anmol7344@gmail.com>
actually i tested them locally. Now i have pushed them to the pr |
Something might have changed in mockery to make it more strict. We need to take this package by package. It's all fixable. Looking at some of the errors it seems obvious which arguments are missing to the mock calls. |
I think #7045 generates mocks in v2. |
The issues you encounter are happening with mockery v2, so we need to fix them there first, to make the migration smoother. I think #7046 narrows down the issue to just Cassandra mocks |
I think i encountered issues after migrating to v3. All the previous mocks are changed with new mocks. |
I think if migrating to v3 was not the point then it defies the the purpose of the issue. |
Yes because the defaults were changed in v3 and we were already getting a warning about that in v2. So the better approach is to fix the warnings in v2 first before upgrading. |
Oh! actually almost fixed all the warnings in v3 so now should I switch back to v2 fix the warnings by opening a new pr? |
I removed the last instance of that flag (warning) #7048 (feel free to approve) |
And you may have to recreate this PR after #7048 is merged, otherwise you will have lots of conflicts. |
Closing this pr as it is already having lot of merge conflicts. Will open a new pr when #7048 is merged. |
## Which problem is this PR solving? - Resolves #7008 ## Description of the changes - Continuation of pr #7042 ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: anmol7344 <anmol7344@gmail.com> Signed-off-by: Yuri Shkuro <github@ysh.us> Co-authored-by: Yuri Shkuro <github@ysh.us>
## Which problem is this PR solving? - Resolves jaegertracing#7008 ## Description of the changes - Continuation of pr jaegertracing#7042 ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: anmol7344 <anmol7344@gmail.com> Signed-off-by: Yuri Shkuro <github@ysh.us> Co-authored-by: Yuri Shkuro <github@ysh.us>
## Which problem is this PR solving? - Resolves jaegertracing#7008 ## Description of the changes - Continuation of pr jaegertracing#7042 ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: anmol7344 <anmol7344@gmail.com> Signed-off-by: Yuri Shkuro <github@ysh.us> Co-authored-by: Yuri Shkuro <github@ysh.us> Signed-off-by: amol-verma-allen <amol.verma@allen.in>
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test