-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (34 loc) · 1.45 KB
/
Makefile
File metadata and controls
49 lines (34 loc) · 1.45 KB
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
TEST_IMAGE ?= vhsm-helm-test
# set to run a single test - e.g test/acceptance/server.bats
ACCEPTANCE_TESTS ?= test/acceptance
# filter bats unit tests to run.
UNIT_TESTS_FILTER ?= '.*'
# use UNIT_TESTS_PARALLEL=$(nproc)
UNIT_TESTS_PARALLEL ?= 1
KIND_CLUSTER_NAME ?= vhsm-helm
# kind k8s version
KIND_K8S_VERSION ?= v1.32.8
# Generate json schema for chart values. See test/README.md for more details.
values-schema:
helm-schema -k title,description,default,required,additionalProperties
test-image:
@docker build --rm -t $(TEST_IMAGE) -f $(CURDIR)/test/docker/Dockerfile $(CURDIR)
test: test-unit test-chart test-acceptance
test-unit: test-image
@docker run --rm -i -v ${PWD}:/helm-test $(TEST_IMAGE) bats -j $(UNIT_TESTS_PARALLEL) --timing -f $(UNIT_TESTS_FILTER) /helm-test/test/unit
test-chart:
bats --tap --timing ./test/chart
test-acceptance: setup-kind acceptance
acceptance:
@[ -n "$(ENCLAIVE_LICENCE)" ] || (echo "Please set ENCLAIVE_LICENCE to a valid value" ; exit 1)
bats --tap --timing ${ACCEPTANCE_TESTS}
setup-kind:
kind get clusters | grep -q "^${KIND_CLUSTER_NAME}$$" || \
kind create cluster \
--image kindest/node:${KIND_K8S_VERSION} \
--name ${KIND_CLUSTER_NAME} \
--config $(CURDIR)/test/kind/config.yaml
kubectl config use-context kind-${KIND_CLUSTER_NAME}
delete-kind:
kind delete cluster --name ${KIND_CLUSTER_NAME} || :
.PHONY: values-schema test test-image test-bats test-unit test-acceptance acceptance setup-kind delete-kind