Files
mtusi2026lab2/evidence/tests/test-isolated.md
T
ricoromaandClaude Opus 5.5 b0357468ff docs: add failure checks evidence and report
Evidence from 5b65051: make failure_checks passes 12 checks in 45 s and
leaves the working stand untouched (same StartedAt and row counts);
make test_isolated reports 98 of 108 scenarios tested, 13 of them by the
failure checks. REPORT.md gets the level 4 rows for automatic expiry,
database and Valkey checks and the chat creation rollback. The spec and
rule note that two failure check runs must not overlap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 23:39:39 +03:00

4.0 KiB

make test_isolated: публичный smoke и весь набор против образа

Спеки student-tests «Прогон на временной базе» — сценарий «Успешный прогон»; «Результат прогона сохраняется»; container-run «Штатный запуск» (make student_test проходит)
Change failure-checks, задача 4.1 (прошлые прогоны: membership-cache, commit cae4b09, 103 теста и 23 исключения; session-auth, commit ae4154e, 99 тестов)
Дата 2026-10-01 20:36 UTC
Commit 5b65051
Стенд рабочий 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. 12 проверок отказов (маркер fault) здесь собраны, но не выполняются (deselected): их прогон — evidence/tests/failure-checks.md.

Прогон

$ 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, 98 tested (13 by make failure_checks), 10 excluded
====================== 103 passed, 12 deselected in 9.21s ======================
[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):

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: из 108 — 98 тестами (13 из них — проверками отказов make failure_checks) и 10 исключениями.
  • Временная база и контейнер убраны, рабочий стенд не затронут.