Skip to content

Commit

Permalink
Copyonwrite/367/fix make error mockery (#368)
Browse files Browse the repository at this point in the history
* Make 'make' install mockery

* Add 'all' target to Makefile and fix 'mockery' error

* Install mockery in goal 'install-build-dependencies'
  • Loading branch information
copyonwrite authored and dustindemmerle committed Nov 25, 2024
1 parent 5ee2276 commit db9995f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ifeq ($(wildcard .env),.env)
export $(shell sed 's/=.*//' .env)
endif

all: build-binary test-all

build-binary: mockery gqlgen
GO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o build/heureka cmd/heureka/main.go

Expand Down Expand Up @@ -62,9 +64,13 @@ run:
gqlgen:
cd internal/api/graphql && go run github.com/99designs/gqlgen generate

mockery:
mockery: install-build-dependencies
mockery

install-build-dependencies:
go install github.com/vektra/mockery/[email protected]


GINKGO := go run github.com/onsi/ginkgo/v2/ginkgo
test-all: mockery gqlgen
$(GINKGO) -r
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ Use the following command in the root folder of heureka:

Heureka uses [Mockery](https://vektra.github.io/mockery/) for building Mocks based on defined interfaces for the purpose of Unit-Testing.

Please [follow the steps to install mockery on your local system](https://vektra.github.io/mockery/latest/installation/) to be able to build mocks.
The Makefile/Dockerfile take care of installing mockery via

go install github.com/vektra/mockery/[email protected]

#### Using Ginkgo

Expand Down

0 comments on commit db9995f

Please sign in to comment.