From 4374fa1d9d3250aaf14d4900be6f320694e6c901 Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Tue, 17 Mar 2026 16:51:14 +0200 Subject: [PATCH 1/2] =?UTF-8?q?kin:=20KIN-OBS-016=20=D0=98=D1=81=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D1=83=D1=82=D0=B5=D1=87?= =?UTF-8?q?=D0=BA=D1=83=20=D1=82=D0=B0=D0=B9=D0=BC=D0=B5=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=20watchdog-=D1=82=D0=BE=D1=81=D1=82=D0=BE=D0=B2=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BC=D0=BE=D0=BD=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B8=20EscalationBanner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_db.py b/tests/test_db.py index 0cbb472..a734eba 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -408,7 +408,7 @@ class TestPipelinesSchemaKinObs018: def test_pid_defaults_to_null(self, conn): """Вставка pipeline без pid — значение NULL.""" conn.execute( - "INSERT INTO projects (id, name) VALUES ('p_pid', 'P')" + "INSERT INTO projects (id, name, path) VALUES ('p_pid', 'P', '/p')" ) conn.execute( "INSERT INTO tasks (id, project_id, title) VALUES ('t_pid', 'p_pid', 'T')" @@ -426,7 +426,7 @@ class TestPipelinesSchemaKinObs018: def test_pid_can_store_integer_value(self, conn): """Вставка pipeline с pid — значение сохраняется в БД.""" conn.execute( - "INSERT INTO projects (id, name) VALUES ('p_pid2', 'P')" + "INSERT INTO projects (id, name, path) VALUES ('p_pid2', 'P', '/p')" ) conn.execute( "INSERT INTO tasks (id, project_id, title) VALUES ('t_pid2', 'p_pid2', 'T')" From 6acb2041f246ad62c544c30dff97101a53f411cc Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Tue, 17 Mar 2026 16:51:17 +0200 Subject: [PATCH 2/2] kin: auto-commit after pipeline --- tests/test_db.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_db.py b/tests/test_db.py index a734eba..d3d3a70 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -394,6 +394,27 @@ def test_migrate_preserves_non_dept_sub_and_non_running_pipelines(): 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 # ---------------------------------------------------------------------------