@@ -3,11 +3,6 @@ SHELL := /bin/bash # Use bash syntax
33# Set up variables
44GO111MODULE =on
55
6- AWS_SDK_GO_VERSION ="$(shell echo $(shell go list -m -f '{{.Version}}' github.com/aws/aws-sdk-go) ) "
7- AWS_SDK_GO_VERSIONED_PATH ="$(shell echo github.com/aws/aws-sdk-go@$(AWS_SDK_GO_VERSION ) ) "
8- ELASTICACHE_API_PATH ="$(shell echo $(shell go env GOPATH) ) /pkg/mod/$(AWS_SDK_GO_VERSIONED_PATH ) /service/elasticache/elasticacheiface"
9- SERVICE_CONTROLLER_SRC_PATH ="$(shell pwd) "
10-
116# Build ldflags
127VERSION ?= "v0.0.0"
138GITCOMMIT =$(shell git rev-parse HEAD)
@@ -16,34 +11,22 @@ GO_LDFLAGS=-ldflags "-X main.version=$(VERSION) \
1611 -X main.buildHash=$(GITCOMMIT ) \
1712 -X main.buildDate=$(BUILDDATE ) "
1813
19- .PHONY : all test local-test clean-mocks mocks
14+ .PHONY : all test local-test
2015
2116all : test
2217
23- test : | mocks # # Run code tests
24- go test -v ./...
18+ local-run-controller : # # Run a controller image locally for SERVICE
19+ @go run ./cmd/controller/main.go \
20+ --aws-region=us-west-2 \
21+ --enable-development-logging \
22+ --log-level=debug
2523
26- test-cover : | mocks # # Run code tests with resources coverage
27- go test -coverpkg=./pkg/resource/... -covermode=count -coverprofile=coverage.out ./...
28- go tool cover -func=coverage.out
24+ test : # # Run code tests
25+ go test -v ./...
2926
30- local-test : | mocks # # Run code tests using go.local.mod file
27+ local-test : # # Run code tests using go.local.mod file
3128 go test -modfile=go.local.mod -v ./...
3229
33- clean-mocks : # # Remove mocks directory
34- rm -rf mocks
35-
36- install-mockery :
37- @scripts/install-mockery.sh
38-
39- mocks : install-mockery # # Build mocks
40- go get -d $(AWS_SDK_GO_VERSIONED_PATH )
41- @echo " building mocks for $( ELASTICACHE_API_PATH) ... "
42- @pushd $(ELASTICACHE_API_PATH ) 1> /dev/null; \
43- $(SERVICE_CONTROLLER_SRC_PATH ) /bin/mockery --all --dir=. --output=$(SERVICE_CONTROLLER_SRC_PATH ) /mocks/aws-sdk-go/elasticache/ ; \
44- popd 1> /dev/null;
45- @echo " ok."
46-
4730help : # # Show this help.
4831 @grep -F -h " ##" $(MAKEFILE_LIST ) | grep -F -v grep | sed -e ' s/\\$$//' \
49- | awk -F' [:#]' ' {print $$1 = sprintf("%-30s", $$1), $$4}'
32+ | awk -F' [:#]' ' {print $$1 = sprintf("%-30s", $$1), $$4}'
0 commit comments