kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-17 16:51:17 +02:00
parent 4374fa1d9d
commit 6acb2041f2

View file

@ -394,6 +394,27 @@ def test_migrate_preserves_non_dept_sub_and_non_running_pipelines():
conn.close() conn.close()
# ---------------------------------------------------------------------------
# Schema KIN-OBS-014: pid INTEGER присутствует в SCHEMA-строке CREATE TABLE pipelines
# ---------------------------------------------------------------------------
def test_schema_string_contains_pid_integer_in_pipelines_ddl():
"""Регрессия KIN-OBS-014: SCHEMA-строка содержит 'pid INTEGER' в теле CREATE TABLE pipelines.
До фикса поле было только в _migrate(), но отсутствовало в SCHEMA
при свежей инициализации БД колонка не создавалась.
Тест парсит блок CREATE TABLE pipelines напрямую из SCHEMA.
"""
from core.db import SCHEMA
start = SCHEMA.index("CREATE TABLE IF NOT EXISTS pipelines")
end = SCHEMA.index(");", start) + 2
pipelines_ddl = SCHEMA[start:end]
assert "pid INTEGER" in pipelines_ddl, (
"pid INTEGER не найден в SCHEMA CREATE TABLE pipelines — "
"поле должно быть в SCHEMA (core/db.py строки ~133-148), а не только в _migrate()"
)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Schema KIN-OBS-018: pid INTEGER присутствует в таблице pipelines # Schema KIN-OBS-018: pid INTEGER присутствует в таблице pipelines
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------