forked from mtusi2026/mtusi2026lab3
chore: перенос решения lab2 (src, миграции, student-tests, Dockerfile, compose, lock) без изменений
Исходная точка lab3: код из solution/bvt2302-bodanyuk лабы 2, коммит ef44e48 (PR mtusi2026/mtusi2026lab2#42 принят). README, COURSE, contracts/ и tests/ преподавателя не тронуты; к Makefile дописан студенческий раздел lab2, .env.example — версия lab2. Исследование трека 2 lab2 (bench/track2) не переносилось. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0ab3a341aa
commit
4f6cfda37a
@@ -28,3 +28,38 @@ test-persistence:
|
||||
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)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Student solution (lab 2, Python). On Windows without make run the commands from
|
||||
# REPORT.md directly (public tests there need PYTHONUTF8=1; restart hook: scripts/restart.cmd).
|
||||
.PHONY: secrets up down logs ps migrate student-test unit-test explain
|
||||
|
||||
secrets:
|
||||
$(PYTHON) scripts/init_secrets.py
|
||||
|
||||
# Build, apply migrations (service migrate) and wait until every service is healthy.
|
||||
up: secrets
|
||||
docker compose up -d --build --wait
|
||||
|
||||
# Safe stop: containers stop, named volumes (data) stay.
|
||||
down:
|
||||
docker compose down
|
||||
|
||||
logs:
|
||||
docker compose logs --tail 50 api
|
||||
|
||||
ps:
|
||||
docker compose ps
|
||||
|
||||
migrate:
|
||||
docker compose run --rm migrate
|
||||
|
||||
# Own tests: unit + black-box against the running stand (needs requirements*.txt in a venv).
|
||||
student-test:
|
||||
$(PYTHON) -m pytest student-tests -v
|
||||
|
||||
unit-test:
|
||||
$(PYTHON) -m pytest student-tests -m "not stack" -q
|
||||
|
||||
explain:
|
||||
$(PYTHON) scripts/explain_history.py --output evidence/explain-history.txt
|
||||
|
||||
Reference in New Issue
Block a user