forked from xBlaz3kx/ocpp-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 2.45 KB
/
Makefile
File metadata and controls
65 lines (49 loc) · 2.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# OCPP_VERSION variable for examples and performance tests (default: 1.6)
# Supported versions: 1.6, 2.0.1
OCPP_VERSION ?= 1.6
# Derive directory path and service name from OCPP_VERSION
OCPP_DIR = example/$(OCPP_VERSION)
OCPP_SERVICE = $(if $(filter 1.6,$(OCPP_VERSION)),central-system,csms)
.PHONY: test example example-observability example-ocpp-201 example-ocpp-16 example-ocpp16-observability perf-tests perf-tests-ci perf-tests-ocpp16 perf-tests-ocpp201 perf-tests-ocpp21 perf-tests-ocpp16-ci perf-tests-ocpp201-ci perf-tests-ocpp21-ci integration-tests unit-tests benchmarks
integration-tests:
docker compose -f docker-compose.test.yaml up toxiproxy integration_test --abort-on-container-exit --exit-code-from integration_test
unit-tests:
docker compose -f docker-compose.test.yaml up unit_test --abort-on-container-exit --exit-code-from unit_test
# Run benchmarks for ocppj, ws, and internal packages
benchmarks:
docker compose -f docker-compose.test.yaml up benchmarks --abort-on-container-exit --exit-code-from benchmarks
# Generic example target
# Usage: make example OCPP_VERSION=2.0.1
example:
docker compose -f $(OCPP_DIR)/docker-compose.yml up --build
# Generic example with observability enabled
# Usage: make example-observability OCPP_VERSION=2.0.1
example-observability:
METRICS_ENABLED=true docker compose -f $(OCPP_DIR)/docker-compose.yml -f example/docker-compose.observability.yaml up --build
# Version-specific targets (for backward compatibility)
example-ocpp-201:
$(MAKE) example OCPP_VERSION=2.0.1
example-ocpp-16:
$(MAKE) example OCPP_VERSION=1.6
example-ocpp16-observability:
$(MAKE) example-observability OCPP_VERSION=1.6
# Generic performance tests target
# Usage: make perf-tests OCPP_VERSION=2.0.1
perf-tests:
docker compose -f $(OCPP_DIR)/docker-compose.yml \
-f $(OCPP_DIR)/docker-compose.k6.yml \
-f example/docker-compose.observability.yaml up --build
# Generic CI performance tests target
# Usage: make perf-tests-ci OCPP_VERSION=2.0.1
perf-tests-ci:
docker compose -f $(OCPP_DIR)/docker-compose.yml \
-f $(OCPP_DIR)/docker-compose.k6-ci.yml up $(OCPP_SERVICE) k6 --build --abort-on-container-exit
# Version-specific targets (for backward compatibility)
perf-tests-ocpp16:
$(MAKE) perf-tests OCPP_VERSION=1.6
perf-tests-ocpp201:
$(MAKE) perf-tests OCPP_VERSION=2.0.1
perf-tests-ocpp16-ci:
$(MAKE) perf-tests-ci OCPP_VERSION=1.6
perf-tests-ocpp201-ci:
$(MAKE) perf-tests-ci OCPP_VERSION=2.0.1