Files
mtusi2026lab2/evidence/tests/test-isolated.md
T
ricoromaandClaude Opus 5.5 25a60d36cd 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>
2026-10-01 21:31:55 +03:00

77 lines
3.6 KiB
Markdown

# `make test_isolated`: публичный smoke и весь набор против образа
| | |
|---|---|
| Спеки | `student-tests` «Прогон на временной базе» — сценарий «Успешный прогон»; «Результат прогона сохраняется»; `container-run` «Штатный запуск» (`make student_test` проходит) |
| 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`. Ключи кэша тестового
прогона — `evidence/cache/hits.md`, раздел 4.
## Прогон
```text
$ make test_isolated # exit 0
[test_isolated] database=test_messenger container=mtusi-lab2-test-api base_url=http://127.0.0.1:18088
[test_isolated] build image
[test_isolated] create database test_messenger
[test_isolated] migrations
[test_isolated] start api container
[test_isolated] ready
[test_isolated] make test
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
[test_isolated] make student_test
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}
```
Строки `PASSED` по модулям:
| Модуль | Прошло |
|---|---|
| `test_api_conventions.py` | 11 |
| `test_chat_cache.py` | 4 |
| `test_chats.py` | 10 |
| `test_contract.py` | 8 |
| `test_coverage.py` | 7 |
| `test_data_storage.py` | 2 |
| `test_health.py` | 4 |
| `test_identification.py` | 10 |
| `test_messages.py` | 5 |
| `test_pagination.py` | 12 |
| `test_race.py` | 2 |
| `test_rubric.py` | 7 |
| `test_sessions.py` | 10 |
| `test_users.py` | 11 |
| **всего** | **103** |
Гонки уровня «4» (вывод тестов с `-rP`):
```text
race: 10 clients x 10 messages, statuses {201: 100}, max in flight 10; history: 100 messages, 100 unique ids, 4 pages by 30
username race: 10 clients, statuses {409: 9, 201: 1}, max in flight 10
```
## После прогона
| Проверка | Результат |
|---|---|
| база `test_messenger` в `pg_database` | нет |
| контейнер `mtusi-lab2-test-api` в `docker ps -a` | нет |
## Вывод
- Образ из рабочего дерева в связке compose с Valkey проходит публичный
smoke лабы 2 и все 103 собственных теста, включая вход, Bearer,
logout, неверный пароль и сценарии кэша карточки чата.
- Каждый сценарий HTTP-спеков покрыт тестом или исключением с причиной
и ссылкой на evidence: 85 тестами и 23 исключениями из 108.
- Временная база и контейнер убраны, рабочий стенд не затронут.