Skip to content
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

feat: bump mockery and switch to generate by config file #20742

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

chlins
Copy link
Member

@chlins chlins commented Jul 15, 2024

WRN DEPRECATION: use of the packages config will be the only way to generate mocks in v3. Please migrate your config to use the packages feature. dry-run=false migration=https://vektra.github.io/mockery/v2.43/migrating_to_packages/ url=https://vektra.github.io/mockery/v2.43/features/#packages-configuration version=v2.43.2

The packages feature in mockery is the new way for managing mocks, and will be the only way to generate mocks in v3. see
https://vektra.github.io/mockery/v2.43/migrating_to_packages/.

  1. Bump mockery to v2.43.2.
  2. Switch the generation from old way to configuration yaml.

Significant improvement in performance after using the packaging feature.

Before:

time go generate ./...
go generate ./...  25.96s user 40.71s system 177% cpu 37.586 total

After:

$ time mockery
mockery  0.94s user 0.90s system 154% cpu 1.195 total

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #20125

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@chlins chlins added the release-note/update Update or Fix label Jul 15, 2024
@chlins chlins requested a review from a team as a code owner July 15, 2024 03:07
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.24%. Comparing base (c8c11b4) to head (6992f37).
Report is 241 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #20742       +/-   ##
===========================================
+ Coverage   45.36%   66.24%   +20.87%     
===========================================
  Files         244     1045      +801     
  Lines       13333   113501   +100168     
  Branches     2719     2845      +126     
===========================================
+ Hits         6049    75192    +69143     
- Misses       6983    34202    +27219     
- Partials      301     4107     +3806     
Flag Coverage Δ
unittests 66.24% <ø> (+20.87%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/jobservice/mgt/mock_manager.go 5.64% <ø> (ø)
src/jobservice/period/mock_scheduler.go 41.46% <ø> (ø)
src/lib/cache/cache.go 64.40% <ø> (ø)

... and 1284 files with indirect coverage changes

Copy link
Contributor

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chlins
Copy link
Member Author

chlins commented Jul 16, 2024

cc @reasonerjt

The packages feature in mockery is the new way for managing mocks, and
will be the only way to generate mocks in v3. see
https://vektra.github.io/mockery/v2.43/migrating_to_packages/.

1. Bump mockery to v2.43.2.
2. Switch the generation from old way to configuration yaml.

Signed-off-by: chlins <[email protected]>
@chlins chlins merged commit 64df11b into goharbor:main Jul 17, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/update Update or Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the speed for gen_mocks
5 participants