You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.9 KiB
59 lines
1.9 KiB
"""Tests for agent pipeline control primitives."""
|
|
|
|
import pytest
|
|
|
|
pytest.importorskip("duckdb")
|
|
|
|
|
|
class TestPipelineRunStage:
|
|
def test_dry_run_returns_planned_actions(self, tmp_duckdb_path):
|
|
from agent_tools.pipeline import pipeline_run_stage
|
|
|
|
result = pipeline_run_stage(tmp_duckdb_path, stage="svd", window_id="2024", dry_run=True)
|
|
assert isinstance(result, dict)
|
|
assert "stage" in result
|
|
assert result.get("dry_run") is True
|
|
|
|
def test_invalid_stage_returns_error(self, tmp_duckdb_path):
|
|
from agent_tools.pipeline import pipeline_run_stage
|
|
|
|
result = pipeline_run_stage(tmp_duckdb_path, stage="invalid")
|
|
assert isinstance(result, dict)
|
|
assert "error" in result
|
|
|
|
|
|
class TestPipelineRunFull:
|
|
def test_dry_run_returns_plan(self, tmp_duckdb_path):
|
|
from agent_tools.pipeline import pipeline_run_full
|
|
|
|
result = pipeline_run_full(tmp_duckdb_path, dry_run=True)
|
|
assert isinstance(result, dict)
|
|
assert "stages" in result or "dry_run" in result
|
|
|
|
|
|
class TestPipelineCheckHealth:
|
|
def test_returns_health_report(self, tmp_duckdb_path):
|
|
from agent_tools.pipeline import pipeline_check_health
|
|
|
|
result = pipeline_check_health(tmp_duckdb_path)
|
|
assert isinstance(result, dict)
|
|
assert "checks" in result
|
|
assert "healthy" in result
|
|
|
|
|
|
class TestPipelineGetLogs:
|
|
def test_returns_log_lines(self, tmp_duckdb_path):
|
|
from agent_tools.pipeline import pipeline_get_logs
|
|
|
|
result = pipeline_get_logs(tmp_duckdb_path, stage="svd", lines=10)
|
|
assert isinstance(result, list)
|
|
assert len(result) <= 10
|
|
|
|
|
|
class TestPipelineValidateOutput:
|
|
def test_validates_stage_output(self, tmp_duckdb_path):
|
|
from agent_tools.pipeline import pipeline_validate_output
|
|
|
|
result = pipeline_validate_output(tmp_duckdb_path, stage="svd")
|
|
assert isinstance(result, dict)
|
|
assert "valid" in result
|
|
|