forked from mtusi2026/mtusi2026lab4
ЛР 4: S3-хранилище (SeaweedFS) и вложения
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# db: PostgreSQL: rollback, FK, Argon2id, unique keys, migrations
|
||||
# date: 2026-10-21 21:09:10, commit: 2dbed80 + uncommitted changes
|
||||
# command: python.exe student-tests/test_db.py
|
||||
# exit code: 0, 14.2 s
|
||||
|
||||
chat with unknown member -> 400; rows with this title: 0; chats without members: 0; chats insert counter: 57 -> 58
|
||||
PASS: chat row was inserted and then rolled back together with members
|
||||
direct INSERT of a message from a non-member -> exit code 1: ERROR: insert or update on table "messages" violates foreign key constraint "messages_chat_id_sender_id_fkey"
|
||||
PASS: the database itself rejects a message from a non-member
|
||||
stored password: $argon2id$v=19$m=12288,t=3,p=1$... (length 97)
|
||||
PASS: password is stored as Argon2id hash
|
||||
unique constraint on users: UNIQUE (username)
|
||||
PASS: username is unique in the database
|
||||
applied migrations: 001_init.sql,002_text_as_bytes.sql,003_idempotency.sql,004_attachments.sql; running the migrate service once more
|
||||
after the second run: 001_init.sql,002_text_as_bytes.sql,003_idempotency.sql,004_attachments.sql; log: Migrations applied: none (schema is up to date)
|
||||
PASS: migrations are applied once, a repeated run does nothing
|
||||
api replicas that checked the schema at start: 8; api log lines 'Migrations applied': 0; migrate service: Exited (0) 6 minutes ago
|
||||
PASS: only the migrate service applies migrations, replicas wait for the schema
|
||||
unique constraint for Idempotency-Key: UNIQUE (chat_id, sender_id, idempotency_key)
|
||||
PASS: one message per (chat, sender, Idempotency-Key) is enforced by the database
|
||||
7 passed, 0 failed
|
||||
Reference in New Issue
Block a user