docs: add session-auth evidence and report
- passwords and tokens: Argon2id hashes, no secrets in db and logs
- session expiry and database outage with a valid token
- make test-persistence and make test_isolated on ae4154e
- migration drops lab 1 data without passwords
- REPORT.md: sessions, defense scenario, evidence rows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
# `make test_isolated`: публичный smoke и весь набор против образа
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Спеки | `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 |
|
||||
| Хост | Docker Desktop 29.8.1, macOS arm64; ВМ Docker: 12 CPU, 7 GiB RAM; лимиты контейнерам не задавались |
|
||||
|
||||
Механика временной базы и уборка при любом исходе —
|
||||
`evidence/tests/test-isolated-mechanics.md`. Здесь — первый зелёный
|
||||
прогон: до `session-auth` smoke лабы 2 падал на регистрации с паролем.
|
||||
|
||||
## Прогон
|
||||
|
||||
```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: 96 scenarios in 9 specs, 81 tested, 15 excluded
|
||||
============================== 99 passed in 8.66s ==============================
|
||||
[test_isolated] cleanup
|
||||
[test_isolated] results: {'test': 0, 'student_test': 0}
|
||||
```
|
||||
|
||||
Строки `PASSED` по модулям:
|
||||
|
||||
| Модуль | Прошло |
|
||||
|---|---|
|
||||
| `test_api_conventions.py` | 11 |
|
||||
| `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 |
|
||||
| **всего** | **99** |
|
||||
|
||||
Гонки уровня «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 проходит публичный smoke
|
||||
лабы 2 и все 99 собственных тестов, включая вход, Bearer, logout и
|
||||
неверный пароль.
|
||||
- Каждый сценарий HTTP-спеков покрыт тестом или исключением с причиной
|
||||
и ссылкой на evidence: 81 тестом и 15 исключениями из 96.
|
||||
- Временная база и контейнер убраны, рабочий стенд не затронут.
|
||||
Reference in New Issue
Block a user