35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
"""Integration tests for LangGraph StateGraph execution."""
|
|
|
|
import pytest
|
|
from app.workflows.gcp_architecture_graph import create_agent
|
|
from app.skills.loader import SkillLoader
|
|
from app.config import get_settings
|
|
|
|
|
|
def test_agent_graph_execution():
|
|
"""Verify execution of the 4-phase LangGraph StateGraph."""
|
|
settings = get_settings()
|
|
loader = SkillLoader(settings.SKILLS_DIR)
|
|
loader.load_skills()
|
|
|
|
agent = create_agent(loader)
|
|
initial_state = {
|
|
"workflow_request": "Event-driven regional HTTP application",
|
|
"target_dir": ".",
|
|
"active_skills": [],
|
|
}
|
|
|
|
final_state = agent.invoke(initial_state)
|
|
|
|
assert final_state.get("current_phase") == "package"
|
|
assert final_state.get("source_discovery_doc") is not None
|
|
assert final_state.get("source_mermaid_diagram") is not None
|
|
assert final_state.get("requirements_doc") is not None
|
|
assert final_state.get("architecture_doc") is not None
|
|
assert final_state.get("mermaid_diagram") is not None
|
|
assert final_state.get("terraform_code") is not None
|
|
assert final_state.get("validation_results") is not None
|
|
assert final_state.get("solution_guide") is not None
|
|
assert final_state.get("validation_passed") is True
|
|
assert len(final_state.get("active_skills", [])) == 5
|