forked from drogue-iot/drogue-cloud-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (45 loc) · 1.17 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
all: info test
export SHELL:=bash
DROGUE_NS ?= drogue-iot
CLUSTER ?= minikube
PROTO ?= http
ifeq ($(CLUSTER), minikube)
DOMAIN=$(shell minikube ip).nip.io
else ifeq ($(CLUSTER), kind)
DOMAIN=$(shell kubectl get node kind-control-plane -o jsonpath='{.status.addresses[?(@.type == "InternalIP")].address}').nip.io
else
$(error Unknown cluster type: $(CLUSTER))
endif
CONSOLE_URL ?= $(PROTO)://console.$(DOMAIN)
API_URL ?= $(PROTO)://api.$(DOMAIN)
RUST_LOG ?= info
ifndef CERT_BASE
$(error Missing CERT_BASE variable. This is typically 'build/certs' in the directory you ran the installation)
endif
.PHONY: info
info:
@echo API: $(API_URL)
@echo Console: $(CONSOLE_URL)
@echo NS: $(DROGUE_NS)
@echo Certificate base: $(CERT_BASE)
.PHONY: start
start:
-drg context delete system-tests
-pkill geckodriver
geckodriver &>/dev/null &
.PHONY: stop
stop:
-pkill geckodriver
.PHONY: test
test: start
trap "$(MAKE) stop" EXIT; $(MAKE) test-run
.PHONY: test-run
test-run:
env \
CONSOLE_URL=$(CONSOLE_URL) \
API_URL=$(API_URL) \
RUST_LOG=$(RUST_LOG) \
TEST_USER=admin \
TEST_PASSWORD=admin123456 \
CERT_BASE=$(CERT_BASE) \
cargo test -- --test-threads=1 $(TEST_ARGS) $(TESTS)