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

refactor: use mockery-generated mock, remove gomock mock and hostcaller fake #86

Merged

Conversation

fabriziosestito
Copy link
Contributor

Description

Generates a new mock with mockery and removes the gomock (deprecated) generated mock and the hostcaller fake.

Updates tests accordingly.

@fabriziosestito fabriziosestito requested a review from a team as a code owner June 5, 2024 09:09
@fabriziosestito fabriziosestito self-assigned this Jun 5, 2024
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

LGTM, I just left one minor comment

@@ -17,4 +17,4 @@ deps:
go get github.com/golangci/golangci-lint/cmd/golangci-lint

generate-mocks:
docker run --rm -v ${PWD}:/src -w /src golang:1.20-alpine ./hack/generate-mocks.sh
mockery
Copy link
Member

Choose a reason for hiding this comment

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

I've seen from the mockery documentation that's it's possible to generate the mocks with go generate. Can we do that as well, the main reason would to not require the mockery binary to be installed on the system

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@flavio go generate requires the binary to be installed, as it just runs the command in the comment. I prefer having the .mockery.yaml configuration since it is easier to read than a golang comment.

Copy link
Member

Choose a reason for hiding this comment

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

I'm ok with the approach. Also, the Makefile is a bit of a mess.. no phony targets and so. But not needed to fix in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@viccuad could you open an issue about the Makefile?

Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

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

LGTM

@fabriziosestito fabriziosestito merged commit 113fb24 into kubewarden:main Jun 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants