forked from mtusi2026/mtusi2026lab2
ЛР 2 — БВТ2304 — Черников
PostgreSQL с версионируемыми миграциями, вход по Basic и Bearer-сессии в Valkey (AOF), Argon2id, compose-стенд с секретами в файлах. Собственные тесты в student-tests/, проверки инфраструктуры и EXPLAIN в scripts/, отчёт в REPORT.md, результаты в evidence/, команды для показа в DEMO.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
# Build and test from a fresh clone of the solution branch, separate compose project with new volumes.
|
||||
# Date: 2026-10-07 16:07 UTC; host Windows 11, Docker Desktop; clone made with core.autocrlf=true (as on the author machine).
|
||||
# COMPOSE_PROJECT_NAME=mtusi-lab2-clean, APP_PUBLISHED_PORT=8090, so the main stand on 8080 is not touched.
|
||||
|
||||
$ git clone --branch solution/bvt2304-chernikov <repo> clean2
|
||||
[exit code 0]
|
||||
|
||||
$ git log --oneline -1
|
||||
5b4fa0e ЛР 2 — БВТ2304 — Черников
|
||||
[exit code 0]
|
||||
|
||||
$ python scripts/init_secrets.py
|
||||
created secrets/postgres_password
|
||||
created secrets/valkey_password
|
||||
written secrets/database_url, secrets/valkey_auth, secrets/cache_url
|
||||
[exit code 0]
|
||||
|
||||
$ cp .env.example .env
|
||||
|
||||
$ docker compose up -d --build --wait
|
||||
Network mtusi-lab2-clean_default Created
|
||||
Network mtusi-lab2-clean_default Created
|
||||
Container mtusi-lab2-clean-valkey-1 Created
|
||||
Container mtusi-lab2-clean-postgres-1 Created
|
||||
Container mtusi-lab2-clean-migrate-1 Created
|
||||
Container mtusi-lab2-clean-api-1 Created
|
||||
Container mtusi-lab2-clean-postgres-1 Healthy
|
||||
Container mtusi-lab2-clean-postgres-1 Healthy
|
||||
Container mtusi-lab2-clean-valkey-1 Healthy
|
||||
Container mtusi-lab2-clean-migrate-1 Exited
|
||||
Container mtusi-lab2-clean-migrate-1 Exited
|
||||
Container mtusi-lab2-clean-valkey-1 Healthy
|
||||
Container mtusi-lab2-clean-postgres-1 Healthy
|
||||
Container mtusi-lab2-clean-api-1 Healthy
|
||||
[exit code 0]
|
||||
|
||||
$ docker compose logs --no-log-prefix migrate
|
||||
INFO event=migration_applied version=0001_schema duration_ms=6
|
||||
INFO event=migration_applied version=0002_messages_history_index duration_ms=3
|
||||
INFO event=migrations_done applied_now=2 total=2
|
||||
[exit code 0]
|
||||
|
||||
$ docker compose run --rm --no-deps migrate
|
||||
INFO event=migrations_done applied_now=0 total=2
|
||||
[exit code 0]
|
||||
|
||||
$ python tests/smoke.py --base-url http://127.0.0.1:8090
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
[exit code 0]
|
||||
|
||||
$ BASE_URL=http://127.0.0.1:8090 python -m unittest discover -s student-tests
|
||||
Ran 73 tests in 10.872s
|
||||
OK
|
||||
[exit code 0]
|
||||
|
||||
$ python tests/resilience.py --mode persistence --action-script scripts/restart.cmd --base-url http://127.0.0.1:8090
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
[exit code 0]
|
||||
|
||||
$ docker compose down -v (removes only the mtusi-lab2-clean project and its volumes)
|
||||
Volume mtusi-lab2-clean_pgdata Removing
|
||||
Volume mtusi-lab2-clean_valkeydata Removing
|
||||
Volume mtusi-lab2-clean_pgdata Removed
|
||||
Volume mtusi-lab2-clean_valkeydata Removed
|
||||
[exit code 0]
|
||||
|
||||
# exit codes: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
RESULT: PASS
|
||||
Reference in New Issue
Block a user