forked from mtusi2026/mtusi2026lab2
47 lines
1.3 KiB
Makefile
47 lines
1.3 KiB
Makefile
PYTHON ?= python3
|
|
BASE_URL ?= http://127.0.0.1:8080
|
|
CA_FILE ?=
|
|
ACTION_SCRIPT ?=
|
|
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
|
|
|
.PHONY: help check validate test load grade4 track5 test-persistence migrate up down logs
|
|
|
|
help:
|
|
@echo "check: contract structure; validate: OpenAPI; test: public smoke; grade4: dependency/rollback/expiry checks; track5: query/index/restore experiment"
|
|
|
|
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)
|
|
|
|
grade4:
|
|
$(PYTHON) student-tests/test_level4.py --base-url "$(BASE_URL)"
|
|
docker compose --env-file .env exec -T api python3 student-tests/test_session_cache_race.py
|
|
./scripts/test_expiry.sh
|
|
|
|
track5:
|
|
$(PYTHON) student-tests/track5_query_restore.py
|
|
|
|
migrate:
|
|
$(PYTHON) src/migrate.py
|
|
|
|
up:
|
|
docker compose --env-file .env up -d --build
|
|
|
|
down:
|
|
docker compose --env-file .env down
|
|
|
|
logs:
|
|
docker compose --env-file .env logs -f
|