This commit is contained in:
2026-11-04 16:11:13 +03:00
parent 0ab3a341aa
commit 07f848d18c
66 changed files with 4660 additions and 44 deletions
+26 -8
View File
@@ -1,30 +1,48 @@
ifeq ($(OS),Windows_NT)
PYTHON ?= py -3
else
PYTHON ?= python3
endif
PYTHONFLAGS ?= -X utf8
BASE_URL ?= http://localhost:8080
export BASE_URL
CA_FILE ?=
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
.PHONY: help check validate test load test-persistence test-failover
.PHONY: help check validate test student-test load track1 test-rolling test-update test-persistence test-failover
help:
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
@echo "check: offline structure; validate: full OpenAPI; test/student-test: running API; load/track1: synthetic writes and scaling experiment"
check:
$(PYTHON) scripts/check_contract.py
$(PYTHON) $(PYTHONFLAGS) scripts/check_contract.py
validate:
$(PYTHON) scripts/validate_openapi.py
$(PYTHON) $(PYTHONFLAGS) scripts/validate_openapi.py
test:
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
$(PYTHON) $(PYTHONFLAGS) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
student-test:
$(PYTHON) $(PYTHONFLAGS) -m unittest discover -s student-tests -p "test_*.py"
load:
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
$(PYTHON) $(PYTHONFLAGS) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
track1:
BASE_URL="$(BASE_URL)" $(PYTHON) $(PYTHONFLAGS) scripts/track1_benchmark.py
test-rolling:
$(PYTHON) $(PYTHONFLAGS) scripts/rolling_restart.py --base-url "$(BASE_URL)"
test-update:
$(PYTHON) $(PYTHONFLAGS) scripts/rolling_update.py --base-url "$(BASE_URL)"
test-persistence:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
$(PYTHON) $(PYTHONFLAGS) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
test-failover:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable stop-one hook"; exit 2)
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
$(PYTHON) $(PYTHONFLAGS) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)