-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
86 lines (70 loc) · 2.75 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
SHELL := /bin/bash
REGISTRY_URL ?= spinkubeperf.azurecr.io
SPIN_V_VERSION ?= 2.6.0
k6-build:
go install go.k6.io/xk6/cmd/xk6@latest
xk6 build --with github.com/LeonAdato/xk6-output-statsd --with github.com/grafana/xk6-kubernetes
build-k6-image:
cd image/k6 && \
docker build --platform linux/amd64,linux/arm64 -t $(REGISTRY_URL)/k6:latest .
push-k6-image:
docker push $(REGISTRY_URL)/k6:latest
build-and-push-apps:
./apps/build-and-push.sh $(REGISTRY_URL)
run-density-test-%:
bash -c "trap '(echo Logs from Density Test $* && kubectl logs job/density-$*-1 && kubectl describe pod)' EXIT; \
TEST=density \
SK_TEST_RUN_NAME=density-$* \
SK_SPIN_APP_ROUTE="" \
SK_SPIN_VERSION="$(SPIN_V_VERSION)" \
SK_OCI_TAG="perf" \
SK_OCI_REPO=$(REGISTRY_URL) \
./tests/run.sh $(REGISTRY_URL)"
run-density-tests: run-density-test-1 run-density-test-2 run-density-test-3 run-density-test-4 run-density-test-5
kubectl delete spinapp --all
run-hello-world-test:
bash -c "trap '(echo Logs from Hello World Test && kubectl logs job/hello-world-1 && kubectl describe pod)' EXIT; \
TEST=hello-world \
SK_SPIN_APP_ROUTE="hello" \
SK_OCI_TAG=$(SPIN_V_VERSION) \
SK_OCI_REPO=$(REGISTRY_URL) \
SK_REPLICAS=1 \
./tests/run.sh $(REGISTRY_URL)"
run-resource-intensive-test:
bash -c "trap '(echo Logs from Resource Intensive Test && kubectl logs job/resource-intensive-1 && kubectl describe pod)' EXIT; \
TEST=resource-intensive \
SK_OCI_TAG=$(SPIN_V_VERSION) \
SK_OCI_REPO=$(REGISTRY_URL) \
SK_REPLICAS=1 \
SK_HASH_MEMORY=10000 \
SK_HASH_CPU=50 \
SK_HASH_SLEEP_MS=1000 \
./tests/run.sh $(REGISTRY_URL)"
run-ramping-vus-test-%:
bash -c "trap '(echo Logs from Ramp Test && kubectl logs job/ramping-vus-$*-1 && kubectl describe pod)' EXIT; \
TEST=ramping-vus \
SK_TEST_RUN_NAME=ramping-vus-$* \
SK_SPIN_APP_ROUTE="hello" \
SK_OCI_TAG=$(SPIN_V_VERSION) \
SK_OCI_REPO=$(REGISTRY_URL) \
SK_REPLICAS=$* \
./tests/run.sh $(REGISTRY_URL)"
run-constant-vus-test-%:
# SET `K6_VUS` ENV VAR TO OVERRIDE DEFAULT VUS
bash -c "trap '(echo Logs from Constant VUs Test && kubectl logs job/constant-vus-$*-1 && kubectl describe pod)' EXIT; \
TEST=constant-vus \
SK_TEST_RUN_NAME=constant-vus-$* \
SK_SPIN_APP_ROUTE="hello" \
SK_SPIN_APP="hello-world-rust" \
SK_OCI_TAG=$(SPIN_V_VERSION) \
SK_OCI_REPO=$(REGISTRY_URL) \
SK_REPLICAS=$* \
./tests/run.sh $(REGISTRY_URL)"
run-tests: run-hello-world-test run-constant-vus-test-1 run-ramping-vus-test-1 run-ramping-vus-test-10 run-resource-intensive-test run-density-tests
cleanup: cleanup-apps cleanup-tests cleanup-configmaps
cleanup-apps:
source utils.sh && delete_k8s_resources spinapps
cleanup-tests:
source utils.sh && delete_k8s_resources testruns
cleanup-configmaps:
kubectl delete configmap -l k6-test=true