forked from mtusi2026/mtusi2026lab2
feat: ЛР2 - PostgreSQL, Redis сессии и keyset-пагинация
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
highload-messenger-lab2 highload-messenger:lab2 "python -m uvicorn a…" api About a minute ago Up 4 seconds (health: starting) 127.0.0.1:8080->8080/tcp
|
||||
highload-postgres-lab2 postgres:16-alpine "docker-entrypoint.s…" postgres 4 minutes ago Up 4 seconds (healthy) 127.0.0.1:5432->5432/tcp
|
||||
highload-redis-lab2 redis:7-alpine "docker-entrypoint.s…" redis 4 minutes ago Up 4 seconds (healthy) 127.0.0.1:6379->6379/tcp
|
||||
@@ -0,0 +1,13 @@
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Limit (cost=0.29..10.08 rows=2 width=67) (actual time=0.016..0.019 rows=0 loops=1)
|
||||
Buffers: shared hit=2
|
||||
-> Index Scan using idx_messages_cursor on messages (cost=0.29..10.08 rows=2 width=67) (actual time=0.015..0.018 rows=0 loops=1)
|
||||
Index Cond: ((chat_id = 'e6eefcbf-9c69-4768-ad96-e44d6338e030'::uuid) AND (ROW(created_at, id) > ROW('2026-10-22 19:24:00+00'::timestamp with time zone, '00000000-0000-0000-0000-000000000000'::uuid)))
|
||||
Buffers: shared hit=2
|
||||
Planning:
|
||||
Buffers: shared hit=106
|
||||
Planning Time: 0.589 ms
|
||||
Execution Time: 0.071 ms
|
||||
(9 rows)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
no_proxy=localhost,127.0.0.1 NO_PROXY=localhost,127.0.0.1 python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,2 @@
|
||||
no_proxy=localhost,127.0.0.1 NO_PROXY=localhost,127.0.0.1 python3 tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,28 @@
|
||||
no_proxy=localhost,127.0.0.1 NO_PROXY=localhost,127.0.0.1 BASE_URL="http://localhost:8080" .venv/bin/python3 -m pytest tests_student/ -v
|
||||
============================= test session starts ==============================
|
||||
platform linux -- Python 3.12.15, pytest-9.1.1, pluggy-1.7.0 -- /home/ilyas/projects/labs_highload/mtusi2026lab2/.venv/bin/python3
|
||||
cachedir: .pytest_cache
|
||||
rootdir: /home/ilyas/projects/labs_highload/mtusi2026lab2
|
||||
configfile: pytest.ini
|
||||
plugins: anyio-4.15.1, asyncio-1.4.0
|
||||
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
|
||||
collecting ... collected 16 items
|
||||
|
||||
tests_student/tests.py::test_invalid_json_and_extra_fields PASSED [ 6%]
|
||||
tests_student/tests.py::test_outsider_chat_access_is_404 PASSED [ 12%]
|
||||
tests_student/tests.py::test_empty_and_whitespace_message PASSED [ 18%]
|
||||
tests_student/tests.py::test_duplicate_username_conflict PASSED [ 25%]
|
||||
tests_student/tests.py::test_wrong_password_and_bad_basic_auth PASSED [ 31%]
|
||||
tests_student/tests.py::test_logout_and_revocation PASSED [ 37%]
|
||||
tests_student/tests.py::test_multi_page_cursor_pagination PASSED [ 43%]
|
||||
tests_student/tests.py::test_concurrency_race_condition PASSED [ 50%]
|
||||
tests_student/tests.py::test_password_whitespace_rejected PASSED [ 56%]
|
||||
tests_student/tests.py::test_auth_sessions_with_body_rejected PASSED [ 62%]
|
||||
tests_student/tests.py::test_unsupported_media_type_415 PASSED [ 68%]
|
||||
tests_student/tests.py::test_nul_byte_in_strings_handled PASSED [ 75%]
|
||||
tests_student/tests.py::test_basic_auth_invalid_base64_returns_401 PASSED [ 81%]
|
||||
tests_student/tests.py::test_cross_chat_cursor_rejected_400 PASSED [ 87%]
|
||||
tests_student/tests.py::test_utf8_password_support PASSED [ 93%]
|
||||
tests_student/tests.py::test_health_readiness_and_liveness PASSED [100%]
|
||||
|
||||
============================== 16 passed in 7.38s ==============================
|
||||
Reference in New Issue
Block a user