-
-
Notifications
You must be signed in to change notification settings - Fork 54
upgrade mockery to v3 #561
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
WalkthroughReplaced Mockery configuration from .mockery.yaml to .mockery.yml and updated Makefile to use the new config and default tag. Regenerated mocks with testify template, adding/removing constructors, standardising receiver/parameter names, and adjusting mock call helpers. schedule/mocks/Handler.go now embeds testify’s mock.Mock and updates method helper signatures. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
Makefile (1)
116-116: Safer mock cleanup to avoid directory deletion errorsfind may hit directories under mocks; rm without -r will error, and behaviour differs by platform. Restrict to files and delete directly.
Apply:
- find . -path "*/mocks/*" -exec rm {} \; + find . -type f -path "*/mocks/*" -delete.mockery.yml (1)
5-7: Lock in expecter generation explicitlyMocs include Expecter types; make this explicit to avoid future default changes altering generated API.
Apply:
template: testify +with-expecter: true template-data: unroll-variadic: true
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.mockery.yaml(0 hunks).mockery.yml(1 hunks)Makefile(2 hunks)config/mocks/NamedPropertySet.go(16 hunks)config/mocks/ProfileInfo.go(15 hunks)config/mocks/PropertyInfo.go(47 hunks)config/mocks/SectionInfo.go(20 hunks)monitor/mocks/OutputAnalysis.go(9 hunks)schedule/mocks/Handler.go(14 hunks)
💤 Files with no reviewable changes (1)
- .mockery.yaml
🧰 Additional context used
🧬 Code graph analysis (5)
config/mocks/NamedPropertySet.go (2)
config/info.go (2)
NamedPropertySet(66-69)PropertyInfo(72-117)config/mocks/PropertyInfo.go (1)
PropertyInfo(28-30)
schedule/mocks/Handler.go (5)
schedule/handler.go (1)
Handler(12-29)user/user.go (1)
User(3-10)schedule/permission.go (1)
Permission(7-7)schedule/config.go (1)
Config(10-29)calendar/event.go (1)
Event(15-24)
config/mocks/SectionInfo.go (3)
config/info.go (2)
SectionInfo(30-39)PropertyInfo(72-117)restic/commands.go (1)
CommandIf(124-134)config/mocks/PropertyInfo.go (1)
PropertyInfo(28-30)
config/mocks/PropertyInfo.go (3)
config/info.go (4)
PropertyInfo(72-117)NumericRange(120-123)PropertySet(50-63)NamedPropertySet(66-69)restic/commands.go (1)
Option(28-33)config/mocks/NamedPropertySet.go (1)
NamedPropertySet(27-29)
config/mocks/ProfileInfo.go (3)
config/info.go (4)
NewProfileInfo(659-661)ProfileInfo(20-27)PropertyInfo(72-117)SectionInfo(30-39)config/mocks/PropertyInfo.go (1)
PropertyInfo(28-30)config/mocks/SectionInfo.go (1)
SectionInfo(28-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build and test (1.24, windows-latest)
- GitHub Check: Build and test (1.24, macos-latest)
- GitHub Check: Build and test (1.24, ubuntu-latest)
🔇 Additional comments (8)
Makefile (1)
114-118: Good: switched to .mockery.yml and using the config flagThe target now runs mockery with the new YAML filename; this aligns with the new config file added in the repo.
config/mocks/NamedPropertySet.go (1)
12-24: Constructor addition LGTMNewNamedPropertySet sets up TestingT and assertions via t.Cleanup; this matches the pattern used elsewhere.
config/mocks/PropertyInfo.go (1)
13-26: Constructor addition LGTMNewPropertyInfo mirrors the standard constructor pattern with Test/Cleanup. No API risk.
monitor/mocks/OutputAnalysis.go (1)
13-26: Constructor addition LGTMNewOutputAnalysis initialises the embed and registers Cleanup; consistent with testify mock best practice.
schedule/mocks/Handler.go (2)
14-26: Constructor and embed change LGTMSwitching Handler to embed mock.Mock and adding NewHandler with Test/Cleanup is correct and consistent with other mocks.
41-55: Signature alignment with interface looks correctCheckPermission uses user.User and schedule.Permission as per schedule.Handler interface.
Please confirm no call sites relied on parameter names (e.g., using reflect-based arg matchers by name); testify matches by position/type, so this should be safe.
config/mocks/ProfileInfo.go (1)
12-24: Constructor upgrade LGTM.The new constructor wiring with
Cleanupmirrors the testify v3 templates and will auto-assert expectations without extra boilerplate. No issues spotted.config/mocks/SectionInfo.go (1)
13-25: Constructor upgrade LGTM.The SectionInfo mock picks up the same testify v3 constructor pattern, so expectation assertions will now run automatically via
Cleanup. Looks solid.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #561 +/- ##
=======================================
Coverage 79.70% 79.70%
=======================================
Files 137 137
Lines 13462 13462
=======================================
Hits 10729 10729
Misses 2306 2306
Partials 427 427
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:
|
|



No description provided.