-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: remove mockery from tools.go (#9196)
The `mockery` project recommends against using a binary of `mockery` that has been created using `go install`. vektra/mockery#456. Developers of Tendermint wishing to generate mocks should avoid having a version of `mockery` on their path that does not match the version listed in [mockery_generate.sh](https://github.com/tendermint/tendermint/blob/10e1ac8feabd8ce7fd560ebecb11b929376fcb9c/scripts/mockery_generate.sh#L11). To make this easier for developers, the `mockery_generate.sh` script uses a containerized copy of `mockery` if `mockery` is not present on the developer's `PATH`. This containerized version of `mockery` uses the same version of mockery as our CI pipelines and allows all developers to automatically use the same version without having to manage it themselves. #### PR checklist - [ ] Tests written/updated, or no tests needed - [ ] `CHANGELOG_PENDING.md` updated, or no changelog entry needed - [ ] Updated relevant documentation (`docs/`) and code comments, or no documentation updates needed
- Loading branch information
1 parent
a2bc851
commit 3e6da20
Showing
4 changed files
with
9 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
#!/bin/sh | ||
# | ||
# Invoke Mockery v2 to update generated mocks for the given type. | ||
# | ||
# This script runs a locally-installed "mockery" if available, otherwise it | ||
# runs the published Docker container. This legerdemain is so that the CI build | ||
# and a local build can work off the same script. | ||
# | ||
if ! which mockery ; then | ||
mockery() { | ||
docker run --rm -v "$PWD":/w --workdir=/w vektra/mockery:v2.12.3 | ||
} | ||
fi | ||
|
||
mockery --disable-version-string --case underscore --name "$@" | ||
go run github.com/vektra/mockery/v2 --disable-version-string --case underscore --name "$*" | ||
|