fix: адаптировать Makefile и resilience.py для Windows
Co-authored-by: aider (deepseek/deepseek-chat) <aider@aider.chat>
This commit is contained in:
@@ -2,12 +2,17 @@ PYTHON ?= python
|
||||
BASE_URL ?= http://localhost:8080
|
||||
CA_FILE ?=
|
||||
ACTION_SCRIPT ?=
|
||||
SESSION_TTL_SECONDS ?=
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover
|
||||
.PHONY: help check validate test load test-persistence test-failover test-expiry test-dependency collect-evidence up down
|
||||
|
||||
help:
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
@echo "test-persistence/test-failover: ACTION_SCRIPT=scripts/restart.sh|scripts/stop-one.sh"
|
||||
@echo "test-expiry: SESSION_TTL_SECONDS=2 (стенд должен быть запущен с коротким TTL)"
|
||||
@echo "test-dependency: остановка Redis/PostgreSQL через scripts/stop-*.sh"
|
||||
@echo "collect-evidence: собрать evidence/*.txt (Windows: sh scripts/collect-evidence.sh)"
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
@@ -22,9 +27,24 @@ load:
|
||||
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-persistence:
|
||||
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
|
||||
$(if $(ACTION_SCRIPT),,$(error Set ACTION_SCRIPT to your implemented executable restart hook))
|
||||
$(PYTHON) 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)
|
||||
$(if $(ACTION_SCRIPT),,$(error Set ACTION_SCRIPT to your implemented executable stop-one hook))
|
||||
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-expiry:
|
||||
$(PYTHON) tests/test_expiry.py --base-url "$(BASE_URL)" $(if $(SESSION_TTL_SECONDS),--ttl $(SESSION_TTL_SECONDS),)
|
||||
|
||||
test-dependency:
|
||||
$(PYTHON) tests/test_dependency_failure.py --base-url "$(BASE_URL)"
|
||||
|
||||
collect-evidence:
|
||||
sh scripts/collect-evidence.sh
|
||||
|
||||
up:
|
||||
docker compose --env-file .env up -d --build
|
||||
|
||||
down:
|
||||
docker compose --env-file .env down
|
||||
|
||||
Reference in New Issue
Block a user