This commit is contained in:
2026-09-30 12:13:29 +03:00
parent 6bc82eaa2a
commit f4198de3c8
45 changed files with 4027 additions and 875 deletions
+26 -7
View File
@@ -1,13 +1,15 @@
PYTHON ?= python3
# Prefer a local Linux venv (WSL/Linux/macOS) so `make validate` finds requirements-dev.txt.
PYTHON ?= $(firstword $(wildcard .venv/bin/python3 .venv-wsl/bin/python3) python3)
BASE_URL ?= http://localhost:8080
CA_FILE ?=
ACTION_SCRIPT ?=
ACTION_SCRIPT ?= scripts/restart.sh
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
.PHONY: help check validate test load test-persistence
.PHONY: help check validate test load test-persistence secrets up test-level4 db-checks evidence
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: running API; load: synthetic writes"
@echo "secrets, up: local stand; test-level4, db-checks: lab2 level 4; evidence: collect evidence/"
check:
$(PYTHON) scripts/check_contract.py
@@ -16,11 +18,28 @@ validate:
$(PYTHON) scripts/validate_openapi.py
test:
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
$(PYTHON) tests/smoke.py --base-url $(BASE_URL)
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)
$(PYTHON) tests/resilience.py \
--base-url $(BASE_URL) \
--action-script $(ACTION_SCRIPT) \
--mode persistence
secrets:
sh scripts/init-secrets.sh
up: secrets
docker compose --profile tests up -d --build api api_short_ttl
test-level4:
$(PYTHON) student-tests/level4.py --base-url $(BASE_URL)
db-checks:
docker compose --profile tools run --rm db_checks
evidence:
sh scripts/run_evidence.sh