-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
60 lines (41 loc) · 1.48 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
58
59
60
GIT_COMMIT ?= $(shell git describe --dirty=-unsupported --always --tags || echo pre-commit)
IMAGE_NAME ?= hotload-integration-tests:$(GIT_COMMIT)
get:
go get -t ./...
fmt: get
go fmt ./...
tidy:
go mod tidy
# assert that there is no difference after running format
no-diff:
git diff --exit-code
vet: fmt
go vet ./...
build: vet
go build ./...
get-ginkgo:
go get github.com/onsi/ginkgo/ginkgo
test: vet get-ginkgo
go test -race github.com/infobloxopen/hotload github.com/infobloxopen/hotload/fsnotify
# test target which includes the no-diff fail condition
ci-test: fmt tidy no-diff test
test-docker:
docker build -f Dockerfile.test .
.integ-test-image-$(GIT_COMMIT):
docker build -f Dockerfile.integrationtest . -t $(IMAGE_NAME)
integ-test-image: .integ-test-image-$(GIT_COMMIT)
# this'll run outside of the build container
deploy-integration-tests:
helm upgrade hotload-integration-tests integrationtests/helm/hotload-integration-tests -i --set image.tag=$(GIT_COMMIT)
build-test: vet get-ginkgo
go test -c ./integrationtests
kind-create-cluster:
kind create cluster
kind-load:
kind load docker-image $(IMAGE_NAME)
ci-integration-tests: integ-test-image kind-load deploy-integration-tests
(helm test --timeout=1200s hotload-integration-tests || (kubectl logs hotload-integration-tests-job && exit 1)) && kubectl logs hotload-integration-tests-job
delete-all:
helm uninstall hotload-integration-tests || true
kubectl delete pvc --all || true
kubectl delete pods --all || true