-
Notifications
You must be signed in to change notification settings - Fork 87
CLOUDP-62054: replace mock generation in make with go generate #187
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
We use [mockgen](https://github.com/golang/mock) to handle mocking in our unit tests | ||
If you need a new mock please add a reference on the [Make](Makefile) file and run `make gen-mocks` | ||
We use [mockgen](https://github.com/golang/mock) to handle mocking in our unit tests. | ||
If you need a new mock please update or add the `//go:generate` instruction to the appropriate file |
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.
💯
@@ -30,6 +33,36 @@ type HostDescriber interface { | |||
Host(string, string) (*opsmngr.Host, error) | |||
} | |||
|
|||
type HostDatabaseLister interface { |
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.
I don't think this should be part of this PR. You don't have to change it, it is just my opinion since this doesn't seem related to the scope of the PR.
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.
the reason I did it was to group the related methods and thus reducing the files to tag with go generate, if you check they all use the same opsmngr. Deployments
module, this changed on the client but we never updated the file grouping so here I'm doing that, but to your point yes, they could've been a separate PR
@@ -23,10 +23,26 @@ import ( | |||
"go.mongodb.org/ops-manager/opsmngr" | |||
) | |||
|
|||
//go:generate mockgen -destination=../mocks/mock_measurements.go -package=mocks github.com/mongodb/mongocli/internal/store HostMeasurementLister,HostDiskMeasurementsLister | |||
|
|||
type HostMeasurementLister interface { |
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.
Same as above
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.
LGTM
Proposed changes
Jira ticket: CLOUDP-62054
Closes #[issue number]
Checklist
make fmt
and formatted my code