Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 lines
2.0 KiB
Makefile
57 lines
2.0 KiB
Makefile
PYTHON ?= python3
|
|
BASE_URL ?= http://localhost:8080
|
|
CA_FILE ?=
|
|
ACTION_SCRIPT ?=
|
|
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
|
|
|
.PHONY: help check validate test load test-persistence test-failover up down test-idempotency test-failover-series track1 track1-quick track1-report
|
|
|
|
help:
|
|
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
|
|
|
check:
|
|
$(PYTHON) scripts/check_contract.py
|
|
|
|
validate:
|
|
$(PYTHON) scripts/validate_openapi.py
|
|
|
|
test:
|
|
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
|
|
|
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)
|
|
$(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)
|
|
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
|
|
|
# --- Студенческие цели (lab3) ---
|
|
up:
|
|
sh scripts/init-secrets.sh
|
|
docker compose --env-file .env up -d --build --wait
|
|
|
|
down:
|
|
docker compose --env-file .env stop
|
|
|
|
test-idempotency:
|
|
$(PYTHON) student-tests/idempotency_concurrent.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
|
|
|
test-failover-series:
|
|
$(PYTHON) student-tests/failover_series.py --base-url "$(BASE_URL)" $(TLS_ARGS) --output evidence/failover_series.json
|
|
|
|
# --- Трек 5.1: цена масштабирования (отдельный compose-проект на :18080) ---
|
|
track1:
|
|
$(PYTHON) scripts/track1.py --resume
|
|
$(PYTHON) scripts/track1_report.py
|
|
|
|
track1-quick:
|
|
$(PYTHON) scripts/track1.py --quick --output evidence/track1/raw_quick.jsonl
|
|
$(PYTHON) scripts/track1_report.py --input evidence/track1/raw_quick.jsonl --outdir evidence/track1/quick
|
|
|
|
track1-report:
|
|
$(PYTHON) scripts/track1_report.py
|