-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (38 loc) · 1.19 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
VERSION ?= $(shell git describe --tags --always --dirty)
CLUSTERS = $(shell kind get clusters)
.PHONY: test
kind-install:
ifeq (, $(shell command -v kind))
go install sigs.k8s.io/[email protected]
endif
# We clear the test cache because some of the tests require an out-of-band KinD
# cluster to run against and we want to re-run tests against that KinD cluster
# instead of from cached unit test results.
clear-test-cache:
@echo -n "clearing Go test cache ... "
@go clean -testcache
@echo "ok."
kind-clear-clusters:
ifneq (, $(shell command -v kind))
ifneq (, $(CLUSTERS))
@echo -n "clearing KinD clusters ... "
@for c in $(CLUSTERS); do kind delete cluster -q --name $$c; done
@echo "ok."
endif
endif
kind-create-cluster:
ifneq (, $(shell command -v kind))
@echo -n "creating 'kind' cluster ... "
@kind create cluster -q
@echo "ok."
@sleep 5
endif
test: clear-test-cache kind-clear-clusters kind-create-cluster test-kind-simple
test-kind-simple:
@go test -v ./parse_test.go
@go test -v ./eval_test.go
test-all: test kind-clear-clusters
@go test -v ./fixtures/kind/kind_test.go
@go test -v ./placement_test.go
test-placement: clear-test-cache kind-clear-clusters
@go test -v ./placement_test.go