diff --git a/Makefile b/Makefile index edfce156..aa985113 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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/v2@v2.46.3 + + GINKGO := go run github.com/onsi/ginkgo/v2/ginkgo test-all: mockery gqlgen $(GINKGO) -r diff --git a/README.md b/README.md index ab6b2d7a..febbc260 100644 --- a/README.md +++ b/README.md @@ -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/v2@v2.46.3 #### Using Ginkgo