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

Add mockgen source mode for generics + bls imports #2615

Merged
merged 14 commits into from
Jan 17, 2024
Merged

Conversation

dhrubabasu
Copy link
Contributor

@dhrubabasu dhrubabasu commented Jan 16, 2024

Why this should be merged

This PR codifies many of the mode=source mockgens that we've been doing manually (and more importantly adding it to CI)

How this works

Add mockgen source command

How this was tested

CI + manually

@dhrubabasu dhrubabasu added the ci This focuses on changes to the CI process label Jan 16, 2024
@dhrubabasu dhrubabasu added this to the v1.10.18 milestone Jan 16, 2024
@dhrubabasu dhrubabasu self-assigned this Jan 16, 2024
@dhrubabasu dhrubabasu changed the title Update mockgen Add mockgen source mode for bls imports Jan 16, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the file that adds source mode mockgens. It seems like you can only exclude interfaces rather than specify which ones you want to mock which is... annoying

@@ -27,4 +27,22 @@ do

done < "$input"

# tuples of (source import path, comma-separated interface names to exclude, output file path)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Main change of this PR

@dhrubabasu dhrubabasu changed the title Add mockgen source mode for bls imports Add mockgen source mode for generics + bls imports Jan 17, 2024
@dhrubabasu dhrubabasu changed the title Add mockgen source mode for generics + bls imports Add mockgen source mode for generics + bls imports Jan 17, 2024
@dhrubabasu dhrubabasu changed the base branch from dev to uber-go-mock-v0.4.0 January 17, 2024 02:45
Copy link
Contributor

@abi87 abi87 left a comment

Choose a reason for hiding this comment

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

nice cleanup. I wonder if as another step we should just use a single mode, either reflect or source? It's not clear to me why we use both of them

@dhrubabasu
Copy link
Contributor Author

nice cleanup. I wonder if as another step we should just use a single mode, either reflect or source? It's not clear to me why we use both of them

I think we can move to source for all of them. I haven't moved them all to source since I really really dislike the exclude_interfaces since it makes the mockgen file so much more confusing. Opened an issue in the uber repo to track resolution: uber-go/mock#140

Base automatically changed from uber-go-mock-v0.4.0 to dev January 17, 2024 16:27
@StephenButtolph StephenButtolph added this pull request to the merge queue Jan 17, 2024
Merged via the queue into dev with commit d23eecc Jan 17, 2024
17 checks passed
@StephenButtolph StephenButtolph deleted the mockgen-source branch January 17, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci This focuses on changes to the CI process
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants