Python: Update lab test trigger (#1632)

* Update lab test trigger

* fix tests
This commit is contained in:
Eric Zhu
2025-10-23 11:11:57 -07:00
committed by GitHub
Unverified
parent 1f19a6da5c
commit 064ee8afbe
2 changed files with 16 additions and 5 deletions
+5 -4
View File
@@ -1,14 +1,15 @@
name: Python - Lab Tests
on:
workflow_dispatch:
pull_request:
branches: ["main", "feature*"]
paths:
- "python/packages/lab/**"
push:
branches: ["main"]
paths:
- "python/packages/lab/**"
merge_group:
branches: ["main"]
schedule:
- cron: "0 0 * * *" # Run at midnight UTC daily
env:
# Configure a constant location for the uv cache
@@ -10,6 +10,7 @@ from agent_framework import (
ChatAgent,
WorkflowBuilder,
)
from agent_framework._workflows._events import AgentRunEvent
from agent_framework.openai import OpenAIChatClient
from agent_framework_lab_lightning import init
from agentlightning.adapter import TraceTripletAdapter
@@ -110,7 +111,16 @@ def workflow_two_agents():
async def test_openai_workflow_two_agents(workflow_two_agents):
events = await workflow_two_agents.run("Please analyze the quarterly sales data")
assert "Based on the analysis 'Analyzed data shows trend upward', I recommend investing" in events.get_outputs()
# Get all AgentRunEvent data
agent_outputs = [event.data for event in events if isinstance(event, AgentRunEvent)]
# Check that we have outputs from both agents
assert len(agent_outputs) == 2
assert any("Analyzed data shows trend upward" in str(output) for output in agent_outputs)
assert any(
"Based on the analysis 'Analyzed data shows trend upward', I recommend investing" in str(output)
for output in agent_outputs
)
async def test_observability(workflow_two_agents):