forked from mtusi2026/mtusi2026lab4
feat: база из лабораторной 3 перенесена в лабу 4
This commit is contained in:
@@ -1,30 +1,35 @@
|
||||
PYTHON ?= python3
|
||||
BASE_URL ?= http://localhost:8080
|
||||
CA_FILE ?=
|
||||
ACTION_SCRIPT ?=
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
COMPOSE ?= docker compose
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover
|
||||
.PHONY: up down migrate restart test logs stop-one restart-one clean check
|
||||
|
||||
help:
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
up:
|
||||
$(COMPOSE) up -d --build
|
||||
|
||||
down:
|
||||
$(COMPOSE) down
|
||||
|
||||
migrate:
|
||||
$(COMPOSE) exec api1 ./migrate up
|
||||
|
||||
restart:
|
||||
$(COMPOSE) restart
|
||||
|
||||
test:
|
||||
$(PYTHON) tests/client.py
|
||||
$(PYTHON) tests/load.py
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
|
||||
validate:
|
||||
$(PYTHON) scripts/validate_openapi.py
|
||||
logs:
|
||||
$(COMPOSE) logs -f
|
||||
|
||||
test:
|
||||
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
stop-one:
|
||||
./scripts/stop-one.sh api1
|
||||
|
||||
load:
|
||||
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
restart-one:
|
||||
./scripts/restart-one.sh api1
|
||||
|
||||
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)
|
||||
clean: down
|
||||
$(COMPOSE) down -v
|
||||
|
||||
Reference in New Issue
Block a user