-
Notifications
You must be signed in to change notification settings - Fork 660
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
Move to upstream mockery #4937
Move to upstream mockery #4937
Conversation
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4937 +/- ##
==========================================
- Coverage 61.10% 61.08% -0.02%
==========================================
Files 793 793
Lines 51156 51156
==========================================
- Hits 31257 31251 -6
- Misses 17027 17033 +6
Partials 2872 2872
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Eduardo Apolinario <[email protected]>
Once #5134 is merged I'm going to update this PR. |
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
This reverts commit 9f7d745. Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
codespell CI check is being fixed in #5418. |
# If tool is named vektra/mockery/v2, we need to rename the binary to mockery-v2 | ||
if [[ $tool == "github.com/vektra/mockery/[email protected]" ]]; then | ||
echo "Renaming mockery to mockery-v2" | ||
mv $(go env GOPATH)/bin/mockery $(go env GOPATH)/bin/mockery-v2 |
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.
Depending on the timeline to manage the migration, do you know of a linter that would let us block new usage of go:generate mockery
? I was looking at forbidigo, but I don't see a file exclusion
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.
Good idea, although in the case of forbidigo
it looks like it can't handle comments. In any case, I'm going to experiment with this in a separate PR. Maybe there's a way to restrict the linter to files in a PR (this might involve running a command via a run
block in a gh action to list the go files in a PR, something like git diff --name-only master | grep '.go$'
and pass that list to this tool).
* Switch to vektra/mockery Signed-off-by: Eduardo Apolinario <[email protected]> * Add support for both versions of mockery to coexist Signed-off-by: Eduardo Apolinario <[email protected]> * Fix a few typos Signed-off-by: Eduardo Apolinario <[email protected]> * Rename binaries to reflect their sources Signed-off-by: Eduardo Apolinario <[email protected]> * Add missing pflags binary Signed-off-by: Eduardo Apolinario <[email protected]> * Install upstream mockery in boilerplate Signed-off-by: Eduardo Apolinario <[email protected]> * Add example in flyteadmin Signed-off-by: Eduardo Apolinario <[email protected]> * Rename to mockery-v2 Signed-off-by: Eduardo Apolinario <[email protected]> * Move WorkflowExecutor to mockery-v2 Signed-off-by: Eduardo Apolinario <[email protected]> * Revert "Move WorkflowExecutor to mockery-v2" This reverts commit 9f7d745. Signed-off-by: Eduardo Apolinario <[email protected]> * Revert changes to executor Signed-off-by: Eduardo Apolinario <[email protected]> * Modify SignalInterface to use mockery-v2 Signed-off-by: Eduardo Apolinario <[email protected]> --------- Signed-off-by: Eduardo Apolinario <[email protected]> Co-authored-by: Eduardo Apolinario <[email protected]>
Tracking issue
#4934
Why are the changes needed?
Harder to contribute code for newer contributors and the codebase don't get upstream changes
What changes were proposed in this pull request?
In order to facilitate the migration to
vektra/mockery
, this PR sets up an environment where both versions of mockery are available. The current use of mockery is kept, and we can start moving to upstream mockery mock by mock, by switching to usingmockery-v2
binary in the//go:generate
directive, e.g.//go:generate mockery-v2 ...
(notice that flags are passed using--
, not-
).I added one example in flyteadmin. Notice how the call to generate the mock is slightly different
SignalInterface
:Notice the need to add
--with-expecter
in order to generate expecter structs.How was this patch tested?
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link