Skip to content

Commit a04efb7

Browse files
authored
test: add rest of quickstarts plus wip starting with 05 ones (#272)
* test: add rest of quickstarts plus wip starting with 05 ones Signed-off-by: Samantha Coyle <[email protected]> * fix: update so rest of tests work Signed-off-by: Samantha Coyle <[email protected]> * fix: tox -e ruff Signed-off-by: Samantha Coyle <[email protected]> * style: stream all logs by default for starters Signed-off-by: Samantha Coyle <[email protected]> * style: appease flake8: Signed-off-by: Samantha Coyle <[email protected]> * fix: run all int tests in ci wf Signed-off-by: Samantha Coyle <[email protected]> * style: tox -e ruff Signed-off-by: Samantha Coyle <[email protected]> * style: use helpers Signed-off-by: Samantha Coyle <[email protected]> * style: update comments Signed-off-by: Samantha Coyle <[email protected]> * style: tox -e ruff Signed-off-by: Samantha Coyle <[email protected]> * fix: rm pr req check Signed-off-by: Samantha Coyle <[email protected]> --------- Signed-off-by: Samantha Coyle <[email protected]>
1 parent 0afa795 commit a04efb7

29 files changed

+1956
-288
lines changed

.github/workflows/integration-tests.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ jobs:
2323
# Team membership will be verified for issue_comment events only
2424
if: |
2525
(github.event_name == 'issue_comment' &&
26-
github.event.issue.pull_request &&
2726
contains(github.event.comment.body, '/ok-to-test')) ||
28-
github.event_name == 'pull_request' ||
2927
github.event_name == 'workflow_dispatch'
3028
steps:
3129
- name: Simple check to verify user is authorized
@@ -106,8 +104,8 @@ jobs:
106104
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
107105
run: |
108106
109-
uv run pytest -m integration -v tests/integration/quickstarts/test_01_*.py tests/integration/quickstarts/test_02_*.py
110-
# Run all integration tests in parallel (one file per quickstart directory)
107+
uv run pytest -m integration -v tests/integration/quickstarts
108+
# TODO: In future, run all integration tests in parallel (one file per quickstart directory)
111109
# -n auto uses all available CPUs, or specify -n 4 for fixed number
112110
# pytest -m integration -v -n auto tests/integration/quickstarts/
113111

dapr_agents/agents/orchestrators/random.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,13 @@ async def _broadcast() -> None:
272272
logger.exception("Failed to publish broadcast message.")
273273

274274
def _select_random_speaker_activity(self, ctx: wf.WorkflowActivityContext) -> str:
275-
"""Pick a random agent from the registry, avoiding the most recent speaker when possible."""
275+
"""
276+
Pick a random agent from the registry, avoiding the most recent speaker when possible.
277+
278+
TODO: This method selects from all registered agents in the team, including
279+
orchestrators. In the future, we may want to add health checks or availability
280+
checks to ensure selected agents are actually running and ready to receive triggers.
281+
"""
276282
try:
277283
agents_metadata = self.list_team_agents(
278284
include_self=False, team=self.effective_team()

dapr_agents/agents/orchestrators/roundrobin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ def _select_next_speaker_activity(
255255
) -> str:
256256
"""
257257
Deterministic round-robin selection based on turn number.
258+
259+
TODO: This method selects from all registered agents in the team, including
260+
orchestrators. In the future, we may want to add health checks or availability
261+
checks to ensure selected agents are actually running and ready to receive triggers.
258262
"""
259263
turn = int(payload.get("turn", 1))
260264
try:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: agentregistrystore_llm
5+
spec:
6+
type: state.redis
7+
version: v1
8+
metadata:
9+
- name: redisHost
10+
value: localhost:6379
11+
- name: keyPrefix
12+
value: none
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: agentregistrystore_random
5+
spec:
6+
type: state.redis
7+
version: v1
8+
metadata:
9+
- name: redisHost
10+
value: localhost:6379
11+
- name: keyPrefix
12+
value: none
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: agentregistrystore_roundrobin
5+
spec:
6+
type: state.redis
7+
version: v1
8+
metadata:
9+
- name: redisHost
10+
value: localhost:6379
11+
- name: keyPrefix
12+
value: none

quickstarts/05-multi-agent-workflows/services/frodo/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import logging
5+
import os
56

67
from dotenv import load_dotenv
78

@@ -35,7 +36,9 @@ async def main() -> None:
3536
"""
3637
# Shared infra (registry)
3738
registry = AgentRegistryConfig(
38-
store=StateStoreService(store_name="agentregistrystore"),
39+
store=StateStoreService(
40+
store_name=os.getenv("REGISTRY_STATE_STORE", "agentregistrystore")
41+
),
3942
team_name="fellowship",
4043
)
4144

quickstarts/05-multi-agent-workflows/services/gandalf/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import logging
5+
import os
56

67
from dotenv import load_dotenv
78

@@ -35,7 +36,9 @@ async def main() -> None:
3536
"""
3637
# Shared infra (registry)
3738
registry = AgentRegistryConfig(
38-
store=StateStoreService(store_name="agentregistrystore"),
39+
store=StateStoreService(
40+
store_name=os.getenv("REGISTRY_STATE_STORE", "agentregistrystore")
41+
),
3942
team_name="fellowship",
4043
)
4144

quickstarts/05-multi-agent-workflows/services/legolas/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import logging
5+
import os
56

67
from dotenv import load_dotenv
78

@@ -35,7 +36,9 @@ async def main() -> None:
3536
"""
3637
# Shared infra (registry)
3738
registry = AgentRegistryConfig(
38-
store=StateStoreService(store_name="agentregistrystore"),
39+
store=StateStoreService(
40+
store_name=os.getenv("REGISTRY_STATE_STORE", "agentregistrystore")
41+
),
3942
team_name="fellowship",
4043
)
4144

quickstarts/05-multi-agent-workflows/services/sam/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import logging
5+
import os
56

67
from dotenv import load_dotenv
78

@@ -40,7 +41,9 @@ async def main() -> None:
4041
"""
4142
# Shared infra (registry)
4243
registry = AgentRegistryConfig(
43-
store=StateStoreService(store_name="agentregistrystore"),
44+
store=StateStoreService(
45+
store_name=os.getenv("REGISTRY_STATE_STORE", "agentregistrystore")
46+
),
4447
team_name="fellowship",
4548
)
4649

0 commit comments

Comments
 (0)