-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
57 lines (43 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
SOURCE = ./...
.DEFAULT_GOAL := test
export SHELL:=/bin/bash
export SHELLOPTS:=$(if $(SHELLOPTS),$(SHELLOPTS):)pipefail:errexit
export K8S_VERSION:=1.21.1
export VAULT_VERSION:=1.10.3
.ONESHELL:
lint: tools
golangci-lint run --new-from-rev=main
.PHONY: lint
lint-full:
golangci-lint run
.PHONY: lint
vet:
go vet $(SOURCE)
.PHONY: vet
test-fmt:
test -z $(shell go fmt $(SOURCE))
.PHONY: test-fmt
test: vet test-fmt
go test -cover ./pkg/... -count=1
.PHONY: test
tools:
echo "Installing tools from tools.go"
cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
.PHONY: tools
mock: tools
mockgen -source pkg/aws/dax.go -destination mock/dax.go -package mock
mockgen -source pkg/aws/ec2.go -destination mock/ec2.go -package mock
mockgen -source pkg/aws/iam.go -destination mock/iam.go -package mock
mockgen -source pkg/aws/eks.go -destination mock/eks.go -package mock
mockgen -source pkg/k8s/jobs.go -destination mock/k8s_jobs.go -package mock
mockgen -source pkg/k8s/util.go -destination mock/k8s_util.go -package mock
go generate ./...
.PHONY: mock
.PHONY: k8s-integration-test
k8s-integration-test:
echo K8S_VERSION: $(K8S_VERSION)
go test -v -timeout 10m -count 1 ./integration/k8s_test.go
.PHONY: vault-integration-test
vault-integration-test:
echo VAULT_VERSION: $(VAULT_VERSION)
go test -v -timeout 10m -count 1 ./integration/vault_test.go