docs: add membership-cache evidence and report

Evidence from cae4b09: cache hits against chats table reads, Valkey
stop/pause/restart and FLUSHALL, restart hook with Valkey, Valkey ports
and password from .env, and a fresh make test_isolated run (103 tests).
REPORT.md describes the role of Valkey, the service table and the new
level 4 rows. The cache-read check now counts seq_scan + idx_scan: the
small chats table is read by sequential scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 21:31:55 +03:00
co-authored by Claude Opus 5.5
parent cae4b09147
commit 25a60d36cd
10 changed files with 564 additions and 85 deletions
+14 -13
View File
@@ -3,15 +3,15 @@
| | |
|---|---|
| Спеки | `student-tests` «Прогон на временной базе» — сценарий «Успешный прогон»; «Результат прогона сохраняется»; `container-run` «Штатный запуск» (`make student_test` проходит) |
| Change | `session-auth`, задача 7.1 |
| Дата | 2026-10-01 15:54 UTC |
| Commit | `ae4154e` |
| Стенд | рабочий `make run_docker` запущен; образ собран из рабочего дерева, тестовый контейнер `mtusi-lab2-test-api` на `127.0.0.1:18088`, временная база `test_messenger` в том же Postgres |
| Change | `membership-cache`, задача 6.1 (прошлый прогон — `session-auth`, commit `ae4154e`, 99 тестов) |
| Дата | 2026-10-01 18:25 UTC |
| Commit | `cae4b09` |
| Стенд | рабочий `make run_docker` запущен; образ собран из рабочего дерева, тестовый контейнер `mtusi-lab2-test-api` на `127.0.0.1:18088`, временная база `test_messenger` в том же Postgres, Valkey стенда общий (ключи разделены именем базы) |
| Хост | Docker Desktop 29.8.1, macOS arm64; ВМ Docker: 12 CPU, 7 GiB RAM; лимиты контейнерам не задавались |
Механика временной базы и уборка при любом исходе —
`evidence/tests/test-isolated-mechanics.md`. Здесь — первый зелёный
прогон: до `session-auth` smoke лабы 2 падал на регистрации с паролем.
`evidence/tests/test-isolated-mechanics.md`. Ключи кэша тестового
прогона — `evidence/cache/hits.md`, раздел 4.
## Прогон
@@ -26,8 +26,8 @@ $ make test_isolated # exit 0
[test_isolated] make test
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
[test_isolated] make student_test
coverage: 96 scenarios in 9 specs, 81 tested, 15 excluded
============================== 99 passed in 8.66s ==============================
coverage: 108 scenarios in 10 specs, 85 tested, 23 excluded
============================= 103 passed in 9.08s ==============================
[test_isolated] cleanup
[test_isolated] results: {'test': 0, 'student_test': 0}
```
@@ -37,6 +37,7 @@ coverage: 96 scenarios in 9 specs, 81 tested, 15 excluded
| Модуль | Прошло |
|---|---|
| `test_api_conventions.py` | 11 |
| `test_chat_cache.py` | 4 |
| `test_chats.py` | 10 |
| `test_contract.py` | 8 |
| `test_coverage.py` | 7 |
@@ -49,7 +50,7 @@ coverage: 96 scenarios in 9 specs, 81 tested, 15 excluded
| `test_rubric.py` | 7 |
| `test_sessions.py` | 10 |
| `test_users.py` | 11 |
| **всего** | **99** |
| **всего** | **103** |
Гонки уровня «4» (вывод тестов с `-rP`):
@@ -67,9 +68,9 @@ username race: 10 clients, statuses {409: 9, 201: 1}, max in flight 10
## Вывод
- Образ из рабочего дерева в связке compose проходит публичный smoke
лабы 2 и все 99 собственных тестов, включая вход, Bearer, logout и
неверный пароль.
- Образ из рабочего дерева в связке compose с Valkey проходит публичный
smoke лабы 2 и все 103 собственных теста, включая вход, Bearer,
logout, неверный пароль и сценарии кэша карточки чата.
- Каждый сценарий HTTP-спеков покрыт тестом или исключением с причиной
и ссылкой на evidence: 81 тестом и 15 исключениями из 96.
и ссылкой на evidence: 85 тестами и 23 исключениями из 108.
- Временная база и контейнер убраны, рабочий стенд не затронут.