-
Notifications
You must be signed in to change notification settings - Fork 42
Integration testing framework #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 16 commits
cfb8847
4d93a46
be2fb1c
0d5539a
bf4c006
ebe622d
45678e9
c2b84cb
2816e68
2214827
c90c8e4
36f5c3b
dfdd959
d4828fb
91b3c44
1eefe44
a06da9a
d36ec7a
c096048
5451ddf
c2cdd40
7d91ef9
87610a5
ddfdd0b
dd0a87d
6a4e8ef
7793790
3ebbd44
a6681bf
1a7264b
9ba4a43
fab4368
a111155
a2a1092
ae8a286
9a5a6a8
aad011a
be0032a
e3f4324
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| aioresponses | ||
| microsoft-agents-activity | ||
| microsoft-agents-hosting-core | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||
| import pytest | ||||||
| import asyncio | ||||||
|
|
||||||
| from ..core import integration | ||||||
|
|
||||||
|
|
||||||
| @integration(service_url="http://localhost:3978/api/messages") | ||||||
|
||||||
| @integration(service_url="http://localhost:3978/api/messages") | |
| @integration(messaging_endpoint="http://localhost:3978/api/messages") |
Outdated
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AgentClient.send() method doesn't exist. Based on the implementation in agent_client.py, this should be await agent_client.send_activity(\"hi\") or await agent_client.send_expect_replies(\"hi\").
| await agent_client.send("hi") | |
| await agent_client.send_activity("hi") |
Outdated
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ResponseClient class does not have a pop() method defined. This will cause an AttributeError at runtime.
| response = (await response_client.pop())[0] | |
| response = (await response_client.get())[0] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| aioresponses |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from .application_runner import ApplicationRunner | ||
| from .client import ( | ||
| AgentClient, | ||
| ResponseClient, | ||
| ) | ||
| from .environment import Environment | ||
| from .integration import integration | ||
| from .integration_fixtures import IntegrationFixtures | ||
| from .sample import Sample | ||
|
|
||
|
|
||
| __all__ = [ | ||
| "AgentClient", | ||
| "ApplicationRunner", | ||
| "ResponseClient", | ||
| "Environment", | ||
| "integration", | ||
| "IntegrationFixtures", | ||
| "Sample", | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||||||||||||||||||||||||||
| from abc import ABC, abstractmethod | ||||||||||||||||||||||||||||||||
| from typing import Any, Optional | ||||||||||||||||||||||||||||||||
| from threading import Thread | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| class ApplicationRunner(ABC): | ||||||||||||||||||||||||||||||||
| """Base class for application runners.""" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| def __init__(self, app: Any): | ||||||||||||||||||||||||||||||||
| self._app = app | ||||||||||||||||||||||||||||||||
| self._thread: Optional[Thread] = None | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| @abstractmethod | ||||||||||||||||||||||||||||||||
| def _start_server(self) -> None: | ||||||||||||||||||||||||||||||||
| raise NotImplementedError("Start server method must be implemented by subclasses") | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| def _stop_server(self) -> None: | ||||||||||||||||||||||||||||||||
| pass | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| async def __aenter__(self) -> None: | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if self._thread: | ||||||||||||||||||||||||||||||||
| raise RuntimeError("Server is already running") | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| self._thread = Thread(target=self._start_server, daemon=True) | ||||||||||||||||||||||||||||||||
| self._thread.start() | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
Comment on lines
23
to
33
|
||||||||||||||||||||||||||||||||
| async def __aenter__(self) -> None: | |
| if self._thread: | |
| raise RuntimeError("Server is already running") | |
| self._thread = Thread(target=self._start_server, daemon=True) | |
| self._thread.start() | |
| async def __aenter__(self) -> "ApplicationRunner": | |
| if self._thread: | |
| raise RuntimeError("Server is already running") | |
| self._thread = Thread(target=self._start_server, daemon=True) | |
| self._thread.start() | |
| return self |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from .agent_client import AgentClient | ||
| from .response_client import ResponseClient | ||
|
|
||
| __all__ = [ | ||
| "AgentClient", | ||
| "ResponseClient", | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,107 @@ | ||||||
| import os | ||||||
|
||||||
| import os |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'os' module is imported but not used anywhere in this file. Remove this unused import.
| import os |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'asyncio' is not used.
| import asyncio |
Outdated
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'Any' is not used.
| from typing import Any, Optional, cast | |
| from typing import Optional, cast |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable timeout is not used.
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable timeout is not used.
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable timeout is not used.
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable timeout is not used.
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable timeout is not used.
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable timeout is not used.
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable timeout is not used.
Outdated
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable timeout is not used.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # from microsoft_agents.activity import Activity | ||
|
|
||
| # from ..agent_client import AgentClient | ||
|
|
||
| # class AutoClient: | ||
|
|
||
| # def __init__(self, agent_client: AgentClient): | ||
| # self._agent_client = agent_client | ||
|
|
||
| # async def generate_message(self) -> str: | ||
| # pass | ||
|
|
||
| # async def run(self, max_turns: int = 10, time_between_turns: float = 2.0) -> None: | ||
|
|
||
| # for i in range(max_turns): | ||
| # await self._agent_client.send_activity( | ||
| # Activity(type="message", text=self.generate_message()) | ||
| # ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file appears to be misnamed or incorrectly formatted. Based on the naming pattern 'env.TEMPLATE' and comparison with 'dev/integration/src/tests/env.TEMPLATE', this should likely contain environment variable templates (e.g., KEY=value format) rather than package names. The content looks like it belongs in a requirements file instead.