diff --git a/Makefile b/Makefile index 3f4d7be43..89a78053c 100644 --- a/Makefile +++ b/Makefile @@ -327,6 +327,29 @@ endef gen_apis: SWAGGER_IMAGENAME $(call swagger_generate_server,api/v2.0/swagger.yaml,src/server/v2.0,harbor) + +MOCKERY_IMAGENAME=goharbor/mockery +MOCKERY_VERSION=v2.1.0 +MOCKERY=$(DOCKERCMD) run --rm -u $(shell id -u):$(shell id -g) -v $(BUILDPATH):$(BUILDPATH) -w $(BUILDPATH) ${MOCKERY_IMAGENAME}:${MOCKERY_VERSION} +MOCKERY_IMAGE_BUILD_CMD=${DOCKERBUILD} -f ${TOOLSPATH}/mockery/Dockerfile --build-arg GOLANG=${GOBUILDIMAGE} --build-arg MOCKERY_VERSION=${MOCKERY_VERSION} -t ${MOCKERY_IMAGENAME}:$(MOCKERY_VERSION) . + +MOCKERY_IMAGE: + @if [ "$(shell ${DOCKERIMAGES} -q ${MOCKERY_IMAGENAME}:$(MOCKERY_VERSION) 2> /dev/null)" == "" ]; then \ + ${MOCKERY_IMAGE_BUILD_CMD} && echo "build mockery image successfully" || (echo "build mockery image failed" && exit 1) ; \ + fi + +gen_mocks: MOCKERY_IMAGE + ${MOCKERY} go generate ./... + +mocks_check: gen_mocks + @echo checking mocks... + @res=$$(git status -s src/ | awk '{ printf("%s\n", $$2) }' | egrep .*.go); \ + if [ -n "$${res}" ]; then \ + echo mocks of the interface are out of date... ; \ + echo "$${res}"; \ + exit 1; \ + fi + export VERSIONS_FOR_PREPARE versions_prepare: @echo "$$VERSIONS_FOR_PREPARE" > $(MAKE_PREPARE_PATH)/$(PREPARE_VERSION_NAME) @@ -435,7 +458,7 @@ gosec: $(GOPATH)/bin/gosec -fmt=json -out=harbor_gas_output.json -quiet ./... | true ; \ fi -go_check: gen_apis misspell gofmt commentfmt golint govet +go_check: gen_apis mocks_check misspell gofmt commentfmt golint govet gofmt: @echo checking gofmt... diff --git a/codecov.yml b/codecov.yml index ad312c580..b1778a6d6 100644 --- a/codecov.yml +++ b/codecov.yml @@ -28,5 +28,6 @@ comment: ignore: - "src/vendor" + - "src/testing" - "src/github.com/goharbor/harbor/src/server/v2.0/restapi/**/*" - "src/github.com/goharbor/harbor/src/server/v2.0/models" diff --git a/src/pkg/scheduler/dao.go b/src/pkg/scheduler/dao.go index f854a6388..87256ca34 100644 --- a/src/pkg/scheduler/dao.go +++ b/src/pkg/scheduler/dao.go @@ -40,11 +40,11 @@ type schedule struct { // DAO is the data access object interface for schedule type DAO interface { - Create(ctx context.Context, schedule *schedule) (id int64, err error) + Create(ctx context.Context, s *schedule) (id int64, err error) List(ctx context.Context, query *q.Query) (schedules []*schedule, err error) - Get(ctx context.Context, id int64) (schedule *schedule, err error) + Get(ctx context.Context, id int64) (s *schedule, err error) Delete(ctx context.Context, id int64) (err error) - Update(ctx context.Context, schedule *schedule, props ...string) (err error) + Update(ctx context.Context, s *schedule, props ...string) (err error) } type dao struct{} diff --git a/src/pkg/scheduler/mock.go b/src/pkg/scheduler/mock.go index 7472da311..00a574f2b 100644 --- a/src/pkg/scheduler/mock.go +++ b/src/pkg/scheduler/mock.go @@ -14,4 +14,4 @@ package scheduler -//go:generate mockery -name DAO -output . -outpkg scheduler -filename mock_dao_test.go -structname mockDAO -inpkg +//go:generate mockery --name DAO --output . --outpkg scheduler --filename mock_dao_test.go --structname mockDAO --inpackage diff --git a/src/pkg/scheduler/mock_dao_test.go b/src/pkg/scheduler/mock_dao_test.go index 56cd768bc..70e8504be 100644 --- a/src/pkg/scheduler/mock_dao_test.go +++ b/src/pkg/scheduler/mock_dao_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.1.2. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package scheduler @@ -14,20 +14,20 @@ type mockDAO struct { mock.Mock } -// Create provides a mock function with given fields: ctx, schedule -func (_m *mockDAO) Create(ctx context.Context, schd *schedule) (int64, error) { - ret := _m.Called(ctx, schd) +// Create provides a mock function with given fields: ctx, s +func (_m *mockDAO) Create(ctx context.Context, s *schedule) (int64, error) { + ret := _m.Called(ctx, s) var r0 int64 if rf, ok := ret.Get(0).(func(context.Context, *schedule) int64); ok { - r0 = rf(ctx, schd) + r0 = rf(ctx, s) } else { r0 = ret.Get(0).(int64) } var r1 error if rf, ok := ret.Get(1).(func(context.Context, *schedule) error); ok { - r1 = rf(ctx, schd) + r1 = rf(ctx, s) } else { r1 = ret.Error(1) } @@ -95,20 +95,20 @@ func (_m *mockDAO) List(ctx context.Context, query *q.Query) ([]*schedule, error return r0, r1 } -// Update provides a mock function with given fields: ctx, schedule, props -func (_m *mockDAO) Update(ctx context.Context, schd *schedule, props ...string) error { +// Update provides a mock function with given fields: ctx, s, props +func (_m *mockDAO) Update(ctx context.Context, s *schedule, props ...string) error { _va := make([]interface{}, len(props)) for _i := range props { _va[_i] = props[_i] } var _ca []interface{} - _ca = append(_ca, ctx, schd) + _ca = append(_ca, ctx, s) _ca = append(_ca, _va...) ret := _m.Called(_ca...) var r0 error if rf, ok := ret.Get(0).(func(context.Context, *schedule, ...string) error); ok { - r0 = rf(ctx, schd, props...) + r0 = rf(ctx, s, props...) } else { r0 = ret.Error(0) } diff --git a/src/pkg/task/mock.go b/src/pkg/task/mock.go index 1c1761aa4..0a113159c 100644 --- a/src/pkg/task/mock.go +++ b/src/pkg/task/mock.go @@ -14,20 +14,7 @@ package task -//go:generate mockery -dir ./dao -name TaskDAO -output . -outpkg task -filename mock_task_dao_test.go -structname mockTaskDAO -//go:generate mockery -dir ./dao -name ExecutionDAO -output . -outpkg task -filename mock_execution_dao_test.go -structname mockExecutionDAO -// Need to modify the generated mock code manually to avoid the compile error: https://github.com/vektra/mockery/issues/293 -/* -func (_m *mockTaskManager) Create(ctx context.Context, executionID int64, job *Job, extraAttrs ...map[string]interface{}) (int64, error) { - _va := make([]interface{}, len(extraAttrs)) - for _i := range extraAttrs { - _va[_i] = extraAttrs[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, executionID, job) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - ... -*/ -//go:generate mockery -name Manager -output . -outpkg task -filename mock_task_manager_test.go -structname mockTaskManager -inpkg -//go:generate mockery -dir ../../common/job -name Client -output . -outpkg task -filename mock_jobservice_client_test.go -structname mockJobserviceClient +//go:generate mockery --dir ./dao --name TaskDAO --output . --outpkg task --filename mock_task_dao_test.go --structname mockTaskDAO +//go:generate mockery --dir ./dao --name ExecutionDAO --output . --outpkg task --filename mock_execution_dao_test.go --structname mockExecutionDAO +//go:generate mockery --name Manager --output . --outpkg task --filename mock_task_manager_test.go --structname mockTaskManager --inpackage +//go:generate mockery --dir ../../common/job --name Client --output . --outpkg task --filename mock_jobservice_client_test.go --structname mockJobserviceClient diff --git a/src/pkg/task/mock_execution_dao_test.go b/src/pkg/task/mock_execution_dao_test.go index 0de324e81..c63da61be 100644 --- a/src/pkg/task/mock_execution_dao_test.go +++ b/src/pkg/task/mock_execution_dao_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.1.2. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package task diff --git a/src/pkg/task/mock_jobservice_client_test.go b/src/pkg/task/mock_jobservice_client_test.go index 419301290..c2860e81f 100644 --- a/src/pkg/task/mock_jobservice_client_test.go +++ b/src/pkg/task/mock_jobservice_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.1.2. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package task diff --git a/src/pkg/task/mock_task_dao_test.go b/src/pkg/task/mock_task_dao_test.go index 56efa6030..918799625 100644 --- a/src/pkg/task/mock_task_dao_test.go +++ b/src/pkg/task/mock_task_dao_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.1.2. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package task diff --git a/src/pkg/task/mock_task_manager_test.go b/src/pkg/task/mock_task_manager_test.go index c56282117..06d2a33e8 100644 --- a/src/pkg/task/mock_task_manager_test.go +++ b/src/pkg/task/mock_task_manager_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.1.2. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package task diff --git a/src/testing/common/common.go b/src/testing/common/common.go index e525e2b95..137477565 100644 --- a/src/testing/common/common.go +++ b/src/testing/common/common.go @@ -14,4 +14,4 @@ package common -//go:generate mockery -case snake -dir ../../common/security -name Context -output ./security -outpkg security +//go:generate mockery --case snake --dir ../../common/security --name Context --output ./security --outpkg security diff --git a/src/testing/common/security/context.go b/src/testing/common/security/context.go index 575965cc2..27dfc706a 100644 --- a/src/testing/common/security/context.go +++ b/src/testing/common/security/context.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package security diff --git a/src/testing/controller/artifact/controller.go b/src/testing/controller/artifact/controller.go index 2dc087fca..80289a986 100644 --- a/src/testing/controller/artifact/controller.go +++ b/src/testing/controller/artifact/controller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package artifact diff --git a/src/testing/controller/blob/controller.go b/src/testing/controller/blob/controller.go index 31100d4f3..8f4241e0e 100644 --- a/src/testing/controller/blob/controller.go +++ b/src/testing/controller/blob/controller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package blob diff --git a/src/testing/controller/controller.go b/src/testing/controller/controller.go index cb965b427..01949ca4f 100644 --- a/src/testing/controller/controller.go +++ b/src/testing/controller/controller.go @@ -14,10 +14,10 @@ package controller -//go:generate mockery -case snake -dir ../../controller/artifact -name Controller -output ./artifact -outpkg artifact -//go:generate mockery -case snake -dir ../../controller/blob -name Controller -output ./blob -outpkg blob -//go:generate mockery -case snake -dir ../../controller/project -name Controller -output ./project -outpkg project -//go:generate mockery -case snake -dir ../../controller/quota -name Controller -output ./quota -outpkg quota -//go:generate mockery -case snake -dir ../../controller/scan -name Controller -output ./scan -outpkg scan -//go:generate mockery -case snake -dir ../../controller/scan -name Checker -output ./scan -outpkg scan -//go:generate mockery -case snake -dir ../../controller/scanner -name Controller -output ./scanner -outpkg scanner +//go:generate mockery --case snake --dir ../../controller/artifact --name Controller --output ./artifact --outpkg artifact +//go:generate mockery --case snake --dir ../../controller/blob --name Controller --output ./blob --outpkg blob +//go:generate mockery --case snake --dir ../../controller/project --name Controller --output ./project --outpkg project +//go:generate mockery --case snake --dir ../../controller/quota --name Controller --output ./quota --outpkg quota +//go:generate mockery --case snake --dir ../../controller/scan --name Controller --output ./scan --outpkg scan +//go:generate mockery --case snake --dir ../../controller/scan --name Checker --output ./scan --outpkg scan +//go:generate mockery --case snake --dir ../../controller/scanner --name Controller --output ./scanner --outpkg scanner diff --git a/src/testing/controller/project/controller.go b/src/testing/controller/project/controller.go index 32d215317..61afc88d7 100644 --- a/src/testing/controller/project/controller.go +++ b/src/testing/controller/project/controller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package project diff --git a/src/testing/controller/quota/controller.go b/src/testing/controller/quota/controller.go index 37bf6bf71..b26c5663b 100644 --- a/src/testing/controller/quota/controller.go +++ b/src/testing/controller/quota/controller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package quota diff --git a/src/testing/controller/scan/checker.go b/src/testing/controller/scan/checker.go index b5d3f2072..6bba0410f 100644 --- a/src/testing/controller/scan/checker.go +++ b/src/testing/controller/scan/checker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package scan diff --git a/src/testing/controller/scan/controller.go b/src/testing/controller/scan/controller.go index 1b8fdcefd..0b012260a 100644 --- a/src/testing/controller/scan/controller.go +++ b/src/testing/controller/scan/controller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package scan diff --git a/src/testing/controller/scanner/controller.go b/src/testing/controller/scanner/controller.go index 3d5af1342..319940778 100644 --- a/src/testing/controller/scanner/controller.go +++ b/src/testing/controller/scanner/controller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package scanner diff --git a/src/testing/pkg/blob/manager.go b/src/testing/pkg/blob/manager.go index cb2692177..cce2faf27 100644 --- a/src/testing/pkg/blob/manager.go +++ b/src/testing/pkg/blob/manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package blob diff --git a/src/testing/pkg/distribution/manifest.go b/src/testing/pkg/distribution/manifest.go index 8ccc683ca..ba560daf5 100644 --- a/src/testing/pkg/distribution/manifest.go +++ b/src/testing/pkg/distribution/manifest.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package distribution diff --git a/src/testing/pkg/pkg.go b/src/testing/pkg/pkg.go index e701ee909..3e93d175e 100644 --- a/src/testing/pkg/pkg.go +++ b/src/testing/pkg/pkg.go @@ -14,10 +14,11 @@ package pkg -//go:generate mockery -case snake -dir ../../pkg/blob -name Manager -output ./blob -outpkg blob -//go:generate mockery -case snake -dir ../../vendor/github.com/docker/distribution -name Manifest -output ./distribution -outpkg distribution -//go:generate mockery -case snake -dir ../../pkg/quota -name Manager -output ./quota -outpkg quota -//go:generate mockery -case snake -dir ../../pkg/quota/driver -name Driver -output ./quota/driver -outpkg driver -//go:generate mockery -case snake -dir ../../pkg/scan/report -name Manager -output ./scan/report -outpkg report -//go:generate mockery -case snake -dir ../../pkg/scan/rest/v1 -all -output ./scan/rest/v1 -outpkg v1 -//go:generate mockery -case snake -dir ../../pkg/scan/scanner -all -output ./scan/scanner -outpkg scanner +//go:generate mockery --case snake --dir ../../pkg/blob --name Manager --output ./blob --outpkg blob +//go:generate mockery --case snake --dir ../../vendor/github.com/docker/distribution --name Manifest --output ./distribution --outpkg distribution +//go:generate mockery --case snake --dir ../../pkg/quota --name Manager --output ./quota --outpkg quota +//go:generate mockery --case snake --dir ../../pkg/quota/driver --name Driver --output ./quota/driver --outpkg driver +//go:generate mockery --case snake --dir ../../pkg/scan/report --name Manager --output ./scan/report --outpkg report +//go:generate mockery --case snake --dir ../../pkg/scan/rest/v1 --all --output ./scan/rest/v1 --outpkg v1 +//go:generate mockery --case snake --dir ../../pkg/scan/scanner --all --output ./scan/scanner --outpkg scanner +//go:generate mockery --case snake --dir ../../pkg/scheduler --name Scheduler --output ./scheduler --outpkg scheduler diff --git a/src/testing/pkg/quota/driver/driver.go b/src/testing/pkg/quota/driver/driver.go index 8169eab34..b7102309d 100644 --- a/src/testing/pkg/quota/driver/driver.go +++ b/src/testing/pkg/quota/driver/driver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package driver diff --git a/src/testing/pkg/quota/manager.go b/src/testing/pkg/quota/manager.go index 0180fde4d..e0bfc87fb 100644 --- a/src/testing/pkg/quota/manager.go +++ b/src/testing/pkg/quota/manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package quota diff --git a/src/testing/pkg/scan/report/manager.go b/src/testing/pkg/scan/report/manager.go index c51f8443f..d6e18e43f 100644 --- a/src/testing/pkg/scan/report/manager.go +++ b/src/testing/pkg/scan/report/manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package report diff --git a/src/testing/pkg/scan/rest/v1/client.go b/src/testing/pkg/scan/rest/v1/client.go index 2ed0329a4..c2fdb5051 100644 --- a/src/testing/pkg/scan/rest/v1/client.go +++ b/src/testing/pkg/scan/rest/v1/client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package v1 diff --git a/src/testing/pkg/scan/rest/v1/client_pool.go b/src/testing/pkg/scan/rest/v1/client_pool.go index b19164513..cf881eac9 100644 --- a/src/testing/pkg/scan/rest/v1/client_pool.go +++ b/src/testing/pkg/scan/rest/v1/client_pool.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package v1 diff --git a/src/testing/pkg/scan/rest/v1/request_resolver.go b/src/testing/pkg/scan/rest/v1/request_resolver.go new file mode 100644 index 000000000..82f62e6ee --- /dev/null +++ b/src/testing/pkg/scan/rest/v1/request_resolver.go @@ -0,0 +1,19 @@ +// Code generated by mockery v2.1.0. DO NOT EDIT. + +package v1 + +import ( + http "net/http" + + mock "github.com/stretchr/testify/mock" +) + +// RequestResolver is an autogenerated mock type for the RequestResolver type +type RequestResolver struct { + mock.Mock +} + +// Execute provides a mock function with given fields: req +func (_m *RequestResolver) Execute(req *http.Request) { + _m.Called(req) +} diff --git a/src/testing/pkg/scan/rest/v1/response_handler.go b/src/testing/pkg/scan/rest/v1/response_handler.go new file mode 100644 index 000000000..a215ef3bd --- /dev/null +++ b/src/testing/pkg/scan/rest/v1/response_handler.go @@ -0,0 +1,37 @@ +// Code generated by mockery v2.1.0. DO NOT EDIT. + +package v1 + +import ( + http "net/http" + + mock "github.com/stretchr/testify/mock" +) + +// responseHandler is an autogenerated mock type for the responseHandler type +type responseHandler struct { + mock.Mock +} + +// Execute provides a mock function with given fields: code, resp +func (_m *responseHandler) Execute(code int, resp *http.Response) ([]byte, error) { + ret := _m.Called(code, resp) + + var r0 []byte + if rf, ok := ret.Get(0).(func(int, *http.Response) []byte); ok { + r0 = rf(code, resp) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(int, *http.Response) error); ok { + r1 = rf(code, resp) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/src/testing/pkg/scan/scanner/manager.go b/src/testing/pkg/scan/scanner/manager.go index c993963fc..40cefe468 100644 --- a/src/testing/pkg/scan/scanner/manager.go +++ b/src/testing/pkg/scan/scanner/manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package scanner diff --git a/src/testing/pkg/scheduler/mock.go b/src/testing/pkg/scheduler/mock.go deleted file mode 100644 index b1f049bb0..000000000 --- a/src/testing/pkg/scheduler/mock.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright Project Harbor Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package scheduler - -//go:generate mockery -dir ../../../pkg/scheduler -name Scheduler -output . -outpkg scheduler diff --git a/src/testing/pkg/scheduler/scheduler.go b/src/testing/pkg/scheduler/scheduler.go index be7396b0e..3b4ae1523 100644 --- a/src/testing/pkg/scheduler/scheduler.go +++ b/src/testing/pkg/scheduler/scheduler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.1.2. DO NOT EDIT. +// Code generated by mockery v2.1.0. DO NOT EDIT. package scheduler diff --git a/tools/mockery/Dockerfile b/tools/mockery/Dockerfile new file mode 100644 index 000000000..8c1a2bc58 --- /dev/null +++ b/tools/mockery/Dockerfile @@ -0,0 +1,13 @@ +ARG GOLANG +FROM ${GOLANG} + +ARG MOCKERY_VERSION + +# https://github.com/docker-library/golang/issues/225 +ENV XDG_CACHE_HOME /tmp + +RUN mkdir -p /tmp/mockery-${MOCKERY_VERSION} && \ + curl -fsSL https://github.com/vektra/mockery/releases/download/${MOCKERY_VERSION}/mockery_${MOCKERY_VERSION#v}_Linux_x86_64.tar.gz | tar -xz -C /tmp/mockery-${MOCKERY_VERSION} && \ + mv /tmp/mockery-${MOCKERY_VERSION}/mockery /usr/local/bin && \ + chmod +x /usr/local/bin/mockery && \ + rm -rf /tmp/mockery-${MOCKERY_VERSION}