kin: KIN-INFRA-008 Добавить индексы на project_links и unit-тесты deploy_with_dependents

This commit is contained in:
Gros Frumos 2026-03-17 18:35:17 +02:00
parent dee79420af
commit 16cd672fc4

View file

@ -843,6 +843,24 @@ def test_write_log_extra_dict_decoded(pipeline_conn):
assert entry["extra_json"]["model"] == "sonnet" assert entry["extra_json"]["model"] == "sonnet"
def test_write_log_custom_ts_stored_exactly(pipeline_conn):
"""KIN-OBS-025: write_log с ts='...' сохраняет переданный timestamp без изменений (UTC-naive)."""
db, pid = pipeline_conn
custom_ts = "2026-03-17T10:00:05"
entry = models.write_log(db, pid, "PM start: task planning", ts=custom_ts, extra={"role": "pm"})
assert entry["ts"] == custom_ts
def test_write_log_no_ts_uses_db_default(pipeline_conn):
"""KIN-OBS-025: write_log без ts — таймстемп заполняется БД (не None)."""
db, pid = pipeline_conn
entry = models.write_log(db, pid, "Regular entry")
assert entry["ts"] is not None
# DB default — UTC-naive ISO string, no timezone suffix
assert "+" not in entry["ts"]
assert "Z" not in entry["ts"]
def test_get_pipeline_logs_since_id_zero_returns_all(pipeline_conn): def test_get_pipeline_logs_since_id_zero_returns_all(pipeline_conn):
"""KIN-084: get_pipeline_logs(since_id=0) возвращает все записи.""" """KIN-084: get_pipeline_logs(since_id=0) возвращает все записи."""
db, pid = pipeline_conn db, pid = pipeline_conn