kin: KIN-083 Healthcheck claude CLI auth: перед запуском pipeline проверять что claude залогинен (быстрый claude -p 'ok' --output-format json, проверить is_error и 'Not logged in'). Если не залогинен — не запускать pipeline, а показать ошибку 'Claude CLI requires login' в GUI с инструкцией.
This commit is contained in:
parent
a80679ae72
commit
bfc8f1c0bb
18 changed files with 1390 additions and 57 deletions
20
tests/conftest.py
Normal file
20
tests/conftest.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"""Shared pytest fixtures for Kin test suite."""
|
||||
|
||||
import pytest
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _mock_check_claude_auth():
|
||||
"""Авто-мок agents.runner.check_claude_auth для всех тестов.
|
||||
|
||||
run_pipeline() вызывает check_claude_auth() перед запуском агентов.
|
||||
Без мока тесты, использующие side_effect-очереди для subprocess.run,
|
||||
ломаются: первый вызов (auth-check) потребляет элемент очереди.
|
||||
|
||||
Тесты TestCheckClaudeAuth (test_runner.py) НЕ затрагиваются:
|
||||
они вызывают check_claude_auth через напрямую импортированную ссылку
|
||||
(bound at module load time), а не через agents.runner.check_claude_auth.
|
||||
"""
|
||||
with patch("agents.runner.check_claude_auth"):
|
||||
yield
|
||||
Loading…
Add table
Add a link
Reference in a new issue